Skip to content

Commit

Permalink
Merge pull request #426 from itk-dev/hotfix/deployment
Browse files Browse the repository at this point in the history
Deployment
  • Loading branch information
cableman authored Dec 4, 2024
2 parents eff3beb + 88988be commit cbb8196
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

set_real_ip_from 172.16.0.0/8;
set_real_ip_from 172.16.0.0/16;
real_ip_recursive on;
real_ip_header X-Forwarded-For;

Expand Down
4 changes: 4 additions & 0 deletions .docker/templates/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ server {

client_max_body_size ${NGINX_MAX_BODY_SIZE};

set_real_ip_from 172.16.0.0/16;
real_ip_recursive on;
real_ip_header X-Forwarded-For;

location = /favicon.ico {
log_not_found off;
access_log off;
Expand Down
94 changes: 0 additions & 94 deletions .docker/vhost.conf

This file was deleted.

25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#### Link to ticket

Please add a link to the ticket being addressed by this change.

#### Description

Please include a short description of the suggested change and the reasoning behind the approach you have chosen.

#### Screenshot of the result

If your change affects the user interface you should include a screenshot of the result with the pull request.

#### Checklist

- [ ] My code is covered by test cases.
- [ ] My code passes our test (all our tests).
- [ ] My code passes our static analysis suite.
- [ ] My code passes our continuous integration process.

If your code does not pass all the requirements on the checklist you have to add a comment explaining why this change
should be exempt from the list.

#### Additional comments or questions

If you have any further comments or questions for the reviewer please add them here.
54 changes: 54 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
push:
tags:
- '*.*.*'

name: Create Github Release

permissions:
contents: write

jobs:
create-release:
runs-on: ubuntu-latest
env:
COMPOSER_ALLOW_SUPERUSER: 1
APP_ENV: prod
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Composer install
run: |
docker network create frontend
docker compose run --rm --user=root phpfpm composer install --no-dev -o --classmap-authoritative
docker compose run --rm --user=root phpfpm composer clear-cache
- name: Building assets for the frontend
run: |
docker compose run --rm node yarn --cwd /app/web/themes/custom/hoeringsportal install
docker compose run --rm node yarn --cwd /app/web/themes/custom/hoeringsportal build
- name: Clean up
run: |
sudo chown -R runner:runner ./
rm -rf web/themes/custom/hoeringsportal/node_modules
- name: Make assets dir
run: |
mkdir -p ../assets
- name: Create archive
run: |
tar --exclude='.git' -zcf ../assets/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz ./
- name: Create checksum
run: |
cd ../assets
sha256sum ${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz > ../assets/checksum.txt
- name: Create a release in GitHub and uploads assets
run: gh release create ${{ github.ref_name }} --verify-tag --generate-notes ../assets/*.*
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
9 changes: 1 addition & 8 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
on:
pull_request:
types:
- opened
- labeled
- unlabeled
- synchronize
- reopened
on: pull_request

name: PR Review
jobs:
Expand Down
32 changes: 32 additions & 0 deletions .woodpecker/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
when:
- event: release

skip_clone: true

steps:
- name: Ansible playbook
image: itkdev/ansible-plugin:1
pull: true
settings:
id:
from_secret: id
secret:
from_secret: secret
host:
from_secret: host
path:
from_secret: path
user:
from_secret: user
playbook: 'release'
pre_up:
- itkdev-docker-compose-server run --rm phpfpm vendor/bin/drush --yes cache:rebuild
- itkdev-docker-compose-server run --rm phpfpm vendor/bin/drush --yes deploy
cron:
cron:
minute: '0'
hour: '*'
day: '*'
month: '*'
weekday: '*'
job: 'itkdev-docker-compose-server exec phpfpm vendor/bin/drush core:cron'
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [4.6.1] - 2024-12-04

* Added automatic deployment

## [4.6.0] - 2024-11-11

* [PR-422](https://github.com/itk-dev/hoeringsportal/pull/422)
Expand Down Expand Up @@ -256,6 +260,7 @@ Updated drupal core 8.6.16
Initial release

[Unreleased]: https://github.com/itk-dev/hoeringsportal/compare/4.6.0...HEAD
[4.6.1]: https://github.com/itk-dev/hoeringsportal/compare/4.6.0...4.6.1
[4.6.0]: https://github.com/itk-dev/hoeringsportal/compare/4.5.1...4.6.0
[4.5.1]: https://github.com/itk-dev/hoeringsportal/compare/4.5.0...4.5.1
[4.5.0]: https://github.com/itk-dev/hoeringsportal/compare/4.4.1...4.5.0
Expand Down
10 changes: 6 additions & 4 deletions docker-compose.server.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ services:
- PHP_POST_MAX_SIZE=90M
- PHP_UPLOAD_MAX_FILESIZE=80M
- PHP_OPCACHE_VALIDATE_TIMESTAMPS=0
- PHP_MEMORY_LIMIT=528M
- PHP_MEMORY_LIMIT=512M
volumes:
- ../../shared/settings.local.php:/app/web/sites/default/settings.local.php
- ../../shared/files:/app/web/sites/default/files

nginx:
environment:
# Match PHP_UPLOAD_MAX_FILESIZE (plus a little more)
NGINX_MAX_BODY_SIZE: 90M
volumes:
- ../../shared/files:/app/web/sites/default/files

node:
image: node:18
Expand All @@ -21,6 +26,3 @@ services:
image: clamav/clamav:1.2
networks:
- app
ports:
- '3310'
- '7357'

0 comments on commit cbb8196

Please sign in to comment.