From df8b8d1840f4722c2ef8d6c0a78a94d73c3c516c Mon Sep 17 00:00:00 2001 From: Benjamin Kott Date: Fri, 22 Nov 2024 11:05:11 +0100 Subject: [PATCH] [TASK] Drop deploy targets and simplify deployment --- .github/workflows/continuous-integration.yml | 13 +------- .github/workflows/deployment.yml | 27 ++--------------- .github/workflows/manual-deployment.yml | 18 ------------ .mage.yml | 31 -------------------- 4 files changed, 3 insertions(+), 86 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index c32ccc59..c6da8690 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -2,10 +2,6 @@ name: Continuous Integration / Deployment (CI/CD) on: push: - branches: - - develop - - production - - stage pull_request: jobs: @@ -21,7 +17,6 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.2' - tools: composer:2 - name: Get Composer Cache Directory id: composer-cache @@ -57,7 +52,6 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.2' - tools: composer:2 - name: Get Composer Cache Directory id: composer-cache @@ -93,7 +87,6 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.2' - tools: composer:2 - name: Get Composer Cache Directory id: composer-cache @@ -129,7 +122,6 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.2' - tools: composer:2 - name: Get Composer Cache Directory id: composer-cache @@ -167,7 +159,6 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.2' - tools: composer:2 - name: Get Composer Cache Directory id: composer-cache @@ -205,7 +196,6 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.2' - tools: composer:2 - name: Get Composer Cache Directory id: composer-cache @@ -243,7 +233,6 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.2' - tools: composer:2 - name: Get Composer Cache Directory id: composer-cache @@ -286,7 +275,7 @@ jobs: - validation - php_coding_standards - php_stan - if: ${{ github.event_name == 'push' }} + if: (github.ref == 'refs/heads/production') && github.event_name == 'push' && (github.repository == 'TYPO3/get.typo3.org') uses: ./.github/workflows/deployment.yml secrets: SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index ac4f5ae4..c6e349bb 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -2,17 +2,6 @@ name: Deployment on: workflow_call: - inputs: - php_version: - description: 'PHP version to be used for the deployment.' - default: '8.2' - required: false - type: string - composer_version: - description: 'Composer version to be used for the deployment.' - default: '2' - required: false - type: string secrets: SSH_PRIVATE_KEY: required: true @@ -20,20 +9,8 @@ on: required: true jobs: - print_inputs: - name: Print Inputs - runs-on: ubuntu-latest - - steps: - - name: Print the inputs - run: | - echo PHP version: ${{ inputs.php_version }} - echo Composer version: ${{ inputs.composer_version }} - deploy: name: Deploy - needs: - - print_inputs runs-on: ubuntu-latest steps: @@ -54,8 +31,8 @@ jobs: - name: Set up PHP Version uses: shivammathur/setup-php@v2 with: - php-version: ${{ inputs.php_version }} - tools: composer:${{ inputs.composer_version }}, andres-montanez/magallanes + php-version: '8.2' + tools: andres-montanez/magallanes - name: Get Environment id: environment diff --git a/.github/workflows/manual-deployment.yml b/.github/workflows/manual-deployment.yml index f57401d7..c63048d2 100644 --- a/.github/workflows/manual-deployment.yml +++ b/.github/workflows/manual-deployment.yml @@ -2,29 +2,11 @@ name: Manual Deployment on: workflow_dispatch: - inputs: - php_version: - description: 'PHP version to be used for the deployment.' - default: '8.2' - required: true - type: choice - options: - - '8.2' - - 'latest' - - 'nightly' - composer_version: - description: 'Composer version to be used for the deployment.' - default: '2' - required: true - type: string jobs: deployment: name: Deployment uses: ./.github/workflows/deployment.yml - with: - php_version: ${{ github.event.inputs.php_version }} - composer_version: ${{ github.event.inputs.composer_version }} secrets: SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }} diff --git a/.mage.yml b/.mage.yml index 8c7ce9a3..87645f89 100644 --- a/.mage.yml +++ b/.mage.yml @@ -18,37 +18,6 @@ magephp: - ./phpunit.xml.dist - ./README.md environments: - develop: - user: get-stage - from: ./* ./.env - host_path: ./site/mage/ - releases: 3 - hosts: - - t3o04.typo3server.ch - pre-deploy: - - exec: { cmd: "echo \"APP_ENV=prod\" >> .env.local", desc: "Create .env.local" } - - composer/install: { flags: '--no-dev --no-progress --optimize-autoloader' } - on-deploy: - - exec: { cmd: 'mkdir -p var', desc: 'Create var folder' } - - exec: { cmd: 'mkdir -p var/satis', desc: 'Create var/satis folder' } - - exec: { cmd: 'test -d ~/site/shared/public/satis || mkdir -p ~/site/shared/public/satis', desc: 'Create shared/public/satis folder' } - - fs/link: { from: "../../../shared/.env.local", to: ".env.local" } - - fs/link: { from: "../../../../shared/public/satis", to: "public/satis" } - - fs/link: { from: "satis/p", to: "public/p" } - - fs/link: { from: "satis/p2", to: "public/p2" } - - fs/link: { from: "satis/aliases.json", to: "public/aliases.json" } - - fs/link: { from: "satis/packages.json", to: "public/packages.json" } - - exec: { cmd: "sqlite3 ~/site/mage/current/var/gettr.db '.backup var/gettr.db'", desc: "Copy DB" } - - exec: { cmd: "php-restart", desc: "Restart PHP and reset OPcache" } - - exec: { cmd: "php ./bin/console doctrine:migrations:sync-metadata-storage --no-interaction", desc: "Synchronize DB Migrations" } - - exec: { cmd: "php ./bin/console doctrine:migrations:migrate --no-interaction", desc: "Apply DB Migrations" } - - exec: { cmd: "php ./bin/console cache:clear --env=prod", desc: "Clear Cache", timeout: 600 } - - exec: { cmd: "php ./bin/console cache:warmup --env=prod", desc: "Cache Warmup", timeout: 600 } - - exec: { cmd: "crontab cnf/crontab-dev.cron", desc: "Install crontab" } - on-release: - - exec: { cmd: "php-restart", desc: "Restart PHP and reset OPcache again" } - post-release: - post-deploy: production: user: get-prod from: ./* ./.env