diff --git a/.ddev/.gitignore b/.ddev/.gitignore index a19f1799..97529c26 100644 --- a/.ddev/.gitignore +++ b/.ddev/.gitignore @@ -28,7 +28,10 @@ /mutagen/.start-synced /nginx_full/nginx-site.conf /postgres/postgresql.conf +/providers/acquia.yaml +/providers/lagoon.yaml /providers/platform.yaml +/providers/upsun.yaml /sequelpro.spf /settings/settings.ddev.py /traefik/config/intercept.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9803555..15d9845f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,11 @@ on: branches: - master - develop + paths-ignore: + - 'legacy_hook/**' pull_request: + paths-ignore: + - 'legacy_hook/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/legacy-hook.yml b/.github/workflows/legacy-hook.yml new file mode 100644 index 00000000..64685a23 --- /dev/null +++ b/.github/workflows/legacy-hook.yml @@ -0,0 +1,145 @@ +name: Legacy webhook + +on: + push: + branches: + - master + - develop + paths: + - 'legacy_hook/**/*' + pull_request: + paths: + - 'legacy_hook/**/*' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php-versions: + - '8.2' + + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + coverage: pcov + + - name: Setup Composer cache + id: composer-cache + run: | + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Recover Composer caches + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock', '**/composer.json') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Change working dir + run: + cd legacy_hook + + - name: Install dependencies (Composer) + run: composer install --prefer-dist --no-progress --no-interaction --ansi + env: + COMPOSER_AUTH: '{ + "http-basic": { + "repo.packagist.com": { + "username": "token", + "password": "${{ secrets.PACKAGIST_AUTH_TOKEN }}" + } + }, + "github-oauth": { + "github.com": "${{ secrets.ACTIONS_TOKEN }}" + } + }' + - name: Tests + run: composer t3g:test + + deployment: + name: 'Deployment' + needs: build + if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' + runs-on: ubuntu-latest + steps: + - name: Setup SSH Key + env: + SSH_AUTH_SOCK: /tmp/ssh-auth.sock + run: | + mkdir -p ~/.ssh + echo "${{ secrets.PROD_SSH_PRIVATE_KEY }}" > ~/.ssh/deploy_legacy_hook_rsa + chmod 0600 ~/.ssh/deploy_legacy_hook_rsa + ssh-keygen -p -P "${{ secrets.PROD_SSH_PASSPHRASE }}" -N "" -f ~/.ssh/deploy_legacy_hook_rsa + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add ~/.ssh/deploy_legacy_hook_rsa + + - uses: actions/checkout@v4 + + - name: Setup PHP ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + + - name: Setup Composer cache + id: composer-cache + run: | + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Recover Composer caches + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock', '**/composer.json') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install Magallanes + run: | + composer global require "andres-montanez/magallanes" --no-progress + /home/runner/.composer/vendor/bin/mage version + mkdir -p ./.mage/logs + + - name: Get Environment + id: environment + run: | + echo "target=legacy_hook_$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" >> $GITHUB_OUTPUT + + - name: Deployment + env: + SSH_AUTH_SOCK: /tmp/ssh-auth.sock + COMPOSER_AUTH: '{ + "http-basic": { + "repo.packagist.com": { + "username": "token", + "password": "${{ secrets.PACKAGIST_AUTH_TOKEN }}" + } + }, + "github-oauth": { + "github.com": "${{ secrets.ACTIONS_TOKEN }}" + } + }' + run: | + /home/runner/.composer/vendor/bin/mage deploy ${{ steps.environment.outputs.target }} -vvv + + - name: Archive Logs + uses: actions/upload-artifact@v3 + if: always() + with: + name: logs + path: .mage/logs + + - name: Echo logs + run: find .mage/logs/ -type f -exec cat {} + + if: always() diff --git a/.mage.yml b/.mage.yml index 6a1046c1..e9c53b05 100644 --- a/.mage.yml +++ b/.mage.yml @@ -82,3 +82,16 @@ magephp: - exec: { cmd: "rm -rf var/cache"} - exec: { cmd: "php8.2 ./bin/console cache:warmup"} post-deploy: + + legacy_hook_master: + user: prod.docs.typo.com + from: ./legacy_hook/ + host_path: /srv/vhosts/prod.docs.typo3.com/site/Web/services/ + hosts: + - prod.docs.typo3.com + pre-deploy: + - composer/install: { flags: "--no-dev --no-progress --optimize-autoloader --ansi"} + on-deploy: + on-release: + post-release: + post-deploy: diff --git a/legacy_hook/.gitignore b/legacy_hook/.gitignore index 48b8bf90..97c97cb6 100644 --- a/legacy_hook/.gitignore +++ b/legacy_hook/.gitignore @@ -1 +1,2 @@ +.phpunit.cache/ vendor/ diff --git a/legacy_hook/composer.json b/legacy_hook/composer.json index ea4d273a..d2d16fbf 100644 --- a/legacy_hook/composer.json +++ b/legacy_hook/composer.json @@ -27,7 +27,7 @@ "require-dev": { "roave/security-advisories": "dev-latest", "phpunit/phpunit": "^10.2", - "mikey179/vfsstream": "^1.6" + "mikey179/vfsstream": "^1.6.11" }, "scripts": { "t3g:test:php:unit": [ diff --git a/legacy_hook/composer.lock b/legacy_hook/composer.lock index 1eef36b9..65dbe321 100644 --- a/legacy_hook/composer.lock +++ b/legacy_hook/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fd633e7a4988a07c3fc4c50e25ead2bb", + "content-hash": "338d06cc83063cea96cc0e2d1ac8102c", "packages": [ { "name": "guzzlehttp/guzzle", @@ -537,7 +537,7 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", @@ -584,7 +584,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" }, "funding": [ { @@ -604,16 +604,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.21", + "version": "v5.4.27", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", + "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d", + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d", "shasum": "" }, "require": { @@ -647,7 +647,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.21" + "source": "https://github.com/symfony/finder/tree/v5.4.27" }, "funding": [ { @@ -663,20 +663,20 @@ "type": "tidelift" } ], - "time": "2023-02-16T09:33:00+00:00" + "time": "2023-07-31T08:02:31+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -685,7 +685,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -730,7 +730,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -746,22 +746,22 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" } ], "packages-dev": [ { "name": "mikey179/vfsstream", - "version": "v1.6.8", + "version": "v1.6.11", "source": { "type": "git", "url": "https://github.com/bovigo/vfsStream.git", - "reference": "231c73783ebb7dd9ec77916c10037eff5a2b6efe" + "reference": "17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/231c73783ebb7dd9ec77916c10037eff5a2b6efe", - "reference": "231c73783ebb7dd9ec77916c10037eff5a2b6efe", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f", + "reference": "17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f", "shasum": "" }, "require": { @@ -799,7 +799,7 @@ "source": "https://github.com/bovigo/vfsStream/tree/master", "wiki": "https://github.com/bovigo/vfsStream/wiki" }, - "time": "2019-10-30T15:31:00+00:00" + "time": "2022-02-23T02:02:42+00:00" }, { "name": "myclabs/deep-copy", @@ -2758,5 +2758,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" }