From 7d1b9fdd257d515e81e03f3db3b5f71124c27e39 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 10:52:44 -0500 Subject: [PATCH 001/159] ISSUE-204: fix ddev applying composer configuration for tests --- .github/workflows/TestAcquia.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 27b08f4bb..4930c19e4 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -30,15 +30,15 @@ jobs: run: | ddev config --auto ddev start - ddev composer config extra.drupal-scaffold.gitignore true - ddev composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev composer config --no-plugins allow-plugins.composer/installers true - ddev composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev composer config extra.drainpipe.acquia --json '{"settings": true, "github": []}' - ddev composer config minimum-stability dev - ddev composer require lullabot/drainpipe --with-all-dependencies + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config extra.drainpipe.acquia --json '{"settings": true, "github": []}' + ddev exec --raw composer config minimum-stability dev + ddev exec --raw composer require lullabot/drainpipe --with-all-dependencies - name: Install Drupal run: | From 5afd7e91be15af67eaa0b9cf4b15f8372b270c5e Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 11:10:17 -0500 Subject: [PATCH 002/159] ISSUE-204: moving action to clone acquia env to the scaffold --- .../github/actions}/acquia/clone-env/action.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {.github/actions/drainpipe => scaffold/github/actions}/acquia/clone-env/action.yml (100%) diff --git a/.github/actions/drainpipe/acquia/clone-env/action.yml b/scaffold/github/actions/acquia/clone-env/action.yml similarity index 100% rename from .github/actions/drainpipe/acquia/clone-env/action.yml rename to scaffold/github/actions/acquia/clone-env/action.yml From 210c3d8fa453a934444f2e723577c05f2502f9a2 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 11:21:21 -0500 Subject: [PATCH 003/159] ISSUE-204: typo [skip ci] --- .github/actions/drainpipe/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/drainpipe/acquia/deploy/action.yml b/.github/actions/drainpipe/acquia/deploy/action.yml index 1392fbf6c..0a98b91b9 100644 --- a/.github/actions/drainpipe/acquia/deploy/action.yml +++ b/.github/actions/drainpipe/acquia/deploy/action.yml @@ -31,7 +31,7 @@ runs: github-token: ${{ inputs.github-token }} environment: ${{ inputs.environment }} - - name: Put side in Maintenance Mode + - name: Put site in Maintenance Mode run: | source .github/actions/drainpipe/common/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" From dab6840cdd626aaaede4bdffe00d588d7502299a Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 11:27:18 -0500 Subject: [PATCH 004/159] ISSUE-204: typo [skip ci] --- scaffold/github/actions/acquia/clone-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/clone-env/action.yml b/scaffold/github/actions/acquia/clone-env/action.yml index 2c0072f89..c905952fc 100644 --- a/scaffold/github/actions/acquia/clone-env/action.yml +++ b/scaffold/github/actions/acquia/clone-env/action.yml @@ -18,7 +18,7 @@ runs: steps: - name: Clone Environment run: | - source .github/actions/drainpipe/common/set-env/bash_aliases + source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" drainpipe_exec "acli env:mirror --no-config --no-interaction ${{ inputs.source-environment }} ${{ inputs.target-environment }}" shell: bash From 40759e70e22c0ffbc982ec74516506da7d554492 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 11:32:37 -0500 Subject: [PATCH 005/159] To trigger CI workflows From 523ad93977e7395f9d7bd60a3c06547c76e4792b Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 12:08:29 -0500 Subject: [PATCH 006/159] ISSUE-204: debug --- .../github/actions/acquia/clone-env/action.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scaffold/github/actions/acquia/clone-env/action.yml b/scaffold/github/actions/acquia/clone-env/action.yml index c905952fc..94485b198 100644 --- a/scaffold/github/actions/acquia/clone-env/action.yml +++ b/scaffold/github/actions/acquia/clone-env/action.yml @@ -18,6 +18,20 @@ runs: steps: - name: Clone Environment run: | + + echo "=========== 1" + ls -a .github/ + + echo "=========== 2" + ls -a .github/actions/ + + echo "=========== 3" + ls -a .github/actions/drainpipe/ + + echo "=========== 4" + ls -a .github/actions/drainpipe/set-env/ + + source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" drainpipe_exec "acli env:mirror --no-config --no-interaction ${{ inputs.source-environment }} ${{ inputs.target-environment }}" From 74a006da352304a89a28b85d8efc465f219ecd68 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 12:27:17 -0500 Subject: [PATCH 007/159] ISSUE-204: more debugging --- scaffold/github/actions/acquia/clone-env/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scaffold/github/actions/acquia/clone-env/action.yml b/scaffold/github/actions/acquia/clone-env/action.yml index 94485b198..2db37e6e6 100644 --- a/scaffold/github/actions/acquia/clone-env/action.yml +++ b/scaffold/github/actions/acquia/clone-env/action.yml @@ -19,6 +19,13 @@ runs: - name: Clone Environment run: | + + echo "=========== -2" + pwd + + echo "=========== -1" + ls -a + echo "=========== 1" ls -a .github/ From 61a9d1f2927e9779943f4bdea9b6ee495aa4ad8a Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 12:33:36 -0500 Subject: [PATCH 008/159] ISSUE-204: fix typo --- .github/workflows/TestAcquia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 4930c19e4..745f18a8c 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -38,7 +38,7 @@ jobs: ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' ddev exec --raw composer config extra.drainpipe.acquia --json '{"settings": true, "github": []}' ddev exec --raw composer config minimum-stability dev - ddev exec --raw composer require lullabot/drainpipe --with-all-dependencies + ddev exec require lullabot/drainpipe --with-all-dependencies - name: Install Drupal run: | From 6e316d568678a717c8137609b600d061039ec663 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 12:49:31 -0500 Subject: [PATCH 009/159] ISSUE-204: typo --- .github/workflows/TestAcquia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 745f18a8c..deab4364c 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -38,7 +38,7 @@ jobs: ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' ddev exec --raw composer config extra.drainpipe.acquia --json '{"settings": true, "github": []}' ddev exec --raw composer config minimum-stability dev - ddev exec require lullabot/drainpipe --with-all-dependencies + ddev composer require lullabot/drainpipe --with-all-dependencies - name: Install Drupal run: | From 3d05d6f000948eeca4c00513220deb1e08ded776 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 13:28:46 -0500 Subject: [PATCH 010/159] ISSUE-204: fix defining composer settings for acquia actions --- .github/workflows/TestAcquia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index deab4364c..38b8d5b43 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -36,7 +36,7 @@ jobs: ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config extra.drainpipe.acquia --json '{"settings": true, "github": []}' + ddev exec --raw composer config extra.drainpipe.github --json '{"acquia": []}' ddev exec --raw composer config minimum-stability dev ddev composer require lullabot/drainpipe --with-all-dependencies From 4f9d9ec42deabb24dc90f7d2ab9430c02cde678d Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 13:32:28 -0500 Subject: [PATCH 011/159] ISSUE-204: remove debug [skip ci] --- .../actions/acquia/clone-env/action.yml | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/scaffold/github/actions/acquia/clone-env/action.yml b/scaffold/github/actions/acquia/clone-env/action.yml index 2db37e6e6..c905952fc 100644 --- a/scaffold/github/actions/acquia/clone-env/action.yml +++ b/scaffold/github/actions/acquia/clone-env/action.yml @@ -18,27 +18,6 @@ runs: steps: - name: Clone Environment run: | - - - echo "=========== -2" - pwd - - echo "=========== -1" - ls -a - - echo "=========== 1" - ls -a .github/ - - echo "=========== 2" - ls -a .github/actions/ - - echo "=========== 3" - ls -a .github/actions/drainpipe/ - - echo "=========== 4" - ls -a .github/actions/drainpipe/set-env/ - - source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" drainpipe_exec "acli env:mirror --no-config --no-interaction ${{ inputs.source-environment }} ${{ inputs.target-environment }}" From c8d5c90c865cd7cb247ff1b74f3f059a8b73d006 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 14:10:53 -0500 Subject: [PATCH 012/159] ISSUE-204: adding acquia tasks --- .github/workflows/TestAcquia.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 38b8d5b43..e2415ef86 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -28,6 +28,7 @@ jobs: - name: Setup Project run: | + yq -iy '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml ddev config --auto ddev start ddev exec --raw composer config extra.drupal-scaffold.gitignore true From 59e1caa2737af21b36ea53e0a214418fcfd48f40 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 14:18:36 -0500 Subject: [PATCH 013/159] ISSUE-204: different syntax for yq, not -y flag needed --- .github/workflows/TestAcquia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index e2415ef86..f5b11b10a 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -28,7 +28,7 @@ jobs: - name: Setup Project run: | - yq -iy '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml + yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml ddev config --auto ddev start ddev exec --raw composer config extra.drupal-scaffold.gitignore true From 46503cf307bbac742b4a84fa87eec5c861f04224 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 14:25:13 -0500 Subject: [PATCH 014/159] ISSUE-204: using Taskfile after drainpipe installation with composer --- .github/workflows/TestAcquia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index f5b11b10a..d940cfed5 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -28,7 +28,6 @@ jobs: - name: Setup Project run: | - yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml ddev config --auto ddev start ddev exec --raw composer config extra.drupal-scaffold.gitignore true @@ -40,6 +39,7 @@ jobs: ddev exec --raw composer config extra.drainpipe.github --json '{"acquia": []}' ddev exec --raw composer config minimum-stability dev ddev composer require lullabot/drainpipe --with-all-dependencies + yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml - name: Install Drupal run: | From 6651bf9701ef6b9d437ea3bb30bdc7e2302e0137 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 14:29:47 -0500 Subject: [PATCH 015/159] ISSUE-204: fix path --- .../github/actions}/acquia/deploy/action.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {.github/actions/drainpipe => scaffold/github/actions}/acquia/deploy/action.yml (100%) diff --git a/.github/actions/drainpipe/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml similarity index 100% rename from .github/actions/drainpipe/acquia/deploy/action.yml rename to scaffold/github/actions/acquia/deploy/action.yml From 26fc77dfeca2765aa64b7b0d6fc27783bf7341fd Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 15:51:34 -0500 Subject: [PATCH 016/159] ISSUE-204: fix path --- .github/actions/drainpipe/common/deployment-create/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/drainpipe/common/deployment-create/action.yml b/.github/actions/drainpipe/common/deployment-create/action.yml index 61d857697..0ae1465aa 100644 --- a/.github/actions/drainpipe/common/deployment-create/action.yml +++ b/.github/actions/drainpipe/common/deployment-create/action.yml @@ -10,7 +10,7 @@ inputs: runs: using: "composite" steps: - - uses: ./.github/actions/drainpipe/set-env + - uses: ./.github/actions/drainpipe/common/set-env - name: Create GitHub Deployment run: | From 49d8f597c34c9538dd74525dca151c28660a27e8 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 16:03:40 -0500 Subject: [PATCH 017/159] ISSUE-204: debugging --- .github/workflows/TestAcquia.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index d940cfed5..4ef041fe5 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -82,10 +82,10 @@ jobs: - name: Deploy to dev uses: ./drainpipe/scaffold/github/actions/acquia/deploy with: - github-token: ${{ secrets.GITHUB_TOKEN }} - environment: lullabotsandbox.dev - environment-url: https://lullabotsandboxffi2ugpgwh.devcloud.acquia-sites.com + github-token: "test1" + environment: "test6" + environment-url: "tests5" run-installer: true - commit-message: ${{ github.sha }} - api-key: ${{ secrets.ACQUIA_API_KEY }} - api-secret: ${{ secrets.ACQUIA_API_SECRET }} + commit-message: "test2" + api-key: "test3" + api-secret: "test4" From ca58ff828eeff716472d9092715ea0b433039bf6 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 16:11:05 -0500 Subject: [PATCH 018/159] ISSUE-204: debugging --- .github/workflows/TestAcquia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 4ef041fe5..3e3bf33d2 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -80,7 +80,7 @@ jobs: api-secret: ${{ secrets.ACQUIA_API_SECRET }} - name: Deploy to dev - uses: ./drainpipe/scaffold/github/actions/acquia/deploy + uses: ./drainpipe/scaffold/github/actions/acquia/debug with: github-token: "test1" environment: "test6" From 724f44d4d80e75ec0162b54fcf342d1f872da458 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 16:26:38 -0500 Subject: [PATCH 019/159] ISSUE-204: more debugging --- .github/workflows/TestAcquia.yml | 2 +- .../github/actions/acquia/deploy/action.yml | 34 ------------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 3e3bf33d2..4ef041fe5 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -80,7 +80,7 @@ jobs: api-secret: ${{ secrets.ACQUIA_API_SECRET }} - name: Deploy to dev - uses: ./drainpipe/scaffold/github/actions/acquia/debug + uses: ./drainpipe/scaffold/github/actions/acquia/deploy with: github-token: "test1" environment: "test6" diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 0a98b91b9..365181522 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -31,37 +31,3 @@ runs: github-token: ${{ inputs.github-token }} environment: ${{ inputs.environment }} - - name: Put site in Maintenance Mode - run: | - source .github/actions/drainpipe/common/set-env/bash_aliases - drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" - ENVIRONMENT="${{ inputs.environment }}" - APPLICATION=${ENVIRONMENT%.*} - drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabot8.dev" - shell: bash - - - name: Push to Acquia - uses: .github/actions/drainpipe/acquia/push - with: - environment: ${{ inputs.environment }} - commit-message: ${{ inputs.commit-message }} - api-key: ${{ inputs.api-key }} - api-secret: ${{ inputs.api-secret }} - - - name: Run updates - uses: .github/actions/drainpipe/acquia/update - with: - environment: ${{ inputs.environment }} - run-installer: ${{ inputs.run-installer }} - - - name: Set Deployment Status - uses: .github/actions/drainpipe/common/deployment-status - with: - github-token: ${{ inputs.github-token }} - environment-url: ${{ inputs.environment-url }} - - - name: Take site out of Maintenance Mode - run: | - drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" - shell: bash From 276c2153401af55976d1b9c18d5d223ed7a7c837 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 16:49:28 -0500 Subject: [PATCH 020/159] ISSUE-204: more debugging --- .../drainpipe/common/deployment-create/action.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/actions/drainpipe/common/deployment-create/action.yml b/.github/actions/drainpipe/common/deployment-create/action.yml index 0ae1465aa..a34b187e1 100644 --- a/.github/actions/drainpipe/common/deployment-create/action.yml +++ b/.github/actions/drainpipe/common/deployment-create/action.yml @@ -14,15 +14,5 @@ runs: - name: Create GitHub Deployment run: | - export GITHUB_DEPLOYMENT=$(curl -f -X POST \ - https://api.github.com/repos/$GITHUB_REPOSITORY/deployments \ - -H 'Accept: application/vnd.github.v3+json' \ - -H "Authorization: token ${{ inputs.github-token }}" \ - -d "{\"ref\": \"$DRAINPIPE_SHA\", \"auto_merge\": false, \"environment\": \"${{ inputs.environment }}\", \"transient_environment\": false, \"required_contexts\": [], \"description\": \"Acquia Cloud environment\"}" \ - ) - export GITHUB_DEPLOYMENT_ID=$(echo $GITHUB_DEPLOYMENT | jq '.id') - echo "GITHUB_DEPLOYMENT_ID=$GITHUB_DEPLOYMENT_ID" >> $GITHUB_ENV - echo "Created GitHub Deployment ID $GITHUB_DEPLOYMENT_ID" - if [ -z "$GITHUB_DEPLOYMENT_ID" ] || [ "$GITHUB_DEPLOYMENT_ID" = "null" ]; then echo $GITHUB_DEPLOYMENT && exit 1; fi - curl -f -H "Authorization: token ${{ inputs.github-token }}" -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/$GITHUB_REPOSITORY/deployments/$GITHUB_DEPLOYMENT_ID/statuses -d '{"state":"in_progress"}' + echo "More debugging" shell: bash From 00fd90c52fce0c33e9f343c283b7eb7a6b6f292a Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 25 Nov 2024 17:11:51 -0500 Subject: [PATCH 021/159] ISSUE-204: more debugging --- .github/actions/drainpipe/common/deployment-create/action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/actions/drainpipe/common/deployment-create/action.yml b/.github/actions/drainpipe/common/deployment-create/action.yml index a34b187e1..001337543 100644 --- a/.github/actions/drainpipe/common/deployment-create/action.yml +++ b/.github/actions/drainpipe/common/deployment-create/action.yml @@ -10,8 +10,6 @@ inputs: runs: using: "composite" steps: - - uses: ./.github/actions/drainpipe/common/set-env - - name: Create GitHub Deployment run: | echo "More debugging" From deca1faf3133f4c04466dfb4bb65bf30e4d2ceed Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 08:13:02 -0500 Subject: [PATCH 022/159] ISSUE-204: more debugging --- scaffold/github/actions/acquia/deploy/action.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 365181522..de82f2197 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -25,6 +25,17 @@ inputs: runs: using: "composite" steps: + - name: debug + run: | + echo "===============" + ls -al + + echo "===============" + + ls -al .github/actions/drainpipe/common/deployment-create + + shell: bash + - name: Create GitHub Deployment uses: .github/actions/drainpipe/common/deployment-create with: From 66714909eee4b5cb5e31490593963562ed93e74c Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 08:18:32 -0500 Subject: [PATCH 023/159] ISSUE-204: more debugging --- scaffold/github/actions/acquia/deploy/action.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index de82f2197..07850f5c6 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -36,9 +36,4 @@ runs: shell: bash - - name: Create GitHub Deployment - uses: .github/actions/drainpipe/common/deployment-create - with: - github-token: ${{ inputs.github-token }} - environment: ${{ inputs.environment }} From 11d16c4c14b792a5d5dedb0b707a426f856a8b50 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 08:23:37 -0500 Subject: [PATCH 024/159] ISSUE-204: more debugging --- scaffold/github/actions/acquia/deploy/action.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 07850f5c6..9cb3d60cf 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -32,6 +32,22 @@ runs: echo "===============" + ls -al .github/ + + echo "===============" + + ls -al .github/actions/ + + echo "===============" + + ls -al .github/actions/drainpipe/ + + echo "===============" + + ls -al .github/actions/drainpipe/common/ + + echo "===============" + ls -al .github/actions/drainpipe/common/deployment-create shell: bash From cd4287b7a19931d85e65087d977d377c0e23c671 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 08:42:01 -0500 Subject: [PATCH 025/159] ISSUE-204: move to scaffold --- .../common/deployment-create/action.yml | 16 ----------- .../common/deployment-create/action.yml | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+), 16 deletions(-) delete mode 100644 .github/actions/drainpipe/common/deployment-create/action.yml create mode 100644 scaffold/github/actions/common/deployment-create/action.yml diff --git a/.github/actions/drainpipe/common/deployment-create/action.yml b/.github/actions/drainpipe/common/deployment-create/action.yml deleted file mode 100644 index 001337543..000000000 --- a/.github/actions/drainpipe/common/deployment-create/action.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: 'Create a GitHub deployment' -description: 'Creates a GitHub deployment and echos the ID to the $GITHUB_ENV file' -inputs: - github-token: - description: "GitHub token as generated automatically in secrets.GITHUB_TOKEN" - required: true - environment: - description: "The environment name" - required: true -runs: - using: "composite" - steps: - - name: Create GitHub Deployment - run: | - echo "More debugging" - shell: bash diff --git a/scaffold/github/actions/common/deployment-create/action.yml b/scaffold/github/actions/common/deployment-create/action.yml new file mode 100644 index 000000000..0ae1465aa --- /dev/null +++ b/scaffold/github/actions/common/deployment-create/action.yml @@ -0,0 +1,28 @@ +name: 'Create a GitHub deployment' +description: 'Creates a GitHub deployment and echos the ID to the $GITHUB_ENV file' +inputs: + github-token: + description: "GitHub token as generated automatically in secrets.GITHUB_TOKEN" + required: true + environment: + description: "The environment name" + required: true +runs: + using: "composite" + steps: + - uses: ./.github/actions/drainpipe/common/set-env + + - name: Create GitHub Deployment + run: | + export GITHUB_DEPLOYMENT=$(curl -f -X POST \ + https://api.github.com/repos/$GITHUB_REPOSITORY/deployments \ + -H 'Accept: application/vnd.github.v3+json' \ + -H "Authorization: token ${{ inputs.github-token }}" \ + -d "{\"ref\": \"$DRAINPIPE_SHA\", \"auto_merge\": false, \"environment\": \"${{ inputs.environment }}\", \"transient_environment\": false, \"required_contexts\": [], \"description\": \"Acquia Cloud environment\"}" \ + ) + export GITHUB_DEPLOYMENT_ID=$(echo $GITHUB_DEPLOYMENT | jq '.id') + echo "GITHUB_DEPLOYMENT_ID=$GITHUB_DEPLOYMENT_ID" >> $GITHUB_ENV + echo "Created GitHub Deployment ID $GITHUB_DEPLOYMENT_ID" + if [ -z "$GITHUB_DEPLOYMENT_ID" ] || [ "$GITHUB_DEPLOYMENT_ID" = "null" ]; then echo $GITHUB_DEPLOYMENT && exit 1; fi + curl -f -H "Authorization: token ${{ inputs.github-token }}" -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/$GITHUB_REPOSITORY/deployments/$GITHUB_DEPLOYMENT_ID/statuses -d '{"state":"in_progress"}' + shell: bash From 73c85a0b7c08c30fded0870eafe0c603af53ff8d Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 08:44:07 -0500 Subject: [PATCH 026/159] ISSUE-204: move to scaffold --- .../github/actions}/common/deployment-status/action.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {.github/actions/drainpipe => scaffold/github/actions}/common/deployment-status/action.yml (100%) diff --git a/.github/actions/drainpipe/common/deployment-status/action.yml b/scaffold/github/actions/common/deployment-status/action.yml similarity index 100% rename from .github/actions/drainpipe/common/deployment-status/action.yml rename to scaffold/github/actions/common/deployment-status/action.yml From b044007588c07fbcd12cffca53339d0178d00e0c Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 08:44:25 -0500 Subject: [PATCH 027/159] ISSUE-204: restore action --- .../github/actions/acquia/deploy/action.yml | 56 +++++++++++-------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 9cb3d60cf..0a98b91b9 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -25,31 +25,43 @@ inputs: runs: using: "composite" steps: - - name: debug - run: | - echo "===============" - ls -al - - echo "===============" - - ls -al .github/ - - echo "===============" - - ls -al .github/actions/ - - echo "===============" + - name: Create GitHub Deployment + uses: .github/actions/drainpipe/common/deployment-create + with: + github-token: ${{ inputs.github-token }} + environment: ${{ inputs.environment }} - ls -al .github/actions/drainpipe/ - - echo "===============" + - name: Put site in Maintenance Mode + run: | + source .github/actions/drainpipe/common/set-env/bash_aliases + drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" + ENVIRONMENT="${{ inputs.environment }}" + APPLICATION=${ENVIRONMENT%.*} + drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabot8.dev" + shell: bash - ls -al .github/actions/drainpipe/common/ + - name: Push to Acquia + uses: .github/actions/drainpipe/acquia/push + with: + environment: ${{ inputs.environment }} + commit-message: ${{ inputs.commit-message }} + api-key: ${{ inputs.api-key }} + api-secret: ${{ inputs.api-secret }} - echo "===============" + - name: Run updates + uses: .github/actions/drainpipe/acquia/update + with: + environment: ${{ inputs.environment }} + run-installer: ${{ inputs.run-installer }} - ls -al .github/actions/drainpipe/common/deployment-create + - name: Set Deployment Status + uses: .github/actions/drainpipe/common/deployment-status + with: + github-token: ${{ inputs.github-token }} + environment-url: ${{ inputs.environment-url }} + - name: Take site out of Maintenance Mode + run: | + drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" shell: bash - - From 79b5676708011f91ae3de86c015bbecb1d165d84 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 09:15:06 -0500 Subject: [PATCH 028/159] ISSUE-204: fix paths --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 0a98b91b9..0eb82fec8 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -26,14 +26,14 @@ runs: using: "composite" steps: - name: Create GitHub Deployment - uses: .github/actions/drainpipe/common/deployment-create + uses: .github/actions/common/deployment-create with: github-token: ${{ inputs.github-token }} environment: ${{ inputs.environment }} - name: Put site in Maintenance Mode run: | - source .github/actions/drainpipe/common/set-env/bash_aliases + source .github/actions/common/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENVIRONMENT="${{ inputs.environment }}" APPLICATION=${ENVIRONMENT%.*} From 90105130861be3798614eb762675a724c9cae1aa Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 09:24:46 -0500 Subject: [PATCH 029/159] ISSUE-204: to avoid spending github minutes running other workflows [skip ci] --- .github/workflows/DrainpipeDev.yml | 79 ---- .github/workflows/DrainpipeDevClean.yml | 42 -- .github/workflows/TestBinaryInstaller.yml | 93 ----- .github/workflows/TestComposerLockDiff.yml | 86 ----- .github/workflows/TestDDEV.yml | 66 ---- .github/workflows/TestEnv.yml | 77 ---- .github/workflows/TestFunctional.yml | 408 -------------------- .github/workflows/TestGitHubActions.yml | 110 ------ .github/workflows/TestMetapackages.yml | 360 ----------------- .github/workflows/TestPHPUnit.yml | 225 ----------- .github/workflows/TestStatic.yml | 105 ----- .github/workflows/TestTugboat.yml | 140 ------- .github/workflows/ValidateTaskfile.yml | 23 -- .github/workflows/composer-plugin.yml | 40 -- .github/workflows/test-production-build.yml | 63 --- 15 files changed, 1917 deletions(-) delete mode 100644 .github/workflows/DrainpipeDev.yml delete mode 100644 .github/workflows/DrainpipeDevClean.yml delete mode 100644 .github/workflows/TestBinaryInstaller.yml delete mode 100644 .github/workflows/TestComposerLockDiff.yml delete mode 100644 .github/workflows/TestDDEV.yml delete mode 100644 .github/workflows/TestEnv.yml delete mode 100644 .github/workflows/TestFunctional.yml delete mode 100644 .github/workflows/TestGitHubActions.yml delete mode 100644 .github/workflows/TestMetapackages.yml delete mode 100644 .github/workflows/TestPHPUnit.yml delete mode 100644 .github/workflows/TestStatic.yml delete mode 100644 .github/workflows/TestTugboat.yml delete mode 100644 .github/workflows/ValidateTaskfile.yml delete mode 100644 .github/workflows/composer-plugin.yml delete mode 100644 .github/workflows/test-production-build.yml diff --git a/.github/workflows/DrainpipeDev.yml b/.github/workflows/DrainpipeDev.yml deleted file mode 100644 index 89941b8a9..000000000 --- a/.github/workflows/DrainpipeDev.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: Push Drainpipe Dev Package - -on: - push: - branches: - - '**' - tags: - - 'v*' - -concurrency: - group: drainpipe-dev - cancel-in-progress: false - -permissions: - contents: read - -jobs: - Drainpipe-Dev: - name: Push to drainpipe-dev - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - - uses: ./scaffold/github/actions/common/setup-git - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup SSH - uses: webfactory/ssh-agent@v0.9.0 - with: - ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }} - log-public-key: false - - - name: Create git checkout of drainpipe-dev - working-directory: drainpipe-dev - run: | - git init - git branch -m ${{ github.ref_name }} - git remote add origin git@github.com:Lullabot/drainpipe-dev.git - git fetch origin - - - name: Commit changes (Tag) - if: ${{ startsWith(github.ref, 'refs/tags/') }} - working-directory: drainpipe-dev - run: | - git reset --mixed origin/main - git add -A - git commit -m "${{ github.ref_name }}" --allow-empty - - - name: Commit changes (Branch) - if: ${{ ! startsWith(github.ref, 'refs/tags/') }} - working-directory: drainpipe-dev - run: | - git reset --mixed origin/${{ github.ref_name }} || git reset --mixed origin/main - git add -A - git commit -m "${{ github.event.head_commit.message }}" --allow-empty - - - name: Tag release - if: ${{ startsWith(github.ref, 'refs/tags/') }} - working-directory: drainpipe-dev - run: | - git tag ${{ github.ref_name }} - - - name: Push to drainpipe-dev - working-directory: drainpipe-dev - run: | - git push origin ${{ github.ref_name }} - - - name: Create release - if: ${{ startsWith(github.ref, 'refs/tags/') }} - run: | - curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.DRAINPIPE_DEV_RELEASE_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/lullabot/drainpipe-dev/releases \ - -d '{"tag_name":"${{ github.ref_name }}","name":"${{ github.ref_name }}","body":"See https://github.com/Lullabot/drainpipe/releases/tag/${{ github.ref_name }}","draft":false,"prerelease":false,"generate_release_notes":false}' diff --git a/.github/workflows/DrainpipeDevClean.yml b/.github/workflows/DrainpipeDevClean.yml deleted file mode 100644 index 6cc5d1d9f..000000000 --- a/.github/workflows/DrainpipeDevClean.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Clean Drainpipe Dev Package - -on: delete - -concurrency: - group: drainpipe-dev - cancel-in-progress: false - -permissions: - contents: read - -jobs: - Drainpipe-Dev-Clean: - name: Push branch to drainpipe-dev - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - - uses: ./scaffold/github/actions/common/setup-git - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup SSH - uses: webfactory/ssh-agent@v0.9.0 - with: - ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }} - log-public-key: false - - - name: Create git checkout of drainpipe-dev - working-directory: drainpipe-dev - run: | - git init - git branch -m ${{ github.event.ref }} - git remote add origin git@github.com:Lullabot/drainpipe-dev.git - git fetch origin - git reset --mixed origin/${{ github.event.ref }} - - - name: Delete ref from drainpipe-dev - working-directory: drainpipe-dev - run: | - git push origin --delete ${{ github.event.ref }} diff --git a/.github/workflows/TestBinaryInstaller.yml b/.github/workflows/TestBinaryInstaller.yml deleted file mode 100644 index e90d6fb0b..000000000 --- a/.github/workflows/TestBinaryInstaller.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: Test Binary Installer -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Binary-Installer: - runs-on: ubuntu-24.04 - strategy: - matrix: - php-version: [ 8.1, 8.2, 8.3 ] - include: - - php-version: 8.1 - drupal-version: ":^10" - - php-version: 8.2 - drupal-version: ":^10" - steps: - - - name: Create a Drupal project - run: composer create-project drupal/recommended-project${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - composer-cache-dir: composer-cache - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev config --php-version ${{ matrix.php-version }} - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - - - name: Simulate failure - run: | - ddev exec touch /var/www/html/composer-cache/files/lullabot/drainpipe/bin/task/3.38.0/task_linux_amd64.tar - ddev composer install - - - name: Test installing without composer cache - run: | - ddev composer install --no-cache - test -x vendor/bin/task - ddev composer install - test -x vendor/bin/task - rm -rf vendor - ddev composer install - test -x vendor/bin/task - rm -rf vendor - ddev composer install --no-cache - test -x vendor/bin/task - - - name: Prove we can upgrade task within task - run: | - cp -a drainpipe/tests/fixtures/drainpipe-task-upgrade . - cp -a drainpipe drainpipe-task-upgrade - cd drainpipe-task-upgrade - ddev start - ddev composer install - ddev task drupal:composer:development - cp composer-upgraded.json composer.json - cp composer-upgraded.lock composer.lock - # Composer won't run updated plugin code until after its been - # installed. Once we have two new releases after 3.11.0, that upgrade - # task, we can remove this double call. - ddev task drupal:composer:development || ddev task drupal:composer:development diff --git a/.github/workflows/TestComposerLockDiff.yml b/.github/workflows/TestComposerLockDiff.yml deleted file mode 100644 index 00fe14cc1..000000000 --- a/.github/workflows/TestComposerLockDiff.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: "Test Composer Lock Diff" - -on: - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Composer-Lock-Diff: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require lullabot/drainpipe --with-all-dependencies - - - name: Commit current state - run: | - echo "/drainpipe" >> .gitignore - git config --global user.email "no-reply@example.com" - git config --global user.name "Drainpipe Bot" - git init - git add . - git commit -m "Initial commit" - - - name: Install Composer Lock Diff - run : ddev composer global require davidrjonas/composer-lock-diff:^1.0 - - - name: Add a new package - run: ddev composer require sebastian/version:4.0.1 - - - name: Run Composer Lock Diff on a Renovate PR - run: | - ddev task "github:composer-lock-diff pull_request='drainpipe/tests/fixtures/composer-lock-diff/github/renovate.json' json_file='renovate-processed.json'" - if [ "$(cat renovate-processed.json)" != "$(cat drainpipe/tests/fixtures/composer-lock-diff/github/renovate-after.json)" ]; then - echo "Expected description not produced" - exit 1 - fi - - - name: Run Composer Lock Diff on a PR Template - run: | - ddev task "github:composer-lock-diff pull_request='drainpipe/tests/fixtures/composer-lock-diff/github/pr-template.json' json_file='pr-template-processed.json'" - if [ "$(cat pr-template-processed.json)" != "$(cat drainpipe/tests/fixtures/composer-lock-diff/github/pr-template-after.json)" ]; then - echo "Expected description not produced" - exit 1 - fi - - - name: Upload artifact - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: processed-descriptions-${{ matrix.drupal-version }} - path: | - renovate-processed.json - pr-template-processed.json diff --git a/.github/workflows/TestDDEV.yml b/.github/workflows/TestDDEV.yml deleted file mode 100644 index feb301d26..000000000 --- a/.github/workflows/TestDDEV.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Test DDEV Integration -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-DDEV-Install: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - - - name: Reset Project - run: | - ddev stop --remove-data --omit-snapshot - rm -rf web/core vendor/ web/sites/default/settings.ddev.php - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Test DDEV Settings Generated - run: test -f web/sites/default/settings.ddev.php diff --git a/.github/workflows/TestEnv.yml b/.github/workflows/TestEnv.yml deleted file mode 100644 index 6650780c6..000000000 --- a/.github/workflows/TestEnv.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: "Test Environment Variables" - -on: - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Env: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Create a Drupal project - run: | - composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config repositories.drainpipe --json "{\"type\": \"path\", \"url\": \"drainpipe\", \"options\": {\"symlink\": false}}" - ddev exec --raw composer config minimum-stability dev - cat composer.json | jq --indent 4 '."autoload-dev" = {"files": ["vendor/lullabot/drainpipe/scaffold/env/dotenv.php"]}' | tee composer.json > /dev/null - ddev composer update --lock - ddev composer validate - ddev composer require lullabot/drainpipe --with-all-dependencies - cp drainpipe/tests/fixtures/env/Taskfile.yml Taskfile.yml - - - name: Check files are created - run: | - test -f .env - test -f .env.defaults - - - name: Check gitignore contains .env - run: grep -q '.env' .gitignore - - - name: Test .env.defaults - run: | - echo "FOO=bar" >> .env.defaults - ddev task bar - # Not sure why Drupal needs restarting for this to work - ddev restart - DRUPAL_FOO_DEFAULT=$(ddev drush php:eval "print getenv('FOO')") - echo "FOO=$DRUPAL_FOO_DEFAULT" - if [ "$DRUPAL_FOO_DEFAULT" != "bar" ]; then exit 1; fi - - - name: Test overriding with .env - run: | - echo "FOO=baz" >> .env - ddev task baz - # Not sure why Drupal needs restarting for this to work - ddev restart - DRUPAL_FOO=$(ddev drush php:eval "print getenv('FOO')") - echo "FOO=$DRUPAL_FOO" - if [ "$DRUPAL_FOO" != "baz" ]; then exit 1; fi diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml deleted file mode 100644 index d9fed9e26..000000000 --- a/.github/workflows/TestFunctional.yml +++ /dev/null @@ -1,408 +0,0 @@ -name: Test Functional Tests -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Build: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev config --nodejs-version "22" - ddev config --corepack-enable - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - git config --global user.email "no-reply@example.com" - git config --global user.name "Drainpipe Bot" - git init - echo "/drainpipe" >> .gitignore - echo "/drainpipe-dev" >> .gitignore - echo ".ddev/config.yaml" >> .gitignore - echo ".ddev/docker-compose.selenium.yaml" >> .gitignore - echo ".yarnrc.yml" >> .gitignore - echo "package.json" >> .gitignore - echo "yarn.lock" >> .gitignore - echo "package-lock.json" >> .gitignore - echo "README.md" >> .gitignore - git add . - git commit -m "Initial commit" - - - name: Setup Nightwatch - run: | - echo "hooks:" >> .ddev/config.yaml - echo " post-start:" >> .ddev/config.yaml - echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS firefox; GRANT ALL ON firefox.* TO 'db'@'%';\"" >> .ddev/config.yaml - echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS chrome; GRANT ALL ON chrome.* TO 'db'@'%';\"" >> .ddev/config.yaml - ddev config --web-environment="NIGHTWATCH_DRUPAL_URL_FIREFOX=https://drupal_firefox,NIGHTWATCH_DRUPAL_URL_CHROME=https://drupal_chrome" - ddev config --additional-hostnames="*.drainpipe" - - - name: Run the site installer - run: | - ddev drush --yes site:install minimal - ddev drush config:export --yes - - - name: Create Artifact - run: zip -r /tmp/drainpipe.zip ./ - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - path: /tmp/drainpipe.zip - - Test-NPM: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev npm init -y - ddev npm install nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --save-dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-npm-${{ matrix.drupal-version }} - path: test_result - - Test-Yarn-Classic: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev exec corepack disable - ddev exec npm i -g yarn@1.22.1 - ddev exec 'ln -s $(npm root -g)/yarn/bin/yarn /usr/local/bin/yarn' - ddev yarn init -y - ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-yarn-classic-${{ matrix.drupal-version }} - path: test_result - - Test-Yarn-3-Node-Linker: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev yarn set version berry - ddev yarn set version 3 - ddev yarn init -y - ddev yarn config set nodeLinker node-modules - ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-yarn3-nl-${{ matrix.drupal-version }} - path: test_result - - Test-Yarn-4-Node-Linker: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev restart - ddev yarn set version berry - ddev yarn set version 4 - ddev yarn init -y - ddev yarn config set nodeLinker node-modules - ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-yarn4-nl-${{ matrix.drupal-version }} - path: test_result - - Test-Yarn-3: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev yarn set version berry - ddev yarn set version 3 - ddev yarn init -y - echo "packageExtensions:" >> .yarnrc.yml - echo ' "nightwatch@*":' >> .yarnrc.yml - echo ' dependencies:' >> .yarnrc.yml - echo ' ws: "*"' >> .yarnrc.yml - echo ' "@nightwatch/vrt@*":' >> .yarnrc.yml - echo ' dependencies:' >> .yarnrc.yml - echo ' open: "^8"' >> .yarnrc.yml - ddev yarn add nightwatch nightwatch-axe-verbose @nightwatch/vrt @lullabot/nightwatch-drupal-commands --dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-yarn3-${{ matrix.drupal-version }} - path: test_result - - Test-Yarn-4: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev restart - ddev yarn set version berry - ddev yarn init -y - echo "packageExtensions:" >> .yarnrc.yml - echo ' "nightwatch@*":' >> .yarnrc.yml - echo ' dependencies:' >> .yarnrc.yml - echo ' ws: "*"' >> .yarnrc.yml - echo ' "@nightwatch/vrt@*":' >> .yarnrc.yml - echo ' dependencies:' >> .yarnrc.yml - echo ' open: "^8"' >> .yarnrc.yml - ddev yarn cache clear - ddev yarn add nightwatch nightwatch-axe-verbose @nightwatch/vrt @nightwatch/vrt @lullabot/nightwatch-drupal-commands --dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-yarn4-${{ matrix.drupal-version }} - path: test_result diff --git a/.github/workflows/TestGitHubActions.yml b/.github/workflows/TestGitHubActions.yml deleted file mode 100644 index 2085ac6d0..000000000 --- a/.github/workflows/TestGitHubActions.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: "Test GitHub Actions" - -on: - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-GitHub-Actions: - runs-on: ubuntu-24.04 - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe/drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require lullabot/drainpipe --with-all-dependencies - ddev composer require --dev lullabot/drainpipe-dev --with-all-dependencies - - - name: Install Drupal - run: | - ddev drush site:install minimal -y - echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php - ddev drush config:export -y - - - name: Lint GitHub Actions and Workflows - run: ddev task "github:actions:lint directories='./drainpipe/scaffold/github/actions ./drainpipe/scaffold/github/workflows'" - - - name: Run Database Updates - run: ddev task update - - - name: Create pantheon.yml - run: | - echo "api_version: 1" >> pantheon.yml - echo "web_docroot: true" >> pantheon.yml - echo "php_version: 8.3" >> pantheon.yml - echo "database:" >> pantheon.yml - echo " version: 10.6" >> pantheon.yml - echo "enforce_https: full+subdomains" >> pantheon.yml - echo "build_step: false" >> pantheon.yml - - - name: Create .drainpipeignore - run: | - echo "/web/sites/default/files" >> .drainpipeignore - echo "/.ddev" >> .drainpipeignore - echo "settings.ddev.php" >> .drainpipeignore - echo "/drainpipe" >> .drainpipeignore - - - name: Create settings.php - run: | - echo ' web/sites/default/settings.php - echo "\$settings['container_yamls'][] = __DIR__ . '/services.yml';" >> web/sites/default/settings.php - echo "include __DIR__ . \"/settings.pantheon.php\";" >> web/sites/default/settings.php - echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php - curl -o web/sites/default/settings.pantheon.php https://raw.githubusercontent.com/pantheon-systems/drupal-integrations/11.x/assets/settings.pantheon.php - - - name: Snapshot Project - env: - directory: /tmp/release - remote: - message: - site: - run: | - echo "/drainpipe" >> .drainpipeignore - ddev task snapshot:directory directory=/tmp/release - - - name: Prepare Actions - run: | - mkdir -p .github/actions - cp -R ./drainpipe/scaffold/github/actions/common .github/actions/drainpipe - - - name: Deploy Pantheon Review App - uses: ./drainpipe/scaffold/github/actions/pantheon/review - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - terminus-token: ${{ secrets.PANTHEON_TERMINUS_TOKEN }} - commit-message: ${{ github.sha }} - site-name: ${{ vars.PANTHEON_SITE_NAME || secrets.PANTHEON_SITE_NAME }} - lock-username: ${{ secrets.PANTHEON_REVIEW_USERNAME }} - lock-password: ${{ secrets.PANTHEON_REVIEW_PASSWORD }} - # set to "true" if you want to run the installer - run-installer: ${{ secrets.PANTHEON_REVIEW_RUN_INSTALLER }} diff --git a/.github/workflows/TestMetapackages.yml b/.github/workflows/TestMetapackages.yml deleted file mode 100644 index f4ce934de..000000000 --- a/.github/workflows/TestMetapackages.yml +++ /dev/null @@ -1,360 +0,0 @@ -name: Test Sass and JavaScript Compilation -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Build: - runs-on: ubuntu-24.04 - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev config --nodejs-version "22" - ddev config --corepack-enable - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - - - name: Setup Test Files - run: | - cp drainpipe/tests/fixtures/metapackages/Taskfile.yml . - cp drainpipe/tests/fixtures/metapackages/style.scss . - cp -R drainpipe/tests/fixtures/metapackages/js . - - - name: Create Artifact - run: zip -r /tmp/drainpipe.zip ./ - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: test-metapackage-build - path: /tmp/drainpipe.zip - - Test-Sass-NPM: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev npm init -y - ddev npm install drainpipe/metapackages/sass --save-dev - - - name: Compile Sass - run: ddev task sass - - Test-Sass-Yarn-Classic: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev exec corepack disable - ddev exec npm i -g yarn@1.22.1 - ddev exec 'ln -s $(npm root -g)/yarn/bin/yarn /usr/local/bin/yarn' - ddev exec yarn init -y - ddev exec yarn add file:./drainpipe/metapackages/sass --dev - - - name: Compile Sass - run: ddev task sass - - Test-Sass-Yarn-3: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev yarn set version berry - ddev yarn set version 3 - ddev yarn init -y - ddev yarn add ./drainpipe/metapackages/sass --dev - - - name: Compile Sass - run: ddev task sass - - Test-Sass-Yarn-4: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev restart - ddev yarn set version berry - ddev yarn set version 4 - ddev yarn init -y - ddev yarn cache clear - ddev yarn add ./drainpipe/metapackages/sass --dev - - - name: Compile Sass - run: ddev task sass - - Test-JavaScript-NPM: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev npm init -y - ddev npm install focus-trap@^6.7.3 - ddev npm install drainpipe/metapackages/javascript --save-dev - - - name: Compile JavaScript - run: ddev task javascript - - Test-JavaScript-Yarn-Classic: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev exec corepack disable - ddev exec npm i -g yarn@1.22.1 - ddev exec 'ln -s $(npm root -g)/yarn/bin/yarn /usr/local/bin/yarn' - ddev exec yarn init -y - ddev exec yarn add focus-trap@^6.7.3 - ddev exec yarn add file:./drainpipe/metapackages/javascript --dev - - - name: Compile JavaScript - run: ddev task javascript - - Test-JavaScript-Yarn-3: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev yarn set version berry - ddev yarn set version 3 - ddev yarn init -y - ddev yarn add focus-trap@^6.7.3 - ddev yarn add ./drainpipe/metapackages/javascript --dev - - - name: Compile JavaScript - run: ddev task javascript - - Test-JavaScript-Yarn-4: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev restart - ddev yarn set version berry - ddev yarn set version 4 - ddev yarn init -y - ddev yarn cache clear - ddev yarn add focus-trap@^6.7.3 - ddev yarn add ./drainpipe/metapackages/javascript --dev - - - name: Compile JavaScript - run: ddev task javascript diff --git a/.github/workflows/TestPHPUnit.yml b/.github/workflows/TestPHPUnit.yml deleted file mode 100644 index 5546ba6f9..000000000 --- a/.github/workflows/TestPHPUnit.yml +++ /dev/null @@ -1,225 +0,0 @@ -name: Test PHPUnit Integration -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-PHPUnit-Functional: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Install xmllint - run: sudo apt-get update && sudo apt-get install -y libxml2-utils - - - name: Create a Drupal project - run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - # Restart is required to enable the provided Selenium containers - ddev restart - - - name: Add Custom Testing Module - run: | - mkdir web/modules/custom - cp -R drainpipe/tests/fixtures/phpunit/testmodule web/modules/custom/ - cp drainpipe/tests/fixtures/phpunit/Taskfile.yml . - - - name: Run PHPUnit Functional Tests - run: | - ddev drush site:install -y - ddev drush user:password admin password - ddev task test:phpunit:functional format=junit - docker logs ddev-drainpipe-chrome | tee test_result/ddev-chrome.log - docker logs ddev-drainpipe-firefox | tee test_result/ddev-firefox.log - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-phpunit-functional-${{ matrix.drupal-version }} - path: test_result - - - name: Confirm All PHPUnit Functional Tests were run - uses: GuillaumeFalourd/assert-command-line-output@v2.4 - with: - command_line: xmllint --xpath 'string(//testsuites/testsuite/@tests)' test_result/phpunit-functional.xml - contains: 6 - expected_result: PASSED - - Test-PHPUnit-Functional-DTT: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Install xmllint - run: sudo apt-get update && sudo apt-get install -y libxml2-utils - - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe", "weitzman/drupal-test-traits"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config --no-plugins allow-plugins.weitzman/drupal-test-traits true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" weitzman/drupal-test-traits lullabot/mink-selenium2-driver --dev --with-all-dependencies - # Restart is required to enable the provided Selenium containers - ddev restart - - - name: Add Custom Testing Module - run: | - mkdir web/modules/custom - cp -R drainpipe/tests/fixtures/phpunit/testmodule web/modules/custom/ - cp drainpipe/tests/fixtures/phpunit/Taskfile-testtraits.yml Taskfile.yml - - - name: Run PHPUnit Functional Tests - run: | - ddev drush site:install -y - ddev drush user:password admin password - ddev task test:phpunit:functional format=junit - docker logs ddev-drainpipe-chrome | tee test_result/ddev-chrome.log - docker logs ddev-drainpipe-firefox | tee test_result/ddev-firefox.log - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-phpunit-dtt-${{ matrix.drupal-version }} - path: test_result - - - name: Confirm All PHPUnit Functional Tests were run - uses: GuillaumeFalourd/assert-command-line-output@v2 - with: - command_line: xmllint --xpath 'string(//testsuites/testsuite/@tests)' test_result/phpunit-functional.xml - contains: 9 - expected_result: PASSED - - Test-PHPUnit-Static: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Install xmllint - run: sudo apt-get update && sudo apt-get install -y libxml2-utils - - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - # Restart is required to enable the provided Selenium containers - ddev restart - - - name: Add Custom Testing Module - run: | - mkdir web/modules/custom - cp -R drainpipe/tests/fixtures/phpunit/testmodule web/modules/custom/ - cp drainpipe/tests/fixtures/phpunit/Taskfile.yml . - - - name: Run PHPUnit Tests - run: ddev task test:phpunit:static format=junit - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-phpunit-static-${{ matrix.drupal-version }} - path: test_result - - - name: Confirm All PHPUnit Functional Tests were run - uses: GuillaumeFalourd/assert-command-line-output@v2 - with: - command_line: xmllint --xpath 'string(//testsuites/testsuite/@tests)' test_result/phpunit.xml - contains: 12 - expected_result: PASSED diff --git a/.github/workflows/TestStatic.yml b/.github/workflows/TestStatic.yml deleted file mode 100644 index 1ece49bb4..000000000 --- a/.github/workflows/TestStatic.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Test Static Tests -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Static: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - # Restart is required to enable the provided Selenium containers - ddev restart - - - name: Verify files were created - run: | - test -f phpcs.xml.dist - test -f phpstan.neon.dist - - - name: Create a git repository - run: | - git config --global user.email "no-reply@example.com" - git config --global user.name "Drainpipe Bot" - git init - echo "/drainpipe" >> .gitignore - echo "/drainpipe-dev" >> .gitignore - git add . - git commit -m "Initial commit" - - - name: Fix settings.php - run: | - sed -i '/^.*container_yamls.*$/i /** @phpstan-ignore-next-line */' web/sites/default/settings.php - - - name: Test for untracked and modified files - id: test_untracked - continue-on-error: true - run: ddev task test:untracked - - - name: Test for untracked and modified files - run: | - if [ "${{ steps.test_untracked.outcome }}" != "failure" ]; then - exit 1 - fi - git add . - git commit -m "Second commit" - ddev task test:untracked - - - name: Run Static Tests - run: ddev task test:static - - - name: Confirm custom directories are scanned - run: | - set -x - mkdir -p custom-yaml-directory - echo 'key: value' >> custom-yaml-directory/test.yml - ddev task test:static YAML_DIRS="custom-yaml-directory/*.yml" | tee static.log - [[ $(grep '\[OK] All 1 YAML files contain valid syntax.' static.log | wc -l) -eq 1 ]] - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-static - path: test_result diff --git a/.github/workflows/TestTugboat.yml b/.github/workflows/TestTugboat.yml deleted file mode 100644 index f65ce60f1..000000000 --- a/.github/workflows/TestTugboat.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: "Test Tugboat" - -on: - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Tugboat: - runs-on: ubuntu-24.04 - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - - # Lock in versions so tests know what to expect. - # Redis tag v1.2.0 == 6-bullseye - # Elasticsearch tag v0.3.2 == 7.17.14 - - name: Setup Project - run: | - ddev config --auto - ddev config --php-version "8.3" - ddev config --nodejs-version "18" - ddev get ddev/ddev-redis --version v1.2.0 - ddev get ddev/ddev-elasticsearch --version v0.3.2 - ddev restart - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev exec --raw composer config extra.drainpipe --json '{"tugboat": {}}' - mkdir -p .tugboat - echo "php:" > .tugboat/config.drainpipe-override.yml - echo " aliases:" >> .tugboat/config.drainpipe-override.yml - echo " - foo" >> .tugboat/config.drainpipe-override.yml - echo " urls:" >> .tugboat/config.drainpipe-override.yml - echo " - /" >> .tugboat/config.drainpipe-override.yml - echo " - /?v=1" >> .tugboat/config.drainpipe-override.yml - echo " screenshot:" >> .tugboat/config.drainpipe-override.yml - echo " timeout: 45" >> .tugboat/config.drainpipe-override.yml - echo " visualdiff:" >> .tugboat/config.drainpipe-override.yml - echo " fullPage: false" >> .tugboat/config.drainpipe-override.yml - ddev composer require lullabot/drainpipe --with-all-dependencies - - - name: Add an online step - run: | - echo " online:tugboat:" >> Taskfile.yml - echo " cmds:" >> Taskfile.yml - echo " - echo \"Tugboat online\"" >> Taskfile.yml - ddev composer install - - # Compare the generated files to the ones used to build this repository - # preview - they should be the same. - - name: Test Generated Files - run: | - diff -up drainpipe/.tugboat/config.yml .tugboat/config.yml - sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/1-init.sh - sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/2-update.sh - sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/3-build.sh - sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/4-online.sh - diff -up drainpipe/.tugboat/steps/1-init.sh .tugboat/steps/1-init.sh - diff -up drainpipe/.tugboat/steps/2-update.sh .tugboat/steps/2-update.sh - diff -up drainpipe/.tugboat/steps/3-build.sh .tugboat/steps/3-build.sh - diff -up drainpipe/.tugboat/steps/4-online.sh .tugboat/steps/4-online.sh - - - name: Add a build:tugboat step - run: | - echo " build:tugboat:" >> Taskfile.yml - echo " cmds:" >> Taskfile.yml - echo " - echo \"Tugboat build\"" >> Taskfile.yml - ddev composer install - if ! grep -q './vendor/bin/task build:tugboat' .tugboat/steps/3-build.sh; then - exit 1 - fi - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: .tugboat - path: .tugboat - - Test-Non-Default-Nodejs: - runs-on: ubuntu-24.04 - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - - - name: Setup Project - run: | - ddev config --auto - ddev config --php-version "8.3" - ddev config --nodejs-version "16" - ddev restart - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev exec --raw composer config extra.drainpipe --json '{"tugboat": {}}' - ddev composer require lullabot/drainpipe --with-all-dependencies - - - name: Test NODE_MAJOR is correct - run: | - cat .tugboat/steps/1-init.sh - grep -q NODE_MAJOR=16 .tugboat/steps/1-init.sh - diff --git a/.github/workflows/ValidateTaskfile.yml b/.github/workflows/ValidateTaskfile.yml deleted file mode 100644 index 29f206be4..000000000 --- a/.github/workflows/ValidateTaskfile.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Validate example Taskfile.yml -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -jobs: - Validate-Example-Taskfile: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: '18' - - - name: Validate Taskfile.yml - # Also update src/BinaryInstallPlugin.php if changing version - run: | - curl -O https://raw.githubusercontent.com/go-task/task/v3.38.0/website/static/schema.json - npx ajv-cli validate -s schema.json -d scaffold/Taskfile.yml diff --git a/.github/workflows/composer-plugin.yml b/.github/workflows/composer-plugin.yml deleted file mode 100644 index 3380fc624..000000000 --- a/.github/workflows/composer-plugin.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Composer Plugin -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Composer-Plugin: - runs-on: ubuntu-24.04 - strategy: - matrix: - php-version: [ 8.1, 8.2, 8.3 ] - steps: - - uses: actions/checkout@v4 - - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - tools: composer:v2 - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - run: composer install - - - run: ./vendor/bin/phpunit diff --git a/.github/workflows/test-production-build.yml b/.github/workflows/test-production-build.yml deleted file mode 100644 index f8144364c..000000000 --- a/.github/workflows/test-production-build.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Test Production Build -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Production-Build: - runs-on: ubuntu-24.04 - strategy: - matrix: - php-version: [ 8.1, 8.2, 8.3 ] - include: - - php-version: 8.1 - drupal-version: ":^10" - - php-version: 8.2 - drupal-version: ":^10" - steps: - - uses: actions/checkout@v4 - - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - tools: composer:v2 - extensions: gd - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - - name: Install Drupal - run: | - cd ../ - composer create-project drupal/recommended-project${{ matrix.drupal-version }} drupal --ignore-platform-reqs - cd drupal - cp ${GITHUB_WORKSPACE}/tests/fixtures.drainpipe-test-build/Taskfile.yml . - composer config extra.drupal-scaffold.gitignore true - composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe"]' - composer config --no-plugins allow-plugins.composer/installers true - composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - composer config --no-plugins allow-plugins.lullabot/drainpipe true - composer config repositories.drainpipe --json '{"type": "path", "url": "../drainpipe", "options": {"symlink": false}}' - composer config minimum-stability dev - composer require "lullabot/drainpipe @dev" --with-all-dependencies - - - name: Run static tests - run: | - cd ../drupal - ./vendor/bin/task build From e2a53fa49dce17f0df889245d6801fb05a6cd3b4 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 09:27:27 -0500 Subject: [PATCH 030/159] ISSUE-204: debugging --- scaffold/github/actions/acquia/deploy/action.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 0eb82fec8..2c541b7d2 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -25,6 +25,19 @@ inputs: runs: using: "composite" steps: + - name: debug + run: | + + echo "===================" + ls .github + + echo "===================" + ls .github/actions + echo "===================" + ls .github/action/common/ + + shell: bash + - name: Create GitHub Deployment uses: .github/actions/common/deployment-create with: From 364b60a7f92e07c893935f30762faa62acf3d04f Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 09:36:44 -0500 Subject: [PATCH 031/159] ISSUE-204: fix paths --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 2c541b7d2..faef7b8a5 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -39,7 +39,7 @@ runs: shell: bash - name: Create GitHub Deployment - uses: .github/actions/common/deployment-create + uses: .github/actions/drainpipe/deployment-create with: github-token: ${{ inputs.github-token }} environment: ${{ inputs.environment }} @@ -69,7 +69,7 @@ runs: run-installer: ${{ inputs.run-installer }} - name: Set Deployment Status - uses: .github/actions/drainpipe/common/deployment-status + uses: .github/actions/drainpipe/deployment-status with: github-token: ${{ inputs.github-token }} environment-url: ${{ inputs.environment-url }} From 7d8ecde5ac2b85efdec23263ddb3fcf4775e2a09 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 09:41:52 -0500 Subject: [PATCH 032/159] ISSUE-204: debug --- .../github/actions/acquia/deploy/action.yml | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index faef7b8a5..d0962deb1 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -38,43 +38,3 @@ runs: shell: bash - - name: Create GitHub Deployment - uses: .github/actions/drainpipe/deployment-create - with: - github-token: ${{ inputs.github-token }} - environment: ${{ inputs.environment }} - - - name: Put site in Maintenance Mode - run: | - source .github/actions/common/set-env/bash_aliases - drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" - ENVIRONMENT="${{ inputs.environment }}" - APPLICATION=${ENVIRONMENT%.*} - drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabot8.dev" - shell: bash - - - name: Push to Acquia - uses: .github/actions/drainpipe/acquia/push - with: - environment: ${{ inputs.environment }} - commit-message: ${{ inputs.commit-message }} - api-key: ${{ inputs.api-key }} - api-secret: ${{ inputs.api-secret }} - - - name: Run updates - uses: .github/actions/drainpipe/acquia/update - with: - environment: ${{ inputs.environment }} - run-installer: ${{ inputs.run-installer }} - - - name: Set Deployment Status - uses: .github/actions/drainpipe/deployment-status - with: - github-token: ${{ inputs.github-token }} - environment-url: ${{ inputs.environment-url }} - - - name: Take site out of Maintenance Mode - run: | - drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" - shell: bash From 5cbdcc564228c5ee4a0adb1acfb8a475c54b26e0 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 09:48:07 -0500 Subject: [PATCH 033/159] ISSUE-204: debug --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index d0962deb1..c354b0d20 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -34,7 +34,7 @@ runs: echo "===================" ls .github/actions echo "===================" - ls .github/action/common/ + ls .github/action/drainpipe/ shell: bash From 79abadf152c68e5143534c58b1f9b2a01dfedb58 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 09:52:35 -0500 Subject: [PATCH 034/159] ISSUE-204: debug [skip ci] --- .github/workflows/TestAcquia.yml | 14 +++++++------- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 4ef041fe5..2f74e54ba 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -71,13 +71,13 @@ jobs: echo "/drainpipe" >> .drainpipeignore ddev task snapshot:directory directory=/tmp/release - - name: Clone from production to dev - uses: ./drainpipe/scaffold/github/actions/acquia/clone-env - with: - source-environment: lullabotsandbox.prod - target-environment: lullabotsandbox.dev - api-key: ${{ secrets.ACQUIA_API_KEY }} - api-secret: ${{ secrets.ACQUIA_API_SECRET }} + # - name: Clone from production to dev + # uses: ./drainpipe/scaffold/github/actions/acquia/clone-env + # with: + # source-environment: lullabotsandbox.prod + # target-environment: lullabotsandbox.dev + # api-key: ${{ secrets.ACQUIA_API_KEY }} + # api-secret: ${{ secrets.ACQUIA_API_SECRET }} - name: Deploy to dev uses: ./drainpipe/scaffold/github/actions/acquia/deploy diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index c354b0d20..ba096f73c 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -34,7 +34,7 @@ runs: echo "===================" ls .github/actions echo "===================" - ls .github/action/drainpipe/ + ls .github/actions/drainpipe/ shell: bash From 01ec60bdef8b23b57a14b55d2485efbf68fad091 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 09:53:12 -0500 Subject: [PATCH 035/159] To trigger CI workflows From 7766169c7a8bb67016b841b0f34aa3d0331ef209 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 10:20:34 -0500 Subject: [PATCH 036/159] ISSUE-204: fix paths --- .../drainpipe => scaffold/github/actions}/acquia/push/action.yml | 0 .../github/actions}/acquia/update/action.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {.github/actions/drainpipe => scaffold/github/actions}/acquia/push/action.yml (100%) rename {.github/actions/drainpipe => scaffold/github/actions}/acquia/update/action.yml (100%) diff --git a/.github/actions/drainpipe/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml similarity index 100% rename from .github/actions/drainpipe/acquia/push/action.yml rename to scaffold/github/actions/acquia/push/action.yml diff --git a/.github/actions/drainpipe/acquia/update/action.yml b/scaffold/github/actions/acquia/update/action.yml similarity index 100% rename from .github/actions/drainpipe/acquia/update/action.yml rename to scaffold/github/actions/acquia/update/action.yml From 3fd921340f8cd4dc008e7b06473880fceb287eea Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 10:20:59 -0500 Subject: [PATCH 037/159] ISSUE-204: fix typo for debugging --- scaffold/github/actions/acquia/deploy/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index ba096f73c..d428aa057 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -34,7 +34,6 @@ runs: echo "===================" ls .github/actions echo "===================" - ls .github/actions/drainpipe/ + ls .github/action/drainpipe/ shell: bash - From 26f68d6c84ee6d0e9def555e8957621eec32b0b4 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 10:28:42 -0500 Subject: [PATCH 038/159] ISSUE-204: typo --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index d428aa057..cad852e15 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -34,6 +34,6 @@ runs: echo "===================" ls .github/actions echo "===================" - ls .github/action/drainpipe/ + ls .github/actions/drainpipe/ shell: bash From b03a3b0b72275705c8e7e1a15f082640841a9aff Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 10:43:09 -0500 Subject: [PATCH 039/159] ISSUE-204: restoting content --- .github/workflows/TestAcquia.yml | 26 ++++++------ .../github/actions/acquia/deploy/action.yml | 42 +++++++++++++++---- 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 2f74e54ba..d940cfed5 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -71,21 +71,21 @@ jobs: echo "/drainpipe" >> .drainpipeignore ddev task snapshot:directory directory=/tmp/release - # - name: Clone from production to dev - # uses: ./drainpipe/scaffold/github/actions/acquia/clone-env - # with: - # source-environment: lullabotsandbox.prod - # target-environment: lullabotsandbox.dev - # api-key: ${{ secrets.ACQUIA_API_KEY }} - # api-secret: ${{ secrets.ACQUIA_API_SECRET }} + - name: Clone from production to dev + uses: ./drainpipe/scaffold/github/actions/acquia/clone-env + with: + source-environment: lullabotsandbox.prod + target-environment: lullabotsandbox.dev + api-key: ${{ secrets.ACQUIA_API_KEY }} + api-secret: ${{ secrets.ACQUIA_API_SECRET }} - name: Deploy to dev uses: ./drainpipe/scaffold/github/actions/acquia/deploy with: - github-token: "test1" - environment: "test6" - environment-url: "tests5" + github-token: ${{ secrets.GITHUB_TOKEN }} + environment: lullabotsandbox.dev + environment-url: https://lullabotsandboxffi2ugpgwh.devcloud.acquia-sites.com run-installer: true - commit-message: "test2" - api-key: "test3" - api-secret: "test4" + commit-message: ${{ github.sha }} + api-key: ${{ secrets.ACQUIA_API_KEY }} + api-secret: ${{ secrets.ACQUIA_API_SECRET }} diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index cad852e15..1de1d1611 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -25,15 +25,43 @@ inputs: runs: using: "composite" steps: - - name: debug + - name: Create GitHub Deployment + uses: .github/actions/drainpipe/deployment-create + with: + github-token: ${{ inputs.github-token }} + environment: ${{ inputs.environment }} + + - name: Put site in Maintenance Mode run: | + source .github/actions/drainpipe/set-env/bash_aliases + drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" + ENVIRONMENT="${{ inputs.environment }}" + APPLICATION=${ENVIRONMENT%.*} + drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabot8.dev" + shell: bash - echo "===================" - ls .github + - name: Push to Acquia + uses: ./drainpipe/scaffold/github/actions/acquia/push + with: + environment: ${{ inputs.environment }} + commit-message: ${{ inputs.commit-message }} + api-key: ${{ inputs.api-key }} + api-secret: ${{ inputs.api-secret }} - echo "===================" - ls .github/actions - echo "===================" - ls .github/actions/drainpipe/ + - name: Run updates + uses: ./drainpipe/scaffold/github/actions/acquia/update + with: + environment: ${{ inputs.environment }} + run-installer: ${{ inputs.run-installer }} + - name: Set Deployment Status + uses: .github/actions/drainpipe/common/deployment-status + with: + github-token: ${{ inputs.github-token }} + environment-url: ${{ inputs.environment-url }} + + - name: Take site out of Maintenance Mode + run: | + drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" shell: bash From 44e7d18a6d1a0ac6ce20ba72fab006566133a85d Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 11:22:28 -0500 Subject: [PATCH 040/159] ISSUE-204: debugging, remove deployment create --- scaffold/github/actions/acquia/deploy/action.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 1de1d1611..037f47c05 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -25,11 +25,6 @@ inputs: runs: using: "composite" steps: - - name: Create GitHub Deployment - uses: .github/actions/drainpipe/deployment-create - with: - github-token: ${{ inputs.github-token }} - environment: ${{ inputs.environment }} - name: Put site in Maintenance Mode run: | From 4783436a8121819617de7b6cda41016038861599 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 12:43:05 -0500 Subject: [PATCH 041/159] ISSUE-204: debugging, restore deployment create --- scaffold/github/actions/acquia/deploy/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 037f47c05..e564d3539 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -25,6 +25,11 @@ inputs: runs: using: "composite" steps: + - name: Create GitHub Deployment + uses: .github/actions/drainpipe/deployment-create + with: + github-token: ${{ inputs.github-token }} + environment: ${{ inputs.environment }} - name: Put site in Maintenance Mode run: | @@ -51,7 +56,7 @@ runs: run-installer: ${{ inputs.run-installer }} - name: Set Deployment Status - uses: .github/actions/drainpipe/common/deployment-status + uses: .github/actions/drainpipe/deployment-status with: github-token: ${{ inputs.github-token }} environment-url: ${{ inputs.environment-url }} From 3a63464a9e96e3c8c64f6f68eb6aab16b7eed9d3 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 12:50:18 -0500 Subject: [PATCH 042/159] ISSUE-204: debug --- .../github/actions/acquia/deploy/action.yml | 85 +++++++++++-------- 1 file changed, 51 insertions(+), 34 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index e564d3539..cb531c291 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -25,43 +25,60 @@ inputs: runs: using: "composite" steps: - - name: Create GitHub Deployment - uses: .github/actions/drainpipe/deployment-create - with: - github-token: ${{ inputs.github-token }} - environment: ${{ inputs.environment }} + # - name: Create GitHub Deployment + # uses: .github/actions/drainpipe/deployment-create + # with: + # github-token: ${{ inputs.github-token }} + # environment: ${{ inputs.environment }} - - name: Put site in Maintenance Mode - run: | - source .github/actions/drainpipe/set-env/bash_aliases - drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" - ENVIRONMENT="${{ inputs.environment }}" - APPLICATION=${ENVIRONMENT%.*} - drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabot8.dev" - shell: bash + # - name: Put site in Maintenance Mode + # run: | + # source .github/actions/drainpipe/set-env/bash_aliases + # drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" + # ENVIRONMENT="${{ inputs.environment }}" + # APPLICATION=${ENVIRONMENT%.*} + # drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabot8.dev" + # shell: bash + + # - name: Push to Acquia + # uses: ./drainpipe/scaffold/github/actions/acquia/push + # with: + # environment: ${{ inputs.environment }} + # commit-message: ${{ inputs.commit-message }} + # api-key: ${{ inputs.api-key }} + # api-secret: ${{ inputs.api-secret }} - - name: Push to Acquia - uses: ./drainpipe/scaffold/github/actions/acquia/push - with: - environment: ${{ inputs.environment }} - commit-message: ${{ inputs.commit-message }} - api-key: ${{ inputs.api-key }} - api-secret: ${{ inputs.api-secret }} + # - name: Run updates + # uses: ./drainpipe/scaffold/github/actions/acquia/update + # with: + # environment: ${{ inputs.environment }} + # run-installer: ${{ inputs.run-installer }} - - name: Run updates - uses: ./drainpipe/scaffold/github/actions/acquia/update - with: - environment: ${{ inputs.environment }} - run-installer: ${{ inputs.run-installer }} + # - name: Set Deployment Status + # uses: .github/actions/drainpipe/deployment-status + # with: + # github-token: ${{ inputs.github-token }} + # environment-url: ${{ inputs.environment-url }} - - name: Set Deployment Status - uses: .github/actions/drainpipe/deployment-status - with: - github-token: ${{ inputs.github-token }} - environment-url: ${{ inputs.environment-url }} + # - name: Take site out of Maintenance Mode + # run: | + # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" + # shell: bash - - name: Take site out of Maintenance Mode + - name: Debug run: | - drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" - shell: bash + + echo "-------------------------" + echo "ls .github" + ls -al .github + + echo "-------------------------" + echo "ls .github/actions" + ls -al .github/actions + + echo "-------------------------" + echo "ls .github/actions/drainpipe" + ls -al .github/actions/drainpipe + + From 09855094e342cde6a65ca708a6996cadb2ae6102 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 12:55:48 -0500 Subject: [PATCH 043/159] ISSUE-204: adding shell --- scaffold/github/actions/acquia/deploy/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index cb531c291..526be6861 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -81,4 +81,5 @@ runs: echo "ls .github/actions/drainpipe" ls -al .github/actions/drainpipe + shell: bash From de0ef8db755f9a74faccd7161d60d45b3c7a642c Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 13:01:53 -0500 Subject: [PATCH 044/159] ISSUE-204: debug --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 526be6861..fe5ba0146 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -81,5 +81,9 @@ runs: echo "ls .github/actions/drainpipe" ls -al .github/actions/drainpipe + echo "-------------------------" + echo "ls .github/actions/drainpipe/deployment-create" + ls -al .github/actions/drainpipe/deployment-create + shell: bash From c8a4cfe80501f57289cbcd61f8d10a6ca6957e94 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 13:07:26 -0500 Subject: [PATCH 045/159] ISSUE-204: debug --- .github/workflows/TestAcquia.yml | 14 +-- .../github/actions/acquia/deploy/action.yml | 88 +++++++------------ .../common/deployment-create/action.yml | 2 +- 3 files changed, 42 insertions(+), 62 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index d940cfed5..d286b3320 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -71,13 +71,13 @@ jobs: echo "/drainpipe" >> .drainpipeignore ddev task snapshot:directory directory=/tmp/release - - name: Clone from production to dev - uses: ./drainpipe/scaffold/github/actions/acquia/clone-env - with: - source-environment: lullabotsandbox.prod - target-environment: lullabotsandbox.dev - api-key: ${{ secrets.ACQUIA_API_KEY }} - api-secret: ${{ secrets.ACQUIA_API_SECRET }} + # - name: Clone from production to dev + # uses: ./drainpipe/scaffold/github/actions/acquia/clone-env + # with: + # source-environment: lullabotsandbox.prod + # target-environment: lullabotsandbox.dev + # api-key: ${{ secrets.ACQUIA_API_KEY }} + # api-secret: ${{ secrets.ACQUIA_API_SECRET }} - name: Deploy to dev uses: ./drainpipe/scaffold/github/actions/acquia/deploy diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index fe5ba0146..f6095aa6f 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -25,65 +25,45 @@ inputs: runs: using: "composite" steps: - # - name: Create GitHub Deployment - # uses: .github/actions/drainpipe/deployment-create - # with: - # github-token: ${{ inputs.github-token }} - # environment: ${{ inputs.environment }} + - name: Create GitHub Deployment + uses: .github/actions/drainpipe/deployment-create + with: + github-token: ${{ inputs.github-token }} + environment: ${{ inputs.environment }} - # - name: Put site in Maintenance Mode - # run: | - # source .github/actions/drainpipe/set-env/bash_aliases - # drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" - # ENVIRONMENT="${{ inputs.environment }}" - # APPLICATION=${ENVIRONMENT%.*} - # drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabot8.dev" - # shell: bash - - # - name: Push to Acquia - # uses: ./drainpipe/scaffold/github/actions/acquia/push - # with: - # environment: ${{ inputs.environment }} - # commit-message: ${{ inputs.commit-message }} - # api-key: ${{ inputs.api-key }} - # api-secret: ${{ inputs.api-secret }} - - # - name: Run updates - # uses: ./drainpipe/scaffold/github/actions/acquia/update - # with: - # environment: ${{ inputs.environment }} - # run-installer: ${{ inputs.run-installer }} - - # - name: Set Deployment Status - # uses: .github/actions/drainpipe/deployment-status - # with: - # github-token: ${{ inputs.github-token }} - # environment-url: ${{ inputs.environment-url }} - - # - name: Take site out of Maintenance Mode - # run: | - # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" - # shell: bash - - - name: Debug + - name: Put site in Maintenance Mode run: | + source .github/actions/drainpipe/set-env/bash_aliases + drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" + ENVIRONMENT="${{ inputs.environment }}" + APPLICATION=${ENVIRONMENT%.*} + drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabot8.dev" + shell: bash - echo "-------------------------" - echo "ls .github" - ls -al .github - - echo "-------------------------" - echo "ls .github/actions" - ls -al .github/actions + - name: Push to Acquia + uses: ./drainpipe/scaffold/github/actions/acquia/push + with: + environment: ${{ inputs.environment }} + commit-message: ${{ inputs.commit-message }} + api-key: ${{ inputs.api-key }} + api-secret: ${{ inputs.api-secret }} - echo "-------------------------" - echo "ls .github/actions/drainpipe" - ls -al .github/actions/drainpipe + - name: Run updates + uses: ./drainpipe/scaffold/github/actions/acquia/update + with: + environment: ${{ inputs.environment }} + run-installer: ${{ inputs.run-installer }} - echo "-------------------------" - echo "ls .github/actions/drainpipe/deployment-create" - ls -al .github/actions/drainpipe/deployment-create + - name: Set Deployment Status + uses: .github/actions/drainpipe/deployment-status + with: + github-token: ${{ inputs.github-token }} + environment-url: ${{ inputs.environment-url }} + - name: Take site out of Maintenance Mode + run: | + drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" shell: bash + diff --git a/scaffold/github/actions/common/deployment-create/action.yml b/scaffold/github/actions/common/deployment-create/action.yml index 0ae1465aa..b7b261ff5 100644 --- a/scaffold/github/actions/common/deployment-create/action.yml +++ b/scaffold/github/actions/common/deployment-create/action.yml @@ -10,7 +10,7 @@ inputs: runs: using: "composite" steps: - - uses: ./.github/actions/drainpipe/common/set-env + - uses: .github/actions/drainpipe/set-env - name: Create GitHub Deployment run: | From a2f90392cec937c45fdc67a514b499b04da616c8 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 13:14:58 -0500 Subject: [PATCH 046/159] ISSUE-204: using different path --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index f6095aa6f..dad353463 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -26,7 +26,7 @@ runs: using: "composite" steps: - name: Create GitHub Deployment - uses: .github/actions/drainpipe/deployment-create + uses: ./.github/actions/drainpipe/deployment-create with: github-token: ${{ inputs.github-token }} environment: ${{ inputs.environment }} From e68187d9840db9435b18297ad30ee77d96534f24 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 13:18:17 -0500 Subject: [PATCH 047/159] ISSUE-204: fail faster [skip ci] --- .github/workflows/TestAcquia.yml | 92 ++++++++++++++++---------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index d286b3320..4f79770d1 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -19,57 +19,57 @@ jobs: - uses: ./drainpipe/scaffold/github/actions/common/set-env - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - ssh-private-key: ${{ secrets.ACQUIA_SSH_PRIVATE_KEY }} + # - name: Install DDEV + # uses: ./drainpipe/scaffold/github/actions/common/ddev + # with: + # git-name: Drainpipe Bot + # git-email: no-reply@example.com + # ssh-private-key: ${{ secrets.ACQUIA_SSH_PRIVATE_KEY }} - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config extra.drainpipe.github --json '{"acquia": []}' - ddev exec --raw composer config minimum-stability dev - ddev composer require lullabot/drainpipe --with-all-dependencies - yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml + # - name: Setup Project + # run: | + # ddev config --auto + # ddev start + # ddev exec --raw composer config extra.drupal-scaffold.gitignore true + # ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] + # ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + # ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + # ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + # ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + # ddev exec --raw composer config extra.drainpipe.github --json '{"acquia": []}' + # ddev exec --raw composer config minimum-stability dev + # ddev composer require lullabot/drainpipe --with-all-dependencies + # yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml - - name: Install Drupal - run: | - ddev drush site:install minimal -y - echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php - ddev drush config:export -y + # - name: Install Drupal + # run: | + # ddev drush site:install minimal -y + # echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php + # ddev drush config:export -y - - name: Create .drainpipeignore - run: | - echo "/web/sites/default/files" >> .drainpipeignore - echo "/.ddev" >> .drainpipeignore - echo "settings.ddev.php" >> .drainpipeignore - echo "/drainpipe" >> .drainpipeignore + # - name: Create .drainpipeignore + # run: | + # echo "/web/sites/default/files" >> .drainpipeignore + # echo "/.ddev" >> .drainpipeignore + # echo "settings.ddev.php" >> .drainpipeignore + # echo "/drainpipe" >> .drainpipeignore - - name: Create settings.php - run: | - echo ' web/sites/default/settings.php - echo "\$settings['container_yamls'][] = __DIR__ . '/services.yml';" >> web/sites/default/settings.php - echo "include __DIR__ . \"/settings.acquia.php\";" >> web/sites/default/settings.php - echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php + # - name: Create settings.php + # run: | + # echo ' web/sites/default/settings.php + # echo "\$settings['container_yamls'][] = __DIR__ . '/services.yml';" >> web/sites/default/settings.php + # echo "include __DIR__ . \"/settings.acquia.php\";" >> web/sites/default/settings.php + # echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php - - name: Snapshot Project - env: - directory: /tmp/release - remote: - message: - site: - run: | - echo "/drainpipe" >> .drainpipeignore - ddev task snapshot:directory directory=/tmp/release + # - name: Snapshot Project + # env: + # directory: /tmp/release + # remote: + # message: + # site: + # run: | + # echo "/drainpipe" >> .drainpipeignore + # ddev task snapshot:directory directory=/tmp/release # - name: Clone from production to dev # uses: ./drainpipe/scaffold/github/actions/acquia/clone-env From 5ae8cde09913e64ae82b65673338dbc16c34913b Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 13:18:29 -0500 Subject: [PATCH 048/159] ISSUE-204: using different path --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index dad353463..087ccb5ff 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -56,7 +56,7 @@ runs: run-installer: ${{ inputs.run-installer }} - name: Set Deployment Status - uses: .github/actions/drainpipe/deployment-status + uses: ./.github/actions/drainpipe/deployment-status with: github-token: ${{ inputs.github-token }} environment-url: ${{ inputs.environment-url }} From 180312ca393c7f4bb6cc561236442dd44af28a52 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 13:26:09 -0500 Subject: [PATCH 049/159] ISSUE-204: restore TestAcquia --- .github/workflows/TestAcquia.yml | 106 +++++++++++++++---------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 4f79770d1..d940cfed5 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -19,65 +19,65 @@ jobs: - uses: ./drainpipe/scaffold/github/actions/common/set-env - # - name: Install DDEV - # uses: ./drainpipe/scaffold/github/actions/common/ddev - # with: - # git-name: Drainpipe Bot - # git-email: no-reply@example.com - # ssh-private-key: ${{ secrets.ACQUIA_SSH_PRIVATE_KEY }} + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + ssh-private-key: ${{ secrets.ACQUIA_SSH_PRIVATE_KEY }} - # - name: Setup Project - # run: | - # ddev config --auto - # ddev start - # ddev exec --raw composer config extra.drupal-scaffold.gitignore true - # ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - # ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - # ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - # ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - # ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - # ddev exec --raw composer config extra.drainpipe.github --json '{"acquia": []}' - # ddev exec --raw composer config minimum-stability dev - # ddev composer require lullabot/drainpipe --with-all-dependencies - # yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml + - name: Setup Project + run: | + ddev config --auto + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config extra.drainpipe.github --json '{"acquia": []}' + ddev exec --raw composer config minimum-stability dev + ddev composer require lullabot/drainpipe --with-all-dependencies + yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml - # - name: Install Drupal - # run: | - # ddev drush site:install minimal -y - # echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php - # ddev drush config:export -y + - name: Install Drupal + run: | + ddev drush site:install minimal -y + echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php + ddev drush config:export -y - # - name: Create .drainpipeignore - # run: | - # echo "/web/sites/default/files" >> .drainpipeignore - # echo "/.ddev" >> .drainpipeignore - # echo "settings.ddev.php" >> .drainpipeignore - # echo "/drainpipe" >> .drainpipeignore + - name: Create .drainpipeignore + run: | + echo "/web/sites/default/files" >> .drainpipeignore + echo "/.ddev" >> .drainpipeignore + echo "settings.ddev.php" >> .drainpipeignore + echo "/drainpipe" >> .drainpipeignore - # - name: Create settings.php - # run: | - # echo ' web/sites/default/settings.php - # echo "\$settings['container_yamls'][] = __DIR__ . '/services.yml';" >> web/sites/default/settings.php - # echo "include __DIR__ . \"/settings.acquia.php\";" >> web/sites/default/settings.php - # echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php + - name: Create settings.php + run: | + echo ' web/sites/default/settings.php + echo "\$settings['container_yamls'][] = __DIR__ . '/services.yml';" >> web/sites/default/settings.php + echo "include __DIR__ . \"/settings.acquia.php\";" >> web/sites/default/settings.php + echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php - # - name: Snapshot Project - # env: - # directory: /tmp/release - # remote: - # message: - # site: - # run: | - # echo "/drainpipe" >> .drainpipeignore - # ddev task snapshot:directory directory=/tmp/release + - name: Snapshot Project + env: + directory: /tmp/release + remote: + message: + site: + run: | + echo "/drainpipe" >> .drainpipeignore + ddev task snapshot:directory directory=/tmp/release - # - name: Clone from production to dev - # uses: ./drainpipe/scaffold/github/actions/acquia/clone-env - # with: - # source-environment: lullabotsandbox.prod - # target-environment: lullabotsandbox.dev - # api-key: ${{ secrets.ACQUIA_API_KEY }} - # api-secret: ${{ secrets.ACQUIA_API_SECRET }} + - name: Clone from production to dev + uses: ./drainpipe/scaffold/github/actions/acquia/clone-env + with: + source-environment: lullabotsandbox.prod + target-environment: lullabotsandbox.dev + api-key: ${{ secrets.ACQUIA_API_KEY }} + api-secret: ${{ secrets.ACQUIA_API_SECRET }} - name: Deploy to dev uses: ./drainpipe/scaffold/github/actions/acquia/deploy From a4caef2bd45ba62713a60ce46347686529951fcb Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 13:35:24 -0500 Subject: [PATCH 050/159] ISSUE-204: different path format --- scaffold/github/actions/common/deployment-create/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/common/deployment-create/action.yml b/scaffold/github/actions/common/deployment-create/action.yml index b7b261ff5..61d857697 100644 --- a/scaffold/github/actions/common/deployment-create/action.yml +++ b/scaffold/github/actions/common/deployment-create/action.yml @@ -10,7 +10,7 @@ inputs: runs: using: "composite" steps: - - uses: .github/actions/drainpipe/set-env + - uses: ./.github/actions/drainpipe/set-env - name: Create GitHub Deployment run: | From a7b2c90a110903a652ff3929bc71f83a522e2566 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 13:58:05 -0500 Subject: [PATCH 051/159] ISSUE-204: debug site aliases --- scaffold/github/actions/acquia/deploy/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 087ccb5ff..67d013bae 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -33,11 +33,16 @@ runs: - name: Put site in Maintenance Mode run: | + source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENVIRONMENT="${{ inputs.environment }}" APPLICATION=${ENVIRONMENT%.*} drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + + # debug site aliases + drainpipec_exec "./vendor/bin/drush site:alias" + drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabot8.dev" shell: bash From 16b6bb68f09aeab9016cfba1e6760f01439c60f7 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 14:01:25 -0500 Subject: [PATCH 052/159] ISSUE-204: debug site aliases --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 67d013bae..5afe46bae 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -41,7 +41,7 @@ runs: drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" # debug site aliases - drainpipec_exec "./vendor/bin/drush site:alias" + drainpipe_exec "./vendor/bin/drush site:alias" drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabot8.dev" shell: bash From 19333840509e6b4cd354d85826a5bdfb11dc2455 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 14:07:33 -0500 Subject: [PATCH 053/159] ISSUE-204: use an available alias --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 5afe46bae..6a5f956ed 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -43,7 +43,7 @@ runs: # debug site aliases drainpipe_exec "./vendor/bin/drush site:alias" - drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabot8.dev" + drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" shell: bash - name: Push to Acquia From 6131840baea5c38bc278df27ef3cc175a516301d Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 26 Nov 2024 14:17:47 -0500 Subject: [PATCH 054/159] ISSUE-204: restore workflows --- .github/workflows/DrainpipeDev.yml | 79 ++++ .github/workflows/DrainpipeDevClean.yml | 42 ++ .github/workflows/TestBinaryInstaller.yml | 93 +++++ .github/workflows/TestComposerLockDiff.yml | 86 +++++ .github/workflows/TestDDEV.yml | 66 ++++ .github/workflows/TestEnv.yml | 77 ++++ .github/workflows/TestFunctional.yml | 408 ++++++++++++++++++++ .github/workflows/TestGitHubActions.yml | 110 ++++++ .github/workflows/TestMetapackages.yml | 360 +++++++++++++++++ .github/workflows/TestPHPUnit.yml | 225 +++++++++++ .github/workflows/TestStatic.yml | 105 +++++ .github/workflows/TestTugboat.yml | 140 +++++++ .github/workflows/ValidateTaskfile.yml | 23 ++ .github/workflows/composer-plugin.yml | 40 ++ .github/workflows/test-production-build.yml | 63 +++ 15 files changed, 1917 insertions(+) create mode 100644 .github/workflows/DrainpipeDev.yml create mode 100644 .github/workflows/DrainpipeDevClean.yml create mode 100644 .github/workflows/TestBinaryInstaller.yml create mode 100644 .github/workflows/TestComposerLockDiff.yml create mode 100644 .github/workflows/TestDDEV.yml create mode 100644 .github/workflows/TestEnv.yml create mode 100644 .github/workflows/TestFunctional.yml create mode 100644 .github/workflows/TestGitHubActions.yml create mode 100644 .github/workflows/TestMetapackages.yml create mode 100644 .github/workflows/TestPHPUnit.yml create mode 100644 .github/workflows/TestStatic.yml create mode 100644 .github/workflows/TestTugboat.yml create mode 100644 .github/workflows/ValidateTaskfile.yml create mode 100644 .github/workflows/composer-plugin.yml create mode 100644 .github/workflows/test-production-build.yml diff --git a/.github/workflows/DrainpipeDev.yml b/.github/workflows/DrainpipeDev.yml new file mode 100644 index 000000000..89941b8a9 --- /dev/null +++ b/.github/workflows/DrainpipeDev.yml @@ -0,0 +1,79 @@ +name: Push Drainpipe Dev Package + +on: + push: + branches: + - '**' + tags: + - 'v*' + +concurrency: + group: drainpipe-dev + cancel-in-progress: false + +permissions: + contents: read + +jobs: + Drainpipe-Dev: + name: Push to drainpipe-dev + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - uses: ./scaffold/github/actions/common/setup-git + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup SSH + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }} + log-public-key: false + + - name: Create git checkout of drainpipe-dev + working-directory: drainpipe-dev + run: | + git init + git branch -m ${{ github.ref_name }} + git remote add origin git@github.com:Lullabot/drainpipe-dev.git + git fetch origin + + - name: Commit changes (Tag) + if: ${{ startsWith(github.ref, 'refs/tags/') }} + working-directory: drainpipe-dev + run: | + git reset --mixed origin/main + git add -A + git commit -m "${{ github.ref_name }}" --allow-empty + + - name: Commit changes (Branch) + if: ${{ ! startsWith(github.ref, 'refs/tags/') }} + working-directory: drainpipe-dev + run: | + git reset --mixed origin/${{ github.ref_name }} || git reset --mixed origin/main + git add -A + git commit -m "${{ github.event.head_commit.message }}" --allow-empty + + - name: Tag release + if: ${{ startsWith(github.ref, 'refs/tags/') }} + working-directory: drainpipe-dev + run: | + git tag ${{ github.ref_name }} + + - name: Push to drainpipe-dev + working-directory: drainpipe-dev + run: | + git push origin ${{ github.ref_name }} + + - name: Create release + if: ${{ startsWith(github.ref, 'refs/tags/') }} + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.DRAINPIPE_DEV_RELEASE_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/lullabot/drainpipe-dev/releases \ + -d '{"tag_name":"${{ github.ref_name }}","name":"${{ github.ref_name }}","body":"See https://github.com/Lullabot/drainpipe/releases/tag/${{ github.ref_name }}","draft":false,"prerelease":false,"generate_release_notes":false}' diff --git a/.github/workflows/DrainpipeDevClean.yml b/.github/workflows/DrainpipeDevClean.yml new file mode 100644 index 000000000..6cc5d1d9f --- /dev/null +++ b/.github/workflows/DrainpipeDevClean.yml @@ -0,0 +1,42 @@ +name: Clean Drainpipe Dev Package + +on: delete + +concurrency: + group: drainpipe-dev + cancel-in-progress: false + +permissions: + contents: read + +jobs: + Drainpipe-Dev-Clean: + name: Push branch to drainpipe-dev + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - uses: ./scaffold/github/actions/common/setup-git + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup SSH + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }} + log-public-key: false + + - name: Create git checkout of drainpipe-dev + working-directory: drainpipe-dev + run: | + git init + git branch -m ${{ github.event.ref }} + git remote add origin git@github.com:Lullabot/drainpipe-dev.git + git fetch origin + git reset --mixed origin/${{ github.event.ref }} + + - name: Delete ref from drainpipe-dev + working-directory: drainpipe-dev + run: | + git push origin --delete ${{ github.event.ref }} diff --git a/.github/workflows/TestBinaryInstaller.yml b/.github/workflows/TestBinaryInstaller.yml new file mode 100644 index 000000000..e90d6fb0b --- /dev/null +++ b/.github/workflows/TestBinaryInstaller.yml @@ -0,0 +1,93 @@ +name: Test Binary Installer +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Test-Binary-Installer: + runs-on: ubuntu-24.04 + strategy: + matrix: + php-version: [ 8.1, 8.2, 8.3 ] + include: + - php-version: 8.1 + drupal-version: ":^10" + - php-version: 8.2 + drupal-version: ":^10" + steps: + + - name: Create a Drupal project + run: composer create-project drupal/recommended-project${{ matrix.drupal-version }} . --ignore-platform-reqs + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - name: Setup drainpipe-dev + run: mv drainpipe/drainpipe-dev . + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + composer-cache-dir: composer-cache + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup Project + run: | + ddev config --auto + ddev config --php-version ${{ matrix.php-version }} + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies + ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies + + - name: Simulate failure + run: | + ddev exec touch /var/www/html/composer-cache/files/lullabot/drainpipe/bin/task/3.38.0/task_linux_amd64.tar + ddev composer install + + - name: Test installing without composer cache + run: | + ddev composer install --no-cache + test -x vendor/bin/task + ddev composer install + test -x vendor/bin/task + rm -rf vendor + ddev composer install + test -x vendor/bin/task + rm -rf vendor + ddev composer install --no-cache + test -x vendor/bin/task + + - name: Prove we can upgrade task within task + run: | + cp -a drainpipe/tests/fixtures/drainpipe-task-upgrade . + cp -a drainpipe drainpipe-task-upgrade + cd drainpipe-task-upgrade + ddev start + ddev composer install + ddev task drupal:composer:development + cp composer-upgraded.json composer.json + cp composer-upgraded.lock composer.lock + # Composer won't run updated plugin code until after its been + # installed. Once we have two new releases after 3.11.0, that upgrade + # task, we can remove this double call. + ddev task drupal:composer:development || ddev task drupal:composer:development diff --git a/.github/workflows/TestComposerLockDiff.yml b/.github/workflows/TestComposerLockDiff.yml new file mode 100644 index 000000000..00fe14cc1 --- /dev/null +++ b/.github/workflows/TestComposerLockDiff.yml @@ -0,0 +1,86 @@ +name: "Test Composer Lock Diff" + +on: + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Test-Composer-Lock-Diff: + runs-on: ubuntu-24.04 + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - name: Create a Drupal project + run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} + + - name: Setup Project + run: | + ddev config --auto + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev composer require lullabot/drainpipe --with-all-dependencies + + - name: Commit current state + run: | + echo "/drainpipe" >> .gitignore + git config --global user.email "no-reply@example.com" + git config --global user.name "Drainpipe Bot" + git init + git add . + git commit -m "Initial commit" + + - name: Install Composer Lock Diff + run : ddev composer global require davidrjonas/composer-lock-diff:^1.0 + + - name: Add a new package + run: ddev composer require sebastian/version:4.0.1 + + - name: Run Composer Lock Diff on a Renovate PR + run: | + ddev task "github:composer-lock-diff pull_request='drainpipe/tests/fixtures/composer-lock-diff/github/renovate.json' json_file='renovate-processed.json'" + if [ "$(cat renovate-processed.json)" != "$(cat drainpipe/tests/fixtures/composer-lock-diff/github/renovate-after.json)" ]; then + echo "Expected description not produced" + exit 1 + fi + + - name: Run Composer Lock Diff on a PR Template + run: | + ddev task "github:composer-lock-diff pull_request='drainpipe/tests/fixtures/composer-lock-diff/github/pr-template.json' json_file='pr-template-processed.json'" + if [ "$(cat pr-template-processed.json)" != "$(cat drainpipe/tests/fixtures/composer-lock-diff/github/pr-template-after.json)" ]; then + echo "Expected description not produced" + exit 1 + fi + + - name: Upload artifact + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: processed-descriptions-${{ matrix.drupal-version }} + path: | + renovate-processed.json + pr-template-processed.json diff --git a/.github/workflows/TestDDEV.yml b/.github/workflows/TestDDEV.yml new file mode 100644 index 000000000..feb301d26 --- /dev/null +++ b/.github/workflows/TestDDEV.yml @@ -0,0 +1,66 @@ +name: Test DDEV Integration +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Test-DDEV-Install: + runs-on: ubuntu-24.04 + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - name: Create a Drupal project + run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - name: Setup drainpipe-dev + run: mv drainpipe/drainpipe-dev . + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup Project + run: | + ddev config --auto + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies + ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies + + - name: Reset Project + run: | + ddev stop --remove-data --omit-snapshot + rm -rf web/core vendor/ web/sites/default/settings.ddev.php + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Test DDEV Settings Generated + run: test -f web/sites/default/settings.ddev.php diff --git a/.github/workflows/TestEnv.yml b/.github/workflows/TestEnv.yml new file mode 100644 index 000000000..6650780c6 --- /dev/null +++ b/.github/workflows/TestEnv.yml @@ -0,0 +1,77 @@ +name: "Test Environment Variables" + +on: + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Test-Env: + runs-on: ubuntu-24.04 + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - name: Create a Drupal project + run: | + composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup Project + run: | + ddev config --auto + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config repositories.drainpipe --json "{\"type\": \"path\", \"url\": \"drainpipe\", \"options\": {\"symlink\": false}}" + ddev exec --raw composer config minimum-stability dev + cat composer.json | jq --indent 4 '."autoload-dev" = {"files": ["vendor/lullabot/drainpipe/scaffold/env/dotenv.php"]}' | tee composer.json > /dev/null + ddev composer update --lock + ddev composer validate + ddev composer require lullabot/drainpipe --with-all-dependencies + cp drainpipe/tests/fixtures/env/Taskfile.yml Taskfile.yml + + - name: Check files are created + run: | + test -f .env + test -f .env.defaults + + - name: Check gitignore contains .env + run: grep -q '.env' .gitignore + + - name: Test .env.defaults + run: | + echo "FOO=bar" >> .env.defaults + ddev task bar + # Not sure why Drupal needs restarting for this to work + ddev restart + DRUPAL_FOO_DEFAULT=$(ddev drush php:eval "print getenv('FOO')") + echo "FOO=$DRUPAL_FOO_DEFAULT" + if [ "$DRUPAL_FOO_DEFAULT" != "bar" ]; then exit 1; fi + + - name: Test overriding with .env + run: | + echo "FOO=baz" >> .env + ddev task baz + # Not sure why Drupal needs restarting for this to work + ddev restart + DRUPAL_FOO=$(ddev drush php:eval "print getenv('FOO')") + echo "FOO=$DRUPAL_FOO" + if [ "$DRUPAL_FOO" != "baz" ]; then exit 1; fi diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml new file mode 100644 index 000000000..d9fed9e26 --- /dev/null +++ b/.github/workflows/TestFunctional.yml @@ -0,0 +1,408 @@ +name: Test Functional Tests +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Build: + runs-on: ubuntu-24.04 + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - name: Create a Drupal project + run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - name: Setup drainpipe-dev + run: mv drainpipe/drainpipe-dev . + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup Project + run: | + ddev config --auto + ddev config --nodejs-version "22" + ddev config --corepack-enable + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies + ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies + git config --global user.email "no-reply@example.com" + git config --global user.name "Drainpipe Bot" + git init + echo "/drainpipe" >> .gitignore + echo "/drainpipe-dev" >> .gitignore + echo ".ddev/config.yaml" >> .gitignore + echo ".ddev/docker-compose.selenium.yaml" >> .gitignore + echo ".yarnrc.yml" >> .gitignore + echo "package.json" >> .gitignore + echo "yarn.lock" >> .gitignore + echo "package-lock.json" >> .gitignore + echo "README.md" >> .gitignore + git add . + git commit -m "Initial commit" + + - name: Setup Nightwatch + run: | + echo "hooks:" >> .ddev/config.yaml + echo " post-start:" >> .ddev/config.yaml + echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS firefox; GRANT ALL ON firefox.* TO 'db'@'%';\"" >> .ddev/config.yaml + echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS chrome; GRANT ALL ON chrome.* TO 'db'@'%';\"" >> .ddev/config.yaml + ddev config --web-environment="NIGHTWATCH_DRUPAL_URL_FIREFOX=https://drupal_firefox,NIGHTWATCH_DRUPAL_URL_CHROME=https://drupal_chrome" + ddev config --additional-hostnames="*.drainpipe" + + - name: Run the site installer + run: | + ddev drush --yes site:install minimal + ddev drush config:export --yes + + - name: Create Artifact + run: zip -r /tmp/drainpipe.zip ./ + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: test-functional-build-${{ matrix.drupal-version }} + path: /tmp/drainpipe.zip + + Test-NPM: + runs-on: ubuntu-24.04 + needs: Build + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - uses: actions/download-artifact@v4 + with: + name: test-functional-build-${{ matrix.drupal-version }} + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev npm init -y + ddev npm install nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --save-dev + + - name: Install Drupal + run: | + ddev task test:siteinstall:all + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: test_result-npm-${{ matrix.drupal-version }} + path: test_result + + Test-Yarn-Classic: + runs-on: ubuntu-24.04 + needs: Build + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - uses: actions/download-artifact@v4 + with: + name: test-functional-build-${{ matrix.drupal-version }} + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev exec corepack disable + ddev exec npm i -g yarn@1.22.1 + ddev exec 'ln -s $(npm root -g)/yarn/bin/yarn /usr/local/bin/yarn' + ddev yarn init -y + ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --dev + + - name: Install Drupal + run: | + ddev task test:siteinstall:all + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: test_result-yarn-classic-${{ matrix.drupal-version }} + path: test_result + + Test-Yarn-3-Node-Linker: + runs-on: ubuntu-24.04 + needs: Build + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - uses: actions/download-artifact@v4 + with: + name: test-functional-build-${{ matrix.drupal-version }} + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev yarn set version berry + ddev yarn set version 3 + ddev yarn init -y + ddev yarn config set nodeLinker node-modules + ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --dev + + - name: Install Drupal + run: | + ddev task test:siteinstall:all + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: test_result-yarn3-nl-${{ matrix.drupal-version }} + path: test_result + + Test-Yarn-4-Node-Linker: + runs-on: ubuntu-24.04 + needs: Build + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - uses: actions/download-artifact@v4 + with: + name: test-functional-build-${{ matrix.drupal-version }} + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev restart + ddev yarn set version berry + ddev yarn set version 4 + ddev yarn init -y + ddev yarn config set nodeLinker node-modules + ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --dev + + - name: Install Drupal + run: | + ddev task test:siteinstall:all + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: test_result-yarn4-nl-${{ matrix.drupal-version }} + path: test_result + + Test-Yarn-3: + runs-on: ubuntu-24.04 + needs: Build + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - uses: actions/download-artifact@v4 + with: + name: test-functional-build-${{ matrix.drupal-version }} + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev yarn set version berry + ddev yarn set version 3 + ddev yarn init -y + echo "packageExtensions:" >> .yarnrc.yml + echo ' "nightwatch@*":' >> .yarnrc.yml + echo ' dependencies:' >> .yarnrc.yml + echo ' ws: "*"' >> .yarnrc.yml + echo ' "@nightwatch/vrt@*":' >> .yarnrc.yml + echo ' dependencies:' >> .yarnrc.yml + echo ' open: "^8"' >> .yarnrc.yml + ddev yarn add nightwatch nightwatch-axe-verbose @nightwatch/vrt @lullabot/nightwatch-drupal-commands --dev + + - name: Install Drupal + run: | + ddev task test:siteinstall:all + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: test_result-yarn3-${{ matrix.drupal-version }} + path: test_result + + Test-Yarn-4: + runs-on: ubuntu-24.04 + needs: Build + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - uses: actions/download-artifact@v4 + with: + name: test-functional-build-${{ matrix.drupal-version }} + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev restart + ddev yarn set version berry + ddev yarn init -y + echo "packageExtensions:" >> .yarnrc.yml + echo ' "nightwatch@*":' >> .yarnrc.yml + echo ' dependencies:' >> .yarnrc.yml + echo ' ws: "*"' >> .yarnrc.yml + echo ' "@nightwatch/vrt@*":' >> .yarnrc.yml + echo ' dependencies:' >> .yarnrc.yml + echo ' open: "^8"' >> .yarnrc.yml + ddev yarn cache clear + ddev yarn add nightwatch nightwatch-axe-verbose @nightwatch/vrt @nightwatch/vrt @lullabot/nightwatch-drupal-commands --dev + + - name: Install Drupal + run: | + ddev task test:siteinstall:all + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: test_result-yarn4-${{ matrix.drupal-version }} + path: test_result diff --git a/.github/workflows/TestGitHubActions.yml b/.github/workflows/TestGitHubActions.yml new file mode 100644 index 000000000..2085ac6d0 --- /dev/null +++ b/.github/workflows/TestGitHubActions.yml @@ -0,0 +1,110 @@ +name: "Test GitHub Actions" + +on: + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Test-GitHub-Actions: + runs-on: ubuntu-24.04 + steps: + - name: Create a Drupal project + run: composer create-project drupal/recommended-project . --ignore-platform-reqs + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} + + - name: Setup Project + run: | + ddev config --auto + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe/drainpipe-dev", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev composer require lullabot/drainpipe --with-all-dependencies + ddev composer require --dev lullabot/drainpipe-dev --with-all-dependencies + + - name: Install Drupal + run: | + ddev drush site:install minimal -y + echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php + ddev drush config:export -y + + - name: Lint GitHub Actions and Workflows + run: ddev task "github:actions:lint directories='./drainpipe/scaffold/github/actions ./drainpipe/scaffold/github/workflows'" + + - name: Run Database Updates + run: ddev task update + + - name: Create pantheon.yml + run: | + echo "api_version: 1" >> pantheon.yml + echo "web_docroot: true" >> pantheon.yml + echo "php_version: 8.3" >> pantheon.yml + echo "database:" >> pantheon.yml + echo " version: 10.6" >> pantheon.yml + echo "enforce_https: full+subdomains" >> pantheon.yml + echo "build_step: false" >> pantheon.yml + + - name: Create .drainpipeignore + run: | + echo "/web/sites/default/files" >> .drainpipeignore + echo "/.ddev" >> .drainpipeignore + echo "settings.ddev.php" >> .drainpipeignore + echo "/drainpipe" >> .drainpipeignore + + - name: Create settings.php + run: | + echo ' web/sites/default/settings.php + echo "\$settings['container_yamls'][] = __DIR__ . '/services.yml';" >> web/sites/default/settings.php + echo "include __DIR__ . \"/settings.pantheon.php\";" >> web/sites/default/settings.php + echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php + curl -o web/sites/default/settings.pantheon.php https://raw.githubusercontent.com/pantheon-systems/drupal-integrations/11.x/assets/settings.pantheon.php + + - name: Snapshot Project + env: + directory: /tmp/release + remote: + message: + site: + run: | + echo "/drainpipe" >> .drainpipeignore + ddev task snapshot:directory directory=/tmp/release + + - name: Prepare Actions + run: | + mkdir -p .github/actions + cp -R ./drainpipe/scaffold/github/actions/common .github/actions/drainpipe + + - name: Deploy Pantheon Review App + uses: ./drainpipe/scaffold/github/actions/pantheon/review + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + terminus-token: ${{ secrets.PANTHEON_TERMINUS_TOKEN }} + commit-message: ${{ github.sha }} + site-name: ${{ vars.PANTHEON_SITE_NAME || secrets.PANTHEON_SITE_NAME }} + lock-username: ${{ secrets.PANTHEON_REVIEW_USERNAME }} + lock-password: ${{ secrets.PANTHEON_REVIEW_PASSWORD }} + # set to "true" if you want to run the installer + run-installer: ${{ secrets.PANTHEON_REVIEW_RUN_INSTALLER }} diff --git a/.github/workflows/TestMetapackages.yml b/.github/workflows/TestMetapackages.yml new file mode 100644 index 000000000..f4ce934de --- /dev/null +++ b/.github/workflows/TestMetapackages.yml @@ -0,0 +1,360 @@ +name: Test Sass and JavaScript Compilation +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Build: + runs-on: ubuntu-24.04 + steps: + - name: Create a Drupal project + run: composer create-project drupal/recommended-project . --ignore-platform-reqs + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - name: Setup drainpipe-dev + run: mv drainpipe/drainpipe-dev . + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup Project + run: | + ddev config --auto + ddev config --nodejs-version "22" + ddev config --corepack-enable + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies + ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies + + - name: Setup Test Files + run: | + cp drainpipe/tests/fixtures/metapackages/Taskfile.yml . + cp drainpipe/tests/fixtures/metapackages/style.scss . + cp -R drainpipe/tests/fixtures/metapackages/js . + + - name: Create Artifact + run: zip -r /tmp/drainpipe.zip ./ + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: test-metapackage-build + path: /tmp/drainpipe.zip + + Test-Sass-NPM: + runs-on: ubuntu-24.04 + needs: Build + steps: + - uses: actions/download-artifact@v4 + with: + name: test-metapackage-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Sass + run: | + ddev npm init -y + ddev npm install drainpipe/metapackages/sass --save-dev + + - name: Compile Sass + run: ddev task sass + + Test-Sass-Yarn-Classic: + runs-on: ubuntu-24.04 + needs: Build + steps: + - uses: actions/download-artifact@v4 + with: + name: test-metapackage-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Sass + run: | + ddev exec corepack disable + ddev exec npm i -g yarn@1.22.1 + ddev exec 'ln -s $(npm root -g)/yarn/bin/yarn /usr/local/bin/yarn' + ddev exec yarn init -y + ddev exec yarn add file:./drainpipe/metapackages/sass --dev + + - name: Compile Sass + run: ddev task sass + + Test-Sass-Yarn-3: + runs-on: ubuntu-24.04 + needs: Build + steps: + - uses: actions/download-artifact@v4 + with: + name: test-metapackage-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Sass + run: | + ddev yarn set version berry + ddev yarn set version 3 + ddev yarn init -y + ddev yarn add ./drainpipe/metapackages/sass --dev + + - name: Compile Sass + run: ddev task sass + + Test-Sass-Yarn-4: + runs-on: ubuntu-24.04 + needs: Build + steps: + - uses: actions/download-artifact@v4 + with: + name: test-metapackage-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Sass + run: | + ddev restart + ddev yarn set version berry + ddev yarn set version 4 + ddev yarn init -y + ddev yarn cache clear + ddev yarn add ./drainpipe/metapackages/sass --dev + + - name: Compile Sass + run: ddev task sass + + Test-JavaScript-NPM: + runs-on: ubuntu-24.04 + needs: Build + steps: + - uses: actions/download-artifact@v4 + with: + name: test-metapackage-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Sass + run: | + ddev npm init -y + ddev npm install focus-trap@^6.7.3 + ddev npm install drainpipe/metapackages/javascript --save-dev + + - name: Compile JavaScript + run: ddev task javascript + + Test-JavaScript-Yarn-Classic: + runs-on: ubuntu-24.04 + needs: Build + steps: + - uses: actions/download-artifact@v4 + with: + name: test-metapackage-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Sass + run: | + ddev exec corepack disable + ddev exec npm i -g yarn@1.22.1 + ddev exec 'ln -s $(npm root -g)/yarn/bin/yarn /usr/local/bin/yarn' + ddev exec yarn init -y + ddev exec yarn add focus-trap@^6.7.3 + ddev exec yarn add file:./drainpipe/metapackages/javascript --dev + + - name: Compile JavaScript + run: ddev task javascript + + Test-JavaScript-Yarn-3: + runs-on: ubuntu-24.04 + needs: Build + steps: + - uses: actions/download-artifact@v4 + with: + name: test-metapackage-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Sass + run: | + ddev yarn set version berry + ddev yarn set version 3 + ddev yarn init -y + ddev yarn add focus-trap@^6.7.3 + ddev yarn add ./drainpipe/metapackages/javascript --dev + + - name: Compile JavaScript + run: ddev task javascript + + Test-JavaScript-Yarn-4: + runs-on: ubuntu-24.04 + needs: Build + steps: + - uses: actions/download-artifact@v4 + with: + name: test-metapackage-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Sass + run: | + ddev restart + ddev yarn set version berry + ddev yarn set version 4 + ddev yarn init -y + ddev yarn cache clear + ddev yarn add focus-trap@^6.7.3 + ddev yarn add ./drainpipe/metapackages/javascript --dev + + - name: Compile JavaScript + run: ddev task javascript diff --git a/.github/workflows/TestPHPUnit.yml b/.github/workflows/TestPHPUnit.yml new file mode 100644 index 000000000..5546ba6f9 --- /dev/null +++ b/.github/workflows/TestPHPUnit.yml @@ -0,0 +1,225 @@ +name: Test PHPUnit Integration +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Test-PHPUnit-Functional: + runs-on: ubuntu-24.04 + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - name: Install xmllint + run: sudo apt-get update && sudo apt-get install -y libxml2-utils + + - name: Create a Drupal project + run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - name: Setup drainpipe-dev + run: mv drainpipe/drainpipe-dev . + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup Project + run: | + ddev config --auto + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies + ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies + # Restart is required to enable the provided Selenium containers + ddev restart + + - name: Add Custom Testing Module + run: | + mkdir web/modules/custom + cp -R drainpipe/tests/fixtures/phpunit/testmodule web/modules/custom/ + cp drainpipe/tests/fixtures/phpunit/Taskfile.yml . + + - name: Run PHPUnit Functional Tests + run: | + ddev drush site:install -y + ddev drush user:password admin password + ddev task test:phpunit:functional format=junit + docker logs ddev-drainpipe-chrome | tee test_result/ddev-chrome.log + docker logs ddev-drainpipe-firefox | tee test_result/ddev-firefox.log + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: test_result-phpunit-functional-${{ matrix.drupal-version }} + path: test_result + + - name: Confirm All PHPUnit Functional Tests were run + uses: GuillaumeFalourd/assert-command-line-output@v2.4 + with: + command_line: xmllint --xpath 'string(//testsuites/testsuite/@tests)' test_result/phpunit-functional.xml + contains: 6 + expected_result: PASSED + + Test-PHPUnit-Functional-DTT: + runs-on: ubuntu-24.04 + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - name: Install xmllint + run: sudo apt-get update && sudo apt-get install -y libxml2-utils + + - name: Create a Drupal project + run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - name: Setup drainpipe-dev + run: mv drainpipe/drainpipe-dev . + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup Project + run: | + ddev config --auto + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe", "weitzman/drupal-test-traits"]' + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true + ddev exec --raw composer config --no-plugins allow-plugins.weitzman/drupal-test-traits true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies + ddev composer require "lullabot/drainpipe-dev @dev" weitzman/drupal-test-traits lullabot/mink-selenium2-driver --dev --with-all-dependencies + # Restart is required to enable the provided Selenium containers + ddev restart + + - name: Add Custom Testing Module + run: | + mkdir web/modules/custom + cp -R drainpipe/tests/fixtures/phpunit/testmodule web/modules/custom/ + cp drainpipe/tests/fixtures/phpunit/Taskfile-testtraits.yml Taskfile.yml + + - name: Run PHPUnit Functional Tests + run: | + ddev drush site:install -y + ddev drush user:password admin password + ddev task test:phpunit:functional format=junit + docker logs ddev-drainpipe-chrome | tee test_result/ddev-chrome.log + docker logs ddev-drainpipe-firefox | tee test_result/ddev-firefox.log + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: test_result-phpunit-dtt-${{ matrix.drupal-version }} + path: test_result + + - name: Confirm All PHPUnit Functional Tests were run + uses: GuillaumeFalourd/assert-command-line-output@v2 + with: + command_line: xmllint --xpath 'string(//testsuites/testsuite/@tests)' test_result/phpunit-functional.xml + contains: 9 + expected_result: PASSED + + Test-PHPUnit-Static: + runs-on: ubuntu-24.04 + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - name: Install xmllint + run: sudo apt-get update && sudo apt-get install -y libxml2-utils + + - name: Create a Drupal project + run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - name: Setup drainpipe-dev + run: mv drainpipe/drainpipe-dev . + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup Project + run: | + ddev config --auto + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies + ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies + # Restart is required to enable the provided Selenium containers + ddev restart + + - name: Add Custom Testing Module + run: | + mkdir web/modules/custom + cp -R drainpipe/tests/fixtures/phpunit/testmodule web/modules/custom/ + cp drainpipe/tests/fixtures/phpunit/Taskfile.yml . + + - name: Run PHPUnit Tests + run: ddev task test:phpunit:static format=junit + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: test_result-phpunit-static-${{ matrix.drupal-version }} + path: test_result + + - name: Confirm All PHPUnit Functional Tests were run + uses: GuillaumeFalourd/assert-command-line-output@v2 + with: + command_line: xmllint --xpath 'string(//testsuites/testsuite/@tests)' test_result/phpunit.xml + contains: 12 + expected_result: PASSED diff --git a/.github/workflows/TestStatic.yml b/.github/workflows/TestStatic.yml new file mode 100644 index 000000000..1ece49bb4 --- /dev/null +++ b/.github/workflows/TestStatic.yml @@ -0,0 +1,105 @@ +name: Test Static Tests +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Test-Static: + runs-on: ubuntu-24.04 + strategy: + matrix: + drupal-version: [ 10, 11 ] + steps: + - name: Create a Drupal project + run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - name: Setup drainpipe-dev + run: mv drainpipe/drainpipe-dev . + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup Project + run: | + ddev config --auto + ddev start + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies + ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies + # Restart is required to enable the provided Selenium containers + ddev restart + + - name: Verify files were created + run: | + test -f phpcs.xml.dist + test -f phpstan.neon.dist + + - name: Create a git repository + run: | + git config --global user.email "no-reply@example.com" + git config --global user.name "Drainpipe Bot" + git init + echo "/drainpipe" >> .gitignore + echo "/drainpipe-dev" >> .gitignore + git add . + git commit -m "Initial commit" + + - name: Fix settings.php + run: | + sed -i '/^.*container_yamls.*$/i /** @phpstan-ignore-next-line */' web/sites/default/settings.php + + - name: Test for untracked and modified files + id: test_untracked + continue-on-error: true + run: ddev task test:untracked + + - name: Test for untracked and modified files + run: | + if [ "${{ steps.test_untracked.outcome }}" != "failure" ]; then + exit 1 + fi + git add . + git commit -m "Second commit" + ddev task test:untracked + + - name: Run Static Tests + run: ddev task test:static + + - name: Confirm custom directories are scanned + run: | + set -x + mkdir -p custom-yaml-directory + echo 'key: value' >> custom-yaml-directory/test.yml + ddev task test:static YAML_DIRS="custom-yaml-directory/*.yml" | tee static.log + [[ $(grep '\[OK] All 1 YAML files contain valid syntax.' static.log | wc -l) -eq 1 ]] + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: test_result-static + path: test_result diff --git a/.github/workflows/TestTugboat.yml b/.github/workflows/TestTugboat.yml new file mode 100644 index 000000000..f65ce60f1 --- /dev/null +++ b/.github/workflows/TestTugboat.yml @@ -0,0 +1,140 @@ +name: "Test Tugboat" + +on: + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Test-Tugboat: + runs-on: ubuntu-24.04 + steps: + - name: Create a Drupal project + run: composer create-project drupal/recommended-project . --ignore-platform-reqs + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + # Lock in versions so tests know what to expect. + # Redis tag v1.2.0 == 6-bullseye + # Elasticsearch tag v0.3.2 == 7.17.14 + - name: Setup Project + run: | + ddev config --auto + ddev config --php-version "8.3" + ddev config --nodejs-version "18" + ddev get ddev/ddev-redis --version v1.2.0 + ddev get ddev/ddev-elasticsearch --version v0.3.2 + ddev restart + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev exec --raw composer config extra.drainpipe --json '{"tugboat": {}}' + mkdir -p .tugboat + echo "php:" > .tugboat/config.drainpipe-override.yml + echo " aliases:" >> .tugboat/config.drainpipe-override.yml + echo " - foo" >> .tugboat/config.drainpipe-override.yml + echo " urls:" >> .tugboat/config.drainpipe-override.yml + echo " - /" >> .tugboat/config.drainpipe-override.yml + echo " - /?v=1" >> .tugboat/config.drainpipe-override.yml + echo " screenshot:" >> .tugboat/config.drainpipe-override.yml + echo " timeout: 45" >> .tugboat/config.drainpipe-override.yml + echo " visualdiff:" >> .tugboat/config.drainpipe-override.yml + echo " fullPage: false" >> .tugboat/config.drainpipe-override.yml + ddev composer require lullabot/drainpipe --with-all-dependencies + + - name: Add an online step + run: | + echo " online:tugboat:" >> Taskfile.yml + echo " cmds:" >> Taskfile.yml + echo " - echo \"Tugboat online\"" >> Taskfile.yml + ddev composer install + + # Compare the generated files to the ones used to build this repository + # preview - they should be the same. + - name: Test Generated Files + run: | + diff -up drainpipe/.tugboat/config.yml .tugboat/config.yml + sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/1-init.sh + sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/2-update.sh + sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/3-build.sh + sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/4-online.sh + diff -up drainpipe/.tugboat/steps/1-init.sh .tugboat/steps/1-init.sh + diff -up drainpipe/.tugboat/steps/2-update.sh .tugboat/steps/2-update.sh + diff -up drainpipe/.tugboat/steps/3-build.sh .tugboat/steps/3-build.sh + diff -up drainpipe/.tugboat/steps/4-online.sh .tugboat/steps/4-online.sh + + - name: Add a build:tugboat step + run: | + echo " build:tugboat:" >> Taskfile.yml + echo " cmds:" >> Taskfile.yml + echo " - echo \"Tugboat build\"" >> Taskfile.yml + ddev composer install + if ! grep -q './vendor/bin/task build:tugboat' .tugboat/steps/3-build.sh; then + exit 1 + fi + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: .tugboat + path: .tugboat + + Test-Non-Default-Nodejs: + runs-on: ubuntu-24.04 + steps: + - name: Create a Drupal project + run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd + + - uses: actions/checkout@v4 + with: + path: drainpipe + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Setup Project + run: | + ddev config --auto + ddev config --php-version "8.3" + ddev config --nodejs-version "16" + ddev restart + ddev exec --raw composer config extra.drupal-scaffold.gitignore true + ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] + ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true + ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config minimum-stability dev + ddev exec --raw composer config extra.drainpipe --json '{"tugboat": {}}' + ddev composer require lullabot/drainpipe --with-all-dependencies + + - name: Test NODE_MAJOR is correct + run: | + cat .tugboat/steps/1-init.sh + grep -q NODE_MAJOR=16 .tugboat/steps/1-init.sh + diff --git a/.github/workflows/ValidateTaskfile.yml b/.github/workflows/ValidateTaskfile.yml new file mode 100644 index 000000000..29f206be4 --- /dev/null +++ b/.github/workflows/ValidateTaskfile.yml @@ -0,0 +1,23 @@ +name: Validate example Taskfile.yml +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + Validate-Example-Taskfile: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Validate Taskfile.yml + # Also update src/BinaryInstallPlugin.php if changing version + run: | + curl -O https://raw.githubusercontent.com/go-task/task/v3.38.0/website/static/schema.json + npx ajv-cli validate -s schema.json -d scaffold/Taskfile.yml diff --git a/.github/workflows/composer-plugin.yml b/.github/workflows/composer-plugin.yml new file mode 100644 index 000000000..3380fc624 --- /dev/null +++ b/.github/workflows/composer-plugin.yml @@ -0,0 +1,40 @@ +name: Composer Plugin +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Test-Composer-Plugin: + runs-on: ubuntu-24.04 + strategy: + matrix: + php-version: [ 8.1, 8.2, 8.3 ] + steps: + - uses: actions/checkout@v4 + + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v2 + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - run: composer install + + - run: ./vendor/bin/phpunit diff --git a/.github/workflows/test-production-build.yml b/.github/workflows/test-production-build.yml new file mode 100644 index 000000000..f8144364c --- /dev/null +++ b/.github/workflows/test-production-build.yml @@ -0,0 +1,63 @@ +name: Test Production Build +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Test-Production-Build: + runs-on: ubuntu-24.04 + strategy: + matrix: + php-version: [ 8.1, 8.2, 8.3 ] + include: + - php-version: 8.1 + drupal-version: ":^10" + - php-version: 8.2 + drupal-version: ":^10" + steps: + - uses: actions/checkout@v4 + + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v2 + extensions: gd + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + + - name: Install Drupal + run: | + cd ../ + composer create-project drupal/recommended-project${{ matrix.drupal-version }} drupal --ignore-platform-reqs + cd drupal + cp ${GITHUB_WORKSPACE}/tests/fixtures.drainpipe-test-build/Taskfile.yml . + composer config extra.drupal-scaffold.gitignore true + composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe"]' + composer config --no-plugins allow-plugins.composer/installers true + composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + composer config --no-plugins allow-plugins.lullabot/drainpipe true + composer config repositories.drainpipe --json '{"type": "path", "url": "../drainpipe", "options": {"symlink": false}}' + composer config minimum-stability dev + composer require "lullabot/drainpipe @dev" --with-all-dependencies + + - name: Run static tests + run: | + cd ../drupal + ./vendor/bin/task build From 1e250cf2924da21cb5ec688372014377bec11b81 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 9 Dec 2024 13:14:07 -0500 Subject: [PATCH 055/159] ISSUE-204: try to avoid Host key verification failed (next I will try to run that command inside DDEV) --- scaffold/github/actions/acquia/deploy/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 6a5f956ed..a7e7771ec 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -40,6 +40,8 @@ runs: APPLICATION=${ENVIRONMENT%.*} drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + ssh-keyscan -t rsa "${{ inputs.environment-url }}" >> ~/.ssh/known_hosts + # debug site aliases drainpipe_exec "./vendor/bin/drush site:alias" From a85d17c378d991765308f2cd6f01755e9633bac7 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 9 Dec 2024 13:24:27 -0500 Subject: [PATCH 056/159] ISSUE-204: try to avoid Host key verification failed, inside DDEV --- scaffold/github/actions/acquia/deploy/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index a7e7771ec..50e9e62b1 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -39,8 +39,7 @@ runs: ENVIRONMENT="${{ inputs.environment }}" APPLICATION=${ENVIRONMENT%.*} drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - - ssh-keyscan -t rsa "${{ inputs.environment-url }}" >> ~/.ssh/known_hosts + drainpipe_exec "ssh-keyscan -t rsa "${{ inputs.environment-url }}" >> ~/.ssh/known_hosts" # debug site aliases drainpipe_exec "./vendor/bin/drush site:alias" From f52104d8489adf4271fb6009e9c6b26f3b3f500e Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 10 Dec 2024 16:03:33 -0500 Subject: [PATCH 057/159] To trigger CI workflows From 73ae0a324635e7222afdfa79263103159e91257b Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 10 Dec 2024 16:16:02 -0500 Subject: [PATCH 058/159] ISSUE-204: remove the protocol --- scaffold/github/actions/acquia/deploy/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 50e9e62b1..61745537c 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -39,7 +39,9 @@ runs: ENVIRONMENT="${{ inputs.environment }}" APPLICATION=${ENVIRONMENT%.*} drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - drainpipe_exec "ssh-keyscan -t rsa "${{ inputs.environment-url }}" >> ~/.ssh/known_hosts" + hostname="${{ inputs.environment-url }}" + hostname="${hostname#*://}" + drainpipe_exec "ssh-keyscan -t rsa "$hostname" >> ~/.ssh/known_hosts" # debug site aliases drainpipe_exec "./vendor/bin/drush site:alias" From bc0924062b2edde898463ac2c543772547236136 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 10 Dec 2024 16:35:17 -0500 Subject: [PATCH 059/159] ISSUE-204: more time for connection, more options for key types --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 61745537c..05db13daf 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -41,7 +41,7 @@ runs: drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" hostname="${{ inputs.environment-url }}" hostname="${hostname#*://}" - drainpipe_exec "ssh-keyscan -t rsa "$hostname" >> ~/.ssh/known_hosts" + drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" # debug site aliases drainpipe_exec "./vendor/bin/drush site:alias" From a86826eef852e7348512f5e4b5c78786daceb815 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 10 Dec 2024 17:21:41 -0500 Subject: [PATCH 060/159] ISSUE-204: avoid checking the host when connecting to clone environements --- scaffold/github/actions/acquia/deploy/action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 05db13daf..670112283 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -41,7 +41,11 @@ runs: drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" hostname="${{ inputs.environment-url }}" hostname="${hostname#*://}" - drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" + + drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" + + + # drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" # debug site aliases drainpipe_exec "./vendor/bin/drush site:alias" From 8a0261aea0267cb01950e3a748799369042c0dcd Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 11:14:51 -0500 Subject: [PATCH 061/159] ISSUE-204: use stg instead of prod for clonning, and use d10 instead of d11 because the SQL server version not available for D11 (MySQL Server 8.) --- .github/workflows/TestAcquia.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index d940cfed5..4bebe8374 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd + run: composer create-project drupal/recommended-project:10.4.0 . --ignore-platform-req=ext-gd - uses: actions/checkout@v4 with: @@ -74,7 +74,7 @@ jobs: - name: Clone from production to dev uses: ./drainpipe/scaffold/github/actions/acquia/clone-env with: - source-environment: lullabotsandbox.prod + source-environment: lullabotsandbox.stg target-environment: lullabotsandbox.dev api-key: ${{ secrets.ACQUIA_API_KEY }} api-secret: ${{ secrets.ACQUIA_API_SECRET }} From 9f15eda552b7e9ca13cde7a2c0133d41841f1876 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 11:20:26 -0500 Subject: [PATCH 062/159] ISSUE-204: fix typo, test instead of stg --- .github/workflows/TestAcquia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 4bebe8374..590062263 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -74,7 +74,7 @@ jobs: - name: Clone from production to dev uses: ./drainpipe/scaffold/github/actions/acquia/clone-env with: - source-environment: lullabotsandbox.stg + source-environment: lullabotsandbox.test target-environment: lullabotsandbox.dev api-key: ${{ secrets.ACQUIA_API_KEY }} api-secret: ${{ secrets.ACQUIA_API_SECRET }} From d77c9bc0c559597736852d9b26fc7fea0db8cc23 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 12:04:39 -0500 Subject: [PATCH 063/159] ISSUE-204: debug --- .github/actions/drainpipe/common/set-env/bash_aliases | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/drainpipe/common/set-env/bash_aliases b/.github/actions/drainpipe/common/set-env/bash_aliases index 58fca27a8..6939410f4 100644 --- a/.github/actions/drainpipe/common/set-env/bash_aliases +++ b/.github/actions/drainpipe/common/set-env/bash_aliases @@ -1,7 +1,9 @@ drainpipe_exec() { if [ "$DRAINPIPE_DDEV" == "true" ]; then + echo "DDEV EXEC:" ddev exec "$@" else + echo "EVAL:" eval "$@" fi } From 346b291bdac7cbf4639752470a066aa96ef58c8b Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 12:22:47 -0500 Subject: [PATCH 064/159] ISSUE-204: use ddev if possible --- .github/actions/drainpipe/common/set-env/bash_aliases | 2 -- scaffold/github/actions/acquia/deploy/action.yml | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/drainpipe/common/set-env/bash_aliases b/.github/actions/drainpipe/common/set-env/bash_aliases index 6939410f4..58fca27a8 100644 --- a/.github/actions/drainpipe/common/set-env/bash_aliases +++ b/.github/actions/drainpipe/common/set-env/bash_aliases @@ -1,9 +1,7 @@ drainpipe_exec() { if [ "$DRAINPIPE_DDEV" == "true" ]; then - echo "DDEV EXEC:" ddev exec "$@" else - echo "EVAL:" eval "$@" fi } diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 670112283..6729321fd 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -44,12 +44,14 @@ runs: drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - # drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" # debug site aliases + ddev drush site:alias drainpipe_exec "./vendor/bin/drush site:alias" + ddev task drupal:maintenance:on site=@lullabotsandbox.dev + drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" shell: bash From ef53ece4a3cd0ecd4b1255c4e5fc237d9ed4f864 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 12:35:05 -0500 Subject: [PATCH 065/159] ISSUE-204: avoid spending minutes on different workflows [skip ci] --- .github/workflows/DrainpipeDev.yml | 79 ---- .github/workflows/DrainpipeDevClean.yml | 42 -- .github/workflows/TestBinaryInstaller.yml | 93 ----- .github/workflows/TestComposerLockDiff.yml | 86 ---- .github/workflows/TestDDEV.yml | 66 ---- .github/workflows/TestEnv.yml | 77 ---- .github/workflows/TestFunctional.yml | 409 -------------------- .github/workflows/TestGitHubActions.yml | 110 ------ .github/workflows/TestMetapackages.yml | 362 ----------------- .github/workflows/TestPHPUnit.yml | 225 ----------- .github/workflows/TestStatic.yml | 105 ----- .github/workflows/TestTugboat.yml | 140 ------- .github/workflows/ValidateTaskfile.yml | 23 -- .github/workflows/composer-plugin.yml | 40 -- .github/workflows/test-production-build.yml | 63 --- 15 files changed, 1920 deletions(-) delete mode 100644 .github/workflows/DrainpipeDev.yml delete mode 100644 .github/workflows/DrainpipeDevClean.yml delete mode 100644 .github/workflows/TestBinaryInstaller.yml delete mode 100644 .github/workflows/TestComposerLockDiff.yml delete mode 100644 .github/workflows/TestDDEV.yml delete mode 100644 .github/workflows/TestEnv.yml delete mode 100644 .github/workflows/TestFunctional.yml delete mode 100644 .github/workflows/TestGitHubActions.yml delete mode 100644 .github/workflows/TestMetapackages.yml delete mode 100644 .github/workflows/TestPHPUnit.yml delete mode 100644 .github/workflows/TestStatic.yml delete mode 100644 .github/workflows/TestTugboat.yml delete mode 100644 .github/workflows/ValidateTaskfile.yml delete mode 100644 .github/workflows/composer-plugin.yml delete mode 100644 .github/workflows/test-production-build.yml diff --git a/.github/workflows/DrainpipeDev.yml b/.github/workflows/DrainpipeDev.yml deleted file mode 100644 index 89941b8a9..000000000 --- a/.github/workflows/DrainpipeDev.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: Push Drainpipe Dev Package - -on: - push: - branches: - - '**' - tags: - - 'v*' - -concurrency: - group: drainpipe-dev - cancel-in-progress: false - -permissions: - contents: read - -jobs: - Drainpipe-Dev: - name: Push to drainpipe-dev - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - - uses: ./scaffold/github/actions/common/setup-git - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup SSH - uses: webfactory/ssh-agent@v0.9.0 - with: - ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }} - log-public-key: false - - - name: Create git checkout of drainpipe-dev - working-directory: drainpipe-dev - run: | - git init - git branch -m ${{ github.ref_name }} - git remote add origin git@github.com:Lullabot/drainpipe-dev.git - git fetch origin - - - name: Commit changes (Tag) - if: ${{ startsWith(github.ref, 'refs/tags/') }} - working-directory: drainpipe-dev - run: | - git reset --mixed origin/main - git add -A - git commit -m "${{ github.ref_name }}" --allow-empty - - - name: Commit changes (Branch) - if: ${{ ! startsWith(github.ref, 'refs/tags/') }} - working-directory: drainpipe-dev - run: | - git reset --mixed origin/${{ github.ref_name }} || git reset --mixed origin/main - git add -A - git commit -m "${{ github.event.head_commit.message }}" --allow-empty - - - name: Tag release - if: ${{ startsWith(github.ref, 'refs/tags/') }} - working-directory: drainpipe-dev - run: | - git tag ${{ github.ref_name }} - - - name: Push to drainpipe-dev - working-directory: drainpipe-dev - run: | - git push origin ${{ github.ref_name }} - - - name: Create release - if: ${{ startsWith(github.ref, 'refs/tags/') }} - run: | - curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.DRAINPIPE_DEV_RELEASE_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/lullabot/drainpipe-dev/releases \ - -d '{"tag_name":"${{ github.ref_name }}","name":"${{ github.ref_name }}","body":"See https://github.com/Lullabot/drainpipe/releases/tag/${{ github.ref_name }}","draft":false,"prerelease":false,"generate_release_notes":false}' diff --git a/.github/workflows/DrainpipeDevClean.yml b/.github/workflows/DrainpipeDevClean.yml deleted file mode 100644 index 6cc5d1d9f..000000000 --- a/.github/workflows/DrainpipeDevClean.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Clean Drainpipe Dev Package - -on: delete - -concurrency: - group: drainpipe-dev - cancel-in-progress: false - -permissions: - contents: read - -jobs: - Drainpipe-Dev-Clean: - name: Push branch to drainpipe-dev - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - - uses: ./scaffold/github/actions/common/setup-git - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup SSH - uses: webfactory/ssh-agent@v0.9.0 - with: - ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }} - log-public-key: false - - - name: Create git checkout of drainpipe-dev - working-directory: drainpipe-dev - run: | - git init - git branch -m ${{ github.event.ref }} - git remote add origin git@github.com:Lullabot/drainpipe-dev.git - git fetch origin - git reset --mixed origin/${{ github.event.ref }} - - - name: Delete ref from drainpipe-dev - working-directory: drainpipe-dev - run: | - git push origin --delete ${{ github.event.ref }} diff --git a/.github/workflows/TestBinaryInstaller.yml b/.github/workflows/TestBinaryInstaller.yml deleted file mode 100644 index e90d6fb0b..000000000 --- a/.github/workflows/TestBinaryInstaller.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: Test Binary Installer -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Binary-Installer: - runs-on: ubuntu-24.04 - strategy: - matrix: - php-version: [ 8.1, 8.2, 8.3 ] - include: - - php-version: 8.1 - drupal-version: ":^10" - - php-version: 8.2 - drupal-version: ":^10" - steps: - - - name: Create a Drupal project - run: composer create-project drupal/recommended-project${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - composer-cache-dir: composer-cache - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev config --php-version ${{ matrix.php-version }} - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - - - name: Simulate failure - run: | - ddev exec touch /var/www/html/composer-cache/files/lullabot/drainpipe/bin/task/3.38.0/task_linux_amd64.tar - ddev composer install - - - name: Test installing without composer cache - run: | - ddev composer install --no-cache - test -x vendor/bin/task - ddev composer install - test -x vendor/bin/task - rm -rf vendor - ddev composer install - test -x vendor/bin/task - rm -rf vendor - ddev composer install --no-cache - test -x vendor/bin/task - - - name: Prove we can upgrade task within task - run: | - cp -a drainpipe/tests/fixtures/drainpipe-task-upgrade . - cp -a drainpipe drainpipe-task-upgrade - cd drainpipe-task-upgrade - ddev start - ddev composer install - ddev task drupal:composer:development - cp composer-upgraded.json composer.json - cp composer-upgraded.lock composer.lock - # Composer won't run updated plugin code until after its been - # installed. Once we have two new releases after 3.11.0, that upgrade - # task, we can remove this double call. - ddev task drupal:composer:development || ddev task drupal:composer:development diff --git a/.github/workflows/TestComposerLockDiff.yml b/.github/workflows/TestComposerLockDiff.yml deleted file mode 100644 index 00fe14cc1..000000000 --- a/.github/workflows/TestComposerLockDiff.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: "Test Composer Lock Diff" - -on: - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Composer-Lock-Diff: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require lullabot/drainpipe --with-all-dependencies - - - name: Commit current state - run: | - echo "/drainpipe" >> .gitignore - git config --global user.email "no-reply@example.com" - git config --global user.name "Drainpipe Bot" - git init - git add . - git commit -m "Initial commit" - - - name: Install Composer Lock Diff - run : ddev composer global require davidrjonas/composer-lock-diff:^1.0 - - - name: Add a new package - run: ddev composer require sebastian/version:4.0.1 - - - name: Run Composer Lock Diff on a Renovate PR - run: | - ddev task "github:composer-lock-diff pull_request='drainpipe/tests/fixtures/composer-lock-diff/github/renovate.json' json_file='renovate-processed.json'" - if [ "$(cat renovate-processed.json)" != "$(cat drainpipe/tests/fixtures/composer-lock-diff/github/renovate-after.json)" ]; then - echo "Expected description not produced" - exit 1 - fi - - - name: Run Composer Lock Diff on a PR Template - run: | - ddev task "github:composer-lock-diff pull_request='drainpipe/tests/fixtures/composer-lock-diff/github/pr-template.json' json_file='pr-template-processed.json'" - if [ "$(cat pr-template-processed.json)" != "$(cat drainpipe/tests/fixtures/composer-lock-diff/github/pr-template-after.json)" ]; then - echo "Expected description not produced" - exit 1 - fi - - - name: Upload artifact - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: processed-descriptions-${{ matrix.drupal-version }} - path: | - renovate-processed.json - pr-template-processed.json diff --git a/.github/workflows/TestDDEV.yml b/.github/workflows/TestDDEV.yml deleted file mode 100644 index feb301d26..000000000 --- a/.github/workflows/TestDDEV.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Test DDEV Integration -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-DDEV-Install: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - - - name: Reset Project - run: | - ddev stop --remove-data --omit-snapshot - rm -rf web/core vendor/ web/sites/default/settings.ddev.php - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Test DDEV Settings Generated - run: test -f web/sites/default/settings.ddev.php diff --git a/.github/workflows/TestEnv.yml b/.github/workflows/TestEnv.yml deleted file mode 100644 index 6650780c6..000000000 --- a/.github/workflows/TestEnv.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: "Test Environment Variables" - -on: - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Env: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Create a Drupal project - run: | - composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config repositories.drainpipe --json "{\"type\": \"path\", \"url\": \"drainpipe\", \"options\": {\"symlink\": false}}" - ddev exec --raw composer config minimum-stability dev - cat composer.json | jq --indent 4 '."autoload-dev" = {"files": ["vendor/lullabot/drainpipe/scaffold/env/dotenv.php"]}' | tee composer.json > /dev/null - ddev composer update --lock - ddev composer validate - ddev composer require lullabot/drainpipe --with-all-dependencies - cp drainpipe/tests/fixtures/env/Taskfile.yml Taskfile.yml - - - name: Check files are created - run: | - test -f .env - test -f .env.defaults - - - name: Check gitignore contains .env - run: grep -q '.env' .gitignore - - - name: Test .env.defaults - run: | - echo "FOO=bar" >> .env.defaults - ddev task bar - # Not sure why Drupal needs restarting for this to work - ddev restart - DRUPAL_FOO_DEFAULT=$(ddev drush php:eval "print getenv('FOO')") - echo "FOO=$DRUPAL_FOO_DEFAULT" - if [ "$DRUPAL_FOO_DEFAULT" != "bar" ]; then exit 1; fi - - - name: Test overriding with .env - run: | - echo "FOO=baz" >> .env - ddev task baz - # Not sure why Drupal needs restarting for this to work - ddev restart - DRUPAL_FOO=$(ddev drush php:eval "print getenv('FOO')") - echo "FOO=$DRUPAL_FOO" - if [ "$DRUPAL_FOO" != "baz" ]; then exit 1; fi diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml deleted file mode 100644 index 170c93e01..000000000 --- a/.github/workflows/TestFunctional.yml +++ /dev/null @@ -1,409 +0,0 @@ -name: Test Functional Tests -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Build: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev config --nodejs-version "22" - ddev config --corepack-enable - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - git config --global user.email "no-reply@example.com" - git config --global user.name "Drainpipe Bot" - git init - echo "/drainpipe" >> .gitignore - echo "/drainpipe-dev" >> .gitignore - echo ".ddev/config.yaml" >> .gitignore - echo ".ddev/docker-compose.selenium.yaml" >> .gitignore - echo ".yarnrc.yml" >> .gitignore - echo "package.json" >> .gitignore - echo "yarn.lock" >> .gitignore - echo "package-lock.json" >> .gitignore - echo "README.md" >> .gitignore - git add . - git commit -m "Initial commit" - - - name: Setup Nightwatch - run: | - echo "hooks:" >> .ddev/config.yaml - echo " post-start:" >> .ddev/config.yaml - echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS firefox; GRANT ALL ON firefox.* TO 'db'@'%';\"" >> .ddev/config.yaml - echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS chrome; GRANT ALL ON chrome.* TO 'db'@'%';\"" >> .ddev/config.yaml - ddev config --web-environment="NIGHTWATCH_DRUPAL_URL_FIREFOX=https://drupal_firefox,NIGHTWATCH_DRUPAL_URL_CHROME=https://drupal_chrome" - ddev config --additional-hostnames="*.drainpipe" - - - name: Run the site installer - run: | - ddev drush --yes site:install minimal - ddev drush config:export --yes - - - name: Create Artifact - run: zip -r /tmp/drainpipe.zip ./ - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - path: /tmp/drainpipe.zip - - Test-NPM: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev npm init -y - ddev npm install nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --save-dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-npm-${{ matrix.drupal-version }} - path: test_result - - Test-Yarn-Classic: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev exec corepack disable - ddev exec npm i -g yarn@1.22.1 - ddev exec 'rm /usr/local/bin/yarn' - ddev exec 'ln -s $(npm root -g)/yarn/bin/yarn /usr/local/bin/yarn' - ddev yarn init -y - ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-yarn-classic-${{ matrix.drupal-version }} - path: test_result - - Test-Yarn-3-Node-Linker: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev yarn set version berry - ddev yarn set version 3 - ddev yarn init -y - ddev yarn config set nodeLinker node-modules - ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-yarn3-nl-${{ matrix.drupal-version }} - path: test_result - - Test-Yarn-4-Node-Linker: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev restart - ddev yarn set version berry - ddev yarn set version 4 - ddev yarn init -y - ddev yarn config set nodeLinker node-modules - ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-yarn4-nl-${{ matrix.drupal-version }} - path: test_result - - Test-Yarn-3: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev yarn set version berry - ddev yarn set version 3 - ddev yarn init -y - echo "packageExtensions:" >> .yarnrc.yml - echo ' "nightwatch@*":' >> .yarnrc.yml - echo ' dependencies:' >> .yarnrc.yml - echo ' ws: "*"' >> .yarnrc.yml - echo ' "@nightwatch/vrt@*":' >> .yarnrc.yml - echo ' dependencies:' >> .yarnrc.yml - echo ' open: "^8"' >> .yarnrc.yml - ddev yarn add nightwatch nightwatch-axe-verbose @nightwatch/vrt @lullabot/nightwatch-drupal-commands --dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-yarn3-${{ matrix.drupal-version }} - path: test_result - - Test-Yarn-4: - runs-on: ubuntu-24.04 - needs: Build - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - uses: actions/download-artifact@v4 - with: - name: test-functional-build-${{ matrix.drupal-version }} - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Nightwatch - run: | - ddev restart - ddev yarn set version berry - ddev yarn init -y - echo "packageExtensions:" >> .yarnrc.yml - echo ' "nightwatch@*":' >> .yarnrc.yml - echo ' dependencies:' >> .yarnrc.yml - echo ' ws: "*"' >> .yarnrc.yml - echo ' "@nightwatch/vrt@*":' >> .yarnrc.yml - echo ' dependencies:' >> .yarnrc.yml - echo ' open: "^8"' >> .yarnrc.yml - ddev yarn cache clear - ddev yarn add nightwatch nightwatch-axe-verbose @nightwatch/vrt @nightwatch/vrt @lullabot/nightwatch-drupal-commands --dev - - - name: Install Drupal - run: | - ddev task test:siteinstall:all - - - name: Run Functional Tests - run: ddev task test:functional - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-yarn4-${{ matrix.drupal-version }} - path: test_result diff --git a/.github/workflows/TestGitHubActions.yml b/.github/workflows/TestGitHubActions.yml deleted file mode 100644 index 2085ac6d0..000000000 --- a/.github/workflows/TestGitHubActions.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: "Test GitHub Actions" - -on: - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-GitHub-Actions: - runs-on: ubuntu-24.04 - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe/drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require lullabot/drainpipe --with-all-dependencies - ddev composer require --dev lullabot/drainpipe-dev --with-all-dependencies - - - name: Install Drupal - run: | - ddev drush site:install minimal -y - echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php - ddev drush config:export -y - - - name: Lint GitHub Actions and Workflows - run: ddev task "github:actions:lint directories='./drainpipe/scaffold/github/actions ./drainpipe/scaffold/github/workflows'" - - - name: Run Database Updates - run: ddev task update - - - name: Create pantheon.yml - run: | - echo "api_version: 1" >> pantheon.yml - echo "web_docroot: true" >> pantheon.yml - echo "php_version: 8.3" >> pantheon.yml - echo "database:" >> pantheon.yml - echo " version: 10.6" >> pantheon.yml - echo "enforce_https: full+subdomains" >> pantheon.yml - echo "build_step: false" >> pantheon.yml - - - name: Create .drainpipeignore - run: | - echo "/web/sites/default/files" >> .drainpipeignore - echo "/.ddev" >> .drainpipeignore - echo "settings.ddev.php" >> .drainpipeignore - echo "/drainpipe" >> .drainpipeignore - - - name: Create settings.php - run: | - echo ' web/sites/default/settings.php - echo "\$settings['container_yamls'][] = __DIR__ . '/services.yml';" >> web/sites/default/settings.php - echo "include __DIR__ . \"/settings.pantheon.php\";" >> web/sites/default/settings.php - echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php - curl -o web/sites/default/settings.pantheon.php https://raw.githubusercontent.com/pantheon-systems/drupal-integrations/11.x/assets/settings.pantheon.php - - - name: Snapshot Project - env: - directory: /tmp/release - remote: - message: - site: - run: | - echo "/drainpipe" >> .drainpipeignore - ddev task snapshot:directory directory=/tmp/release - - - name: Prepare Actions - run: | - mkdir -p .github/actions - cp -R ./drainpipe/scaffold/github/actions/common .github/actions/drainpipe - - - name: Deploy Pantheon Review App - uses: ./drainpipe/scaffold/github/actions/pantheon/review - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - terminus-token: ${{ secrets.PANTHEON_TERMINUS_TOKEN }} - commit-message: ${{ github.sha }} - site-name: ${{ vars.PANTHEON_SITE_NAME || secrets.PANTHEON_SITE_NAME }} - lock-username: ${{ secrets.PANTHEON_REVIEW_USERNAME }} - lock-password: ${{ secrets.PANTHEON_REVIEW_PASSWORD }} - # set to "true" if you want to run the installer - run-installer: ${{ secrets.PANTHEON_REVIEW_RUN_INSTALLER }} diff --git a/.github/workflows/TestMetapackages.yml b/.github/workflows/TestMetapackages.yml deleted file mode 100644 index 5f8055a17..000000000 --- a/.github/workflows/TestMetapackages.yml +++ /dev/null @@ -1,362 +0,0 @@ -name: Test Sass and JavaScript Compilation -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Build: - runs-on: ubuntu-24.04 - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev config --nodejs-version "22" - ddev config --corepack-enable - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - - - name: Setup Test Files - run: | - cp drainpipe/tests/fixtures/metapackages/Taskfile.yml . - cp drainpipe/tests/fixtures/metapackages/style.scss . - cp -R drainpipe/tests/fixtures/metapackages/js . - - - name: Create Artifact - run: zip -r /tmp/drainpipe.zip ./ - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: test-metapackage-build - path: /tmp/drainpipe.zip - - Test-Sass-NPM: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev npm init -y - ddev npm install drainpipe/metapackages/sass --save-dev - - - name: Compile Sass - run: ddev task sass - - Test-Sass-Yarn-Classic: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev exec corepack disable - ddev exec npm i -g yarn@1.22.1 - ddev exec 'rm /usr/local/bin/yarn' - ddev exec 'ln -s $(npm root -g)/yarn/bin/yarn /usr/local/bin/yarn' - ddev exec yarn init -y - ddev exec yarn add file:./drainpipe/metapackages/sass --dev - - - name: Compile Sass - run: ddev task sass - - Test-Sass-Yarn-3: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev yarn set version berry - ddev yarn set version 3 - ddev yarn init -y - ddev yarn add ./drainpipe/metapackages/sass --dev - - - name: Compile Sass - run: ddev task sass - - Test-Sass-Yarn-4: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev restart - ddev yarn set version berry - ddev yarn set version 4 - ddev yarn init -y - ddev yarn cache clear - ddev yarn add ./drainpipe/metapackages/sass --dev - - - name: Compile Sass - run: ddev task sass - - Test-JavaScript-NPM: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev npm init -y - ddev npm install focus-trap@^6.7.3 - ddev npm install drainpipe/metapackages/javascript --save-dev - - - name: Compile JavaScript - run: ddev task javascript - - Test-JavaScript-Yarn-Classic: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev exec corepack disable - ddev exec npm i -g yarn@1.22.1 - ddev exec 'rm /usr/local/bin/yarn' - ddev exec 'ln -s $(npm root -g)/yarn/bin/yarn /usr/local/bin/yarn' - ddev exec yarn init -y - ddev exec yarn add focus-trap@^6.7.3 - ddev exec yarn add file:./drainpipe/metapackages/javascript --dev - - - name: Compile JavaScript - run: ddev task javascript - - Test-JavaScript-Yarn-3: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev yarn set version berry - ddev yarn set version 3 - ddev yarn init -y - ddev yarn add focus-trap@^6.7.3 - ddev yarn add ./drainpipe/metapackages/javascript --dev - - - name: Compile JavaScript - run: ddev task javascript - - Test-JavaScript-Yarn-4: - runs-on: ubuntu-24.04 - needs: Build - steps: - - uses: actions/download-artifact@v4 - with: - name: test-metapackage-build - - - name: Restore Workspace - run: | - cd ../ - mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip - unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} - cd ${{ github.workspace }} - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - - name: Start DDEV - run: ddev start - - - name: Setup Sass - run: | - ddev restart - ddev yarn set version berry - ddev yarn set version 4 - ddev yarn init -y - ddev yarn cache clear - ddev yarn add focus-trap@^6.7.3 - ddev yarn add ./drainpipe/metapackages/javascript --dev - - - name: Compile JavaScript - run: ddev task javascript diff --git a/.github/workflows/TestPHPUnit.yml b/.github/workflows/TestPHPUnit.yml deleted file mode 100644 index 5546ba6f9..000000000 --- a/.github/workflows/TestPHPUnit.yml +++ /dev/null @@ -1,225 +0,0 @@ -name: Test PHPUnit Integration -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-PHPUnit-Functional: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Install xmllint - run: sudo apt-get update && sudo apt-get install -y libxml2-utils - - - name: Create a Drupal project - run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - # Restart is required to enable the provided Selenium containers - ddev restart - - - name: Add Custom Testing Module - run: | - mkdir web/modules/custom - cp -R drainpipe/tests/fixtures/phpunit/testmodule web/modules/custom/ - cp drainpipe/tests/fixtures/phpunit/Taskfile.yml . - - - name: Run PHPUnit Functional Tests - run: | - ddev drush site:install -y - ddev drush user:password admin password - ddev task test:phpunit:functional format=junit - docker logs ddev-drainpipe-chrome | tee test_result/ddev-chrome.log - docker logs ddev-drainpipe-firefox | tee test_result/ddev-firefox.log - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-phpunit-functional-${{ matrix.drupal-version }} - path: test_result - - - name: Confirm All PHPUnit Functional Tests were run - uses: GuillaumeFalourd/assert-command-line-output@v2.4 - with: - command_line: xmllint --xpath 'string(//testsuites/testsuite/@tests)' test_result/phpunit-functional.xml - contains: 6 - expected_result: PASSED - - Test-PHPUnit-Functional-DTT: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Install xmllint - run: sudo apt-get update && sudo apt-get install -y libxml2-utils - - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe", "weitzman/drupal-test-traits"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config --no-plugins allow-plugins.weitzman/drupal-test-traits true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" weitzman/drupal-test-traits lullabot/mink-selenium2-driver --dev --with-all-dependencies - # Restart is required to enable the provided Selenium containers - ddev restart - - - name: Add Custom Testing Module - run: | - mkdir web/modules/custom - cp -R drainpipe/tests/fixtures/phpunit/testmodule web/modules/custom/ - cp drainpipe/tests/fixtures/phpunit/Taskfile-testtraits.yml Taskfile.yml - - - name: Run PHPUnit Functional Tests - run: | - ddev drush site:install -y - ddev drush user:password admin password - ddev task test:phpunit:functional format=junit - docker logs ddev-drainpipe-chrome | tee test_result/ddev-chrome.log - docker logs ddev-drainpipe-firefox | tee test_result/ddev-firefox.log - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-phpunit-dtt-${{ matrix.drupal-version }} - path: test_result - - - name: Confirm All PHPUnit Functional Tests were run - uses: GuillaumeFalourd/assert-command-line-output@v2 - with: - command_line: xmllint --xpath 'string(//testsuites/testsuite/@tests)' test_result/phpunit-functional.xml - contains: 9 - expected_result: PASSED - - Test-PHPUnit-Static: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Install xmllint - run: sudo apt-get update && sudo apt-get install -y libxml2-utils - - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - # Restart is required to enable the provided Selenium containers - ddev restart - - - name: Add Custom Testing Module - run: | - mkdir web/modules/custom - cp -R drainpipe/tests/fixtures/phpunit/testmodule web/modules/custom/ - cp drainpipe/tests/fixtures/phpunit/Taskfile.yml . - - - name: Run PHPUnit Tests - run: ddev task test:phpunit:static format=junit - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-phpunit-static-${{ matrix.drupal-version }} - path: test_result - - - name: Confirm All PHPUnit Functional Tests were run - uses: GuillaumeFalourd/assert-command-line-output@v2 - with: - command_line: xmllint --xpath 'string(//testsuites/testsuite/@tests)' test_result/phpunit.xml - contains: 12 - expected_result: PASSED diff --git a/.github/workflows/TestStatic.yml b/.github/workflows/TestStatic.yml deleted file mode 100644 index 1ece49bb4..000000000 --- a/.github/workflows/TestStatic.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Test Static Tests -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Static: - runs-on: ubuntu-24.04 - strategy: - matrix: - drupal-version: [ 10, 11 ] - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - name: Setup drainpipe-dev - run: mv drainpipe/drainpipe-dev . - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - - - name: Setup Project - run: | - ddev config --auto - ddev start - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - # Restart is required to enable the provided Selenium containers - ddev restart - - - name: Verify files were created - run: | - test -f phpcs.xml.dist - test -f phpstan.neon.dist - - - name: Create a git repository - run: | - git config --global user.email "no-reply@example.com" - git config --global user.name "Drainpipe Bot" - git init - echo "/drainpipe" >> .gitignore - echo "/drainpipe-dev" >> .gitignore - git add . - git commit -m "Initial commit" - - - name: Fix settings.php - run: | - sed -i '/^.*container_yamls.*$/i /** @phpstan-ignore-next-line */' web/sites/default/settings.php - - - name: Test for untracked and modified files - id: test_untracked - continue-on-error: true - run: ddev task test:untracked - - - name: Test for untracked and modified files - run: | - if [ "${{ steps.test_untracked.outcome }}" != "failure" ]; then - exit 1 - fi - git add . - git commit -m "Second commit" - ddev task test:untracked - - - name: Run Static Tests - run: ddev task test:static - - - name: Confirm custom directories are scanned - run: | - set -x - mkdir -p custom-yaml-directory - echo 'key: value' >> custom-yaml-directory/test.yml - ddev task test:static YAML_DIRS="custom-yaml-directory/*.yml" | tee static.log - [[ $(grep '\[OK] All 1 YAML files contain valid syntax.' static.log | wc -l) -eq 1 ]] - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: test_result-static - path: test_result diff --git a/.github/workflows/TestTugboat.yml b/.github/workflows/TestTugboat.yml deleted file mode 100644 index f65ce60f1..000000000 --- a/.github/workflows/TestTugboat.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: "Test Tugboat" - -on: - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Tugboat: - runs-on: ubuntu-24.04 - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-reqs - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - - # Lock in versions so tests know what to expect. - # Redis tag v1.2.0 == 6-bullseye - # Elasticsearch tag v0.3.2 == 7.17.14 - - name: Setup Project - run: | - ddev config --auto - ddev config --php-version "8.3" - ddev config --nodejs-version "18" - ddev get ddev/ddev-redis --version v1.2.0 - ddev get ddev/ddev-elasticsearch --version v0.3.2 - ddev restart - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev exec --raw composer config extra.drainpipe --json '{"tugboat": {}}' - mkdir -p .tugboat - echo "php:" > .tugboat/config.drainpipe-override.yml - echo " aliases:" >> .tugboat/config.drainpipe-override.yml - echo " - foo" >> .tugboat/config.drainpipe-override.yml - echo " urls:" >> .tugboat/config.drainpipe-override.yml - echo " - /" >> .tugboat/config.drainpipe-override.yml - echo " - /?v=1" >> .tugboat/config.drainpipe-override.yml - echo " screenshot:" >> .tugboat/config.drainpipe-override.yml - echo " timeout: 45" >> .tugboat/config.drainpipe-override.yml - echo " visualdiff:" >> .tugboat/config.drainpipe-override.yml - echo " fullPage: false" >> .tugboat/config.drainpipe-override.yml - ddev composer require lullabot/drainpipe --with-all-dependencies - - - name: Add an online step - run: | - echo " online:tugboat:" >> Taskfile.yml - echo " cmds:" >> Taskfile.yml - echo " - echo \"Tugboat online\"" >> Taskfile.yml - ddev composer install - - # Compare the generated files to the ones used to build this repository - # preview - they should be the same. - - name: Test Generated Files - run: | - diff -up drainpipe/.tugboat/config.yml .tugboat/config.yml - sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/1-init.sh - sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/2-update.sh - sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/3-build.sh - sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/4-online.sh - diff -up drainpipe/.tugboat/steps/1-init.sh .tugboat/steps/1-init.sh - diff -up drainpipe/.tugboat/steps/2-update.sh .tugboat/steps/2-update.sh - diff -up drainpipe/.tugboat/steps/3-build.sh .tugboat/steps/3-build.sh - diff -up drainpipe/.tugboat/steps/4-online.sh .tugboat/steps/4-online.sh - - - name: Add a build:tugboat step - run: | - echo " build:tugboat:" >> Taskfile.yml - echo " cmds:" >> Taskfile.yml - echo " - echo \"Tugboat build\"" >> Taskfile.yml - ddev composer install - if ! grep -q './vendor/bin/task build:tugboat' .tugboat/steps/3-build.sh; then - exit 1 - fi - - - name: Upload test artifacts - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: .tugboat - path: .tugboat - - Test-Non-Default-Nodejs: - runs-on: ubuntu-24.04 - steps: - - name: Create a Drupal project - run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd - - - uses: actions/checkout@v4 - with: - path: drainpipe - - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - - - name: Setup Project - run: | - ddev config --auto - ddev config --php-version "8.3" - ddev config --nodejs-version "16" - ddev restart - ddev exec --raw composer config extra.drupal-scaffold.gitignore true - ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"] - ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true - ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true - ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' - ddev exec --raw composer config minimum-stability dev - ddev exec --raw composer config extra.drainpipe --json '{"tugboat": {}}' - ddev composer require lullabot/drainpipe --with-all-dependencies - - - name: Test NODE_MAJOR is correct - run: | - cat .tugboat/steps/1-init.sh - grep -q NODE_MAJOR=16 .tugboat/steps/1-init.sh - diff --git a/.github/workflows/ValidateTaskfile.yml b/.github/workflows/ValidateTaskfile.yml deleted file mode 100644 index 29f206be4..000000000 --- a/.github/workflows/ValidateTaskfile.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Validate example Taskfile.yml -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -jobs: - Validate-Example-Taskfile: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: '18' - - - name: Validate Taskfile.yml - # Also update src/BinaryInstallPlugin.php if changing version - run: | - curl -O https://raw.githubusercontent.com/go-task/task/v3.38.0/website/static/schema.json - npx ajv-cli validate -s schema.json -d scaffold/Taskfile.yml diff --git a/.github/workflows/composer-plugin.yml b/.github/workflows/composer-plugin.yml deleted file mode 100644 index 3380fc624..000000000 --- a/.github/workflows/composer-plugin.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Composer Plugin -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Composer-Plugin: - runs-on: ubuntu-24.04 - strategy: - matrix: - php-version: [ 8.1, 8.2, 8.3 ] - steps: - - uses: actions/checkout@v4 - - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - tools: composer:v2 - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - run: composer install - - - run: ./vendor/bin/phpunit diff --git a/.github/workflows/test-production-build.yml b/.github/workflows/test-production-build.yml deleted file mode 100644 index f8144364c..000000000 --- a/.github/workflows/test-production-build.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Test Production Build -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - Test-Production-Build: - runs-on: ubuntu-24.04 - strategy: - matrix: - php-version: [ 8.1, 8.2, 8.3 ] - include: - - php-version: 8.1 - drupal-version: ":^10" - - php-version: 8.2 - drupal-version: ":^10" - steps: - - uses: actions/checkout@v4 - - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - tools: composer:v2 - extensions: gd - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - - name: Install Drupal - run: | - cd ../ - composer create-project drupal/recommended-project${{ matrix.drupal-version }} drupal --ignore-platform-reqs - cd drupal - cp ${GITHUB_WORKSPACE}/tests/fixtures.drainpipe-test-build/Taskfile.yml . - composer config extra.drupal-scaffold.gitignore true - composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe"]' - composer config --no-plugins allow-plugins.composer/installers true - composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true - composer config --no-plugins allow-plugins.lullabot/drainpipe true - composer config repositories.drainpipe --json '{"type": "path", "url": "../drainpipe", "options": {"symlink": false}}' - composer config minimum-stability dev - composer require "lullabot/drainpipe @dev" --with-all-dependencies - - - name: Run static tests - run: | - cd ../drupal - ./vendor/bin/task build From 83146b7e782e124a5db4928194c6d004e551744d Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 12:35:21 -0500 Subject: [PATCH 066/159] ISSUE-204: use ddev for drush stuff --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 6729321fd..0ee6a159e 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -48,11 +48,11 @@ runs: # debug site aliases ddev drush site:alias - drainpipe_exec "./vendor/bin/drush site:alias" + # drainpipe_exec "./vendor/bin/drush site:alias" ddev task drupal:maintenance:on site=@lullabotsandbox.dev - drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" +# drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" shell: bash - name: Push to Acquia From 1850108af557d0d3c528f013cedc28a0429d466a Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 12:43:09 -0500 Subject: [PATCH 067/159] ISSUE-204: check drush version --- scaffold/github/actions/acquia/deploy/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 0ee6a159e..890f20a47 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -46,6 +46,8 @@ runs: # drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" + ddev drush version + # debug site aliases ddev drush site:alias # drainpipe_exec "./vendor/bin/drush site:alias" From b88cf701fa8112ece833103108bef607f37af06e Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 13:01:05 -0500 Subject: [PATCH 068/159] ISSUE-204: set drush version] --- scaffold/github/actions/acquia/deploy/action.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 890f20a47..28b3eac18 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -44,14 +44,24 @@ runs: drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" + + # drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" ddev drush version # debug site aliases ddev drush site:alias + # drainpipe_exec "./vendor/bin/drush site:alias" + # Set drush version + drainpipe_exec "acli drush:set-version @sitesandbox.test 13" + + + # Check drush version + drainpipe_exec "acli drush:set-version @sitesandbox.test" + ddev task drupal:maintenance:on site=@lullabotsandbox.dev # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" From 41fd63d1f2c1631b2c7775c4083c3bd783462cfd Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 13:43:19 -0500 Subject: [PATCH 069/159] ISSUE-204: avoid drush9 for remote drush commands --- scaffold/github/actions/acquia/deploy/action.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 28b3eac18..36ff58b6a 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -39,13 +39,19 @@ runs: ENVIRONMENT="${{ inputs.environment }}" APPLICATION=${ENVIRONMENT%.*} drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + + cat ~/.drush/sites + + sed -i.bak 's|drush9|drush|g' ~/.drush/sites + + cat ~/.drush/sites + hostname="${{ inputs.environment-url }}" hostname="${hostname#*://}" drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - # drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" ddev drush version From ef70f8c3c462a3c27322fefb8e2c1c3e9ec66492 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 13:56:51 -0500 Subject: [PATCH 070/159] ISSUE-204: executing in ddev's context --- scaffold/github/actions/acquia/deploy/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 36ff58b6a..4b0524a69 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -40,11 +40,11 @@ runs: APPLICATION=${ENVIRONMENT%.*} drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - cat ~/.drush/sites + drainpipe_exec "cat ~/.drush/sites" - sed -i.bak 's|drush9|drush|g' ~/.drush/sites + drainpipe_exec "sed -i.bak 's|drush9|drush|g' ~/.drush/sites" - cat ~/.drush/sites + drainpipe_exec "cat ~/.drush/sites" hostname="${{ inputs.environment-url }}" hostname="${hostname#*://}" From 50c7d2e30fc868316432e5e4228d753a7d35227e Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 14:23:17 -0500 Subject: [PATCH 071/159] ISSUE-204: get aliases file, debug --- scaffold/github/actions/acquia/deploy/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 4b0524a69..80303f241 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -40,7 +40,9 @@ runs: APPLICATION=${ENVIRONMENT%.*} drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - drainpipe_exec "cat ~/.drush/sites" + drainpipe_exec "ls -al /var/www/html/drush" + + exit 0 drainpipe_exec "sed -i.bak 's|drush9|drush|g' ~/.drush/sites" From b0380bf41f7b499f730d7a7705067980c97ae77c Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 14:35:34 -0500 Subject: [PATCH 072/159] ISSUE-204: get aliases file, debug --- scaffold/github/actions/acquia/deploy/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 80303f241..6c10bdd40 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -41,6 +41,8 @@ runs: drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" drainpipe_exec "ls -al /var/www/html/drush" + drainpipe_exec "ls -al /var/www/html/drush/sites" + exit 0 From e57630bb5ee2e0efaa4e9338ec7145e1cf0e22fe Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 14:35:56 -0500 Subject: [PATCH 073/159] ISSUE-204: get aliases file, debug --- scaffold/github/actions/acquia/deploy/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 6c10bdd40..f8d975cd3 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -40,7 +40,9 @@ runs: APPLICATION=${ENVIRONMENT%.*} drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + echo "======================================" drainpipe_exec "ls -al /var/www/html/drush" + echo "======================================" drainpipe_exec "ls -al /var/www/html/drush/sites" From 1976cb835061c6a49adc1006a4485b16f47c77ff Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 14:44:02 -0500 Subject: [PATCH 074/159] ISSUE-204: setting the path for drush aliases file --- scaffold/github/actions/acquia/deploy/action.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index f8d975cd3..fbe7a88b6 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -43,14 +43,11 @@ runs: echo "======================================" drainpipe_exec "ls -al /var/www/html/drush" echo "======================================" - drainpipe_exec "ls -al /var/www/html/drush/sites" + drainpipe_exec "ls -al /var/www/html/drush/sites/lullabotsandbox.site.yml" + drainpipe_exec "sed -i.bak 's|drush9|drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" - exit 0 - - drainpipe_exec "sed -i.bak 's|drush9|drush|g' ~/.drush/sites" - - drainpipe_exec "cat ~/.drush/sites" + drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" hostname="${{ inputs.environment-url }}" hostname="${hostname#*://}" From e61f5faa566ce8dd961518ffc0e1a0aecf0831fc Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 14:50:07 -0500 Subject: [PATCH 075/159] ISSUE-204: remove gpt allucinations/suggestions :P --- scaffold/github/actions/acquia/deploy/action.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index fbe7a88b6..80028d109 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -64,13 +64,6 @@ runs: # drainpipe_exec "./vendor/bin/drush site:alias" - # Set drush version - drainpipe_exec "acli drush:set-version @sitesandbox.test 13" - - - # Check drush version - drainpipe_exec "acli drush:set-version @sitesandbox.test" - ddev task drupal:maintenance:on site=@lullabotsandbox.dev # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" From 52ac1dabc8fcfad8fff54035cefafea819f3ffbc Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 14:59:47 -0500 Subject: [PATCH 076/159] ISSUE-204: try drainpipe_exec (that executes drush commands inside ddev) instead of a command in the host context --- scaffold/github/actions/acquia/deploy/action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 80028d109..14376b57e 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -64,7 +64,10 @@ runs: # drainpipe_exec "./vendor/bin/drush site:alias" - ddev task drupal:maintenance:on site=@lullabotsandbox.dev + # ddev task drupal:maintenance:on site=@lullabotsandbox.dev + drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" + + # ddev task drupal:maintenance:on site=@lullabotsandbox.dev # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" shell: bash From 9b01e30ce8237337b4f316954f0e86b82aa3a8ec Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 16:02:52 -0500 Subject: [PATCH 077/159] ISSUE-204: avoid simple command to know what is next --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 14376b57e..35b3a9ad0 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -65,7 +65,7 @@ runs: # drainpipe_exec "./vendor/bin/drush site:alias" # ddev task drupal:maintenance:on site=@lullabotsandbox.dev - drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" + # drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" # ddev task drupal:maintenance:on site=@lullabotsandbox.dev From e2739f40442abdb2e15345ab10e2ebaa5eccd812 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 16:20:16 -0500 Subject: [PATCH 078/159] ISSUE-204: fixed drush path for remote drush --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 35b3a9ad0..f67c207f0 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -45,7 +45,7 @@ runs: echo "======================================" drainpipe_exec "ls -al /var/www/html/drush/sites/lullabotsandbox.site.yml" - drainpipe_exec "sed -i.bak 's|drush9|drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" From d23eeee48d248ba494b6969cb9426402a6582e2c Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 16:32:52 -0500 Subject: [PATCH 079/159] ISSUE-204: debug --- scaffold/github/actions/acquia/deploy/action.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index f67c207f0..889a40018 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -49,18 +49,18 @@ runs: drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" - hostname="${{ inputs.environment-url }}" - hostname="${hostname#*://}" + # hostname="${{ inputs.environment-url }}" + # hostname="${hostname#*://}" - drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" + # drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - # drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" + # # drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" - ddev drush version + # ddev drush version - # debug site aliases - ddev drush site:alias + # # debug site aliases + # ddev drush site:alias # drainpipe_exec "./vendor/bin/drush site:alias" From 0cbd7eec56d6b26558e3d83112b0951cb21ec566 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 16:38:06 -0500 Subject: [PATCH 080/159] ISSUE-204: more debugging] --- .../github/actions/acquia/deploy/action.yml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 889a40018..c912aa04c 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -34,20 +34,20 @@ runs: - name: Put site in Maintenance Mode run: | - source .github/actions/drainpipe/set-env/bash_aliases - drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" - ENVIRONMENT="${{ inputs.environment }}" - APPLICATION=${ENVIRONMENT%.*} - drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + # source .github/actions/drainpipe/set-env/bash_aliases + # drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" + # ENVIRONMENT="${{ inputs.environment }}" + # APPLICATION=${ENVIRONMENT%.*} + # drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - echo "======================================" - drainpipe_exec "ls -al /var/www/html/drush" - echo "======================================" - drainpipe_exec "ls -al /var/www/html/drush/sites/lullabotsandbox.site.yml" + # echo "======================================" + # drainpipe_exec "ls -al /var/www/html/drush" + # echo "======================================" + # drainpipe_exec "ls -al /var/www/html/drush/sites/lullabotsandbox.site.yml" - drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + # drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" - drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" + # drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" # hostname="${{ inputs.environment-url }}" # hostname="${hostname#*://}" From d9809fea4b634ccbb7f627ace96004fedd0e1678 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 16:45:53 -0500 Subject: [PATCH 081/159] ISSUE-204: more debugging --- .../github/actions/acquia/deploy/action.yml | 67 ------------------- 1 file changed, 67 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index c912aa04c..ea66f202c 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -31,70 +31,3 @@ runs: github-token: ${{ inputs.github-token }} environment: ${{ inputs.environment }} - - name: Put site in Maintenance Mode - run: | - - # source .github/actions/drainpipe/set-env/bash_aliases - # drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" - # ENVIRONMENT="${{ inputs.environment }}" - # APPLICATION=${ENVIRONMENT%.*} - # drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - - # echo "======================================" - # drainpipe_exec "ls -al /var/www/html/drush" - # echo "======================================" - # drainpipe_exec "ls -al /var/www/html/drush/sites/lullabotsandbox.site.yml" - - # drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" - - # drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" - - # hostname="${{ inputs.environment-url }}" - # hostname="${hostname#*://}" - - # drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - - - # # drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" - - # ddev drush version - - # # debug site aliases - # ddev drush site:alias - - # drainpipe_exec "./vendor/bin/drush site:alias" - - # ddev task drupal:maintenance:on site=@lullabotsandbox.dev - # drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" - - # ddev task drupal:maintenance:on site=@lullabotsandbox.dev - -# drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" - shell: bash - - - name: Push to Acquia - uses: ./drainpipe/scaffold/github/actions/acquia/push - with: - environment: ${{ inputs.environment }} - commit-message: ${{ inputs.commit-message }} - api-key: ${{ inputs.api-key }} - api-secret: ${{ inputs.api-secret }} - - - name: Run updates - uses: ./drainpipe/scaffold/github/actions/acquia/update - with: - environment: ${{ inputs.environment }} - run-installer: ${{ inputs.run-installer }} - - - name: Set Deployment Status - uses: ./.github/actions/drainpipe/deployment-status - with: - github-token: ${{ inputs.github-token }} - environment-url: ${{ inputs.environment-url }} - - - name: Take site out of Maintenance Mode - run: | - drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" - shell: bash - - From fb9d389a2b20ca73942f09792f1b03f11df0da55 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 16:52:58 -0500 Subject: [PATCH 082/159] ISSUE-204: more debugging --- .../github/actions/acquia/deploy/action.yml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index ea66f202c..9128642da 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -31,3 +31,70 @@ runs: github-token: ${{ inputs.github-token }} environment: ${{ inputs.environment }} + - name: Put site in Maintenance Mode + run: | + + # source .github/actions/drainpipe/set-env/bash_aliases + # drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" + # ENVIRONMENT="${{ inputs.environment }}" + # APPLICATION=${ENVIRONMENT%.*} + # drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + + # echo "======================================" + # drainpipe_exec "ls -al /var/www/html/drush" + # echo "======================================" + # drainpipe_exec "ls -al /var/www/html/drush/sites/lullabotsandbox.site.yml" + + # drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + + # drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" + + # hostname="${{ inputs.environment-url }}" + # hostname="${hostname#*://}" + + # drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" + + + # # drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" + + # ddev drush version + + # # debug site aliases + # ddev drush site:alias + + # drainpipe_exec "./vendor/bin/drush site:alias" + + # ddev task drupal:maintenance:on site=@lullabotsandbox.dev + # drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" + + # ddev task drupal:maintenance:on site=@lullabotsandbox.dev + +# drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" + shell: bash + + # - name: Push to Acquia + # uses: ./drainpipe/scaffold/github/actions/acquia/push + # with: + # environment: ${{ inputs.environment }} + # commit-message: ${{ inputs.commit-message }} + # api-key: ${{ inputs.api-key }} + # api-secret: ${{ inputs.api-secret }} + + # - name: Run updates + # uses: ./drainpipe/scaffold/github/actions/acquia/update + # with: + # environment: ${{ inputs.environment }} + # run-installer: ${{ inputs.run-installer }} + + # - name: Set Deployment Status + # uses: ./.github/actions/drainpipe/deployment-status + # with: + # github-token: ${{ inputs.github-token }} + # environment-url: ${{ inputs.environment-url }} + + # - name: Take site out of Maintenance Mode + # run: | + # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" + # shell: bash + + From f85496de7cd37cc28506c8e140c08a020abcf7cf Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 16:56:45 -0500 Subject: [PATCH 083/159] ISSUE-204: more debugging --- scaffold/github/actions/acquia/deploy/action.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 9128642da..dedb0cfc4 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -34,11 +34,11 @@ runs: - name: Put site in Maintenance Mode run: | - # source .github/actions/drainpipe/set-env/bash_aliases - # drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" - # ENVIRONMENT="${{ inputs.environment }}" - # APPLICATION=${ENVIRONMENT%.*} - # drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + source .github/actions/drainpipe/set-env/bash_aliases + drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" + ENVIRONMENT="${{ inputs.environment }}" + APPLICATION=${ENVIRONMENT%.*} + drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" # echo "======================================" # drainpipe_exec "ls -al /var/www/html/drush" From 9810225c97af3932d7a4d2a6ef116f72a13f8f80 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 17:01:44 -0500 Subject: [PATCH 084/159] ISSUE-204: more debugging --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index dedb0cfc4..5ae65a898 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -45,9 +45,9 @@ runs: # echo "======================================" # drainpipe_exec "ls -al /var/www/html/drush/sites/lullabotsandbox.site.yml" - # drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" - # drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" + drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" # hostname="${{ inputs.environment-url }}" # hostname="${hostname#*://}" From a07d6f4a2e5d6ed26571e3149196d4f89ea077cf Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 17:08:29 -0500 Subject: [PATCH 085/159] ISSUE-204: more debugging --- scaffold/github/actions/acquia/deploy/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 5ae65a898..611df8edf 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -49,10 +49,10 @@ runs: drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" - # hostname="${{ inputs.environment-url }}" - # hostname="${hostname#*://}" + hostname="${{ inputs.environment-url }}" + hostname="${hostname#*://}" - # drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" + drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" # # drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" From 360d04c1d3544632f646fecf87177e262e2311d2 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 17:12:29 -0500 Subject: [PATCH 086/159] ISSUE-204: more debugging --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 611df8edf..9bea1ff38 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -64,7 +64,7 @@ runs: # drainpipe_exec "./vendor/bin/drush site:alias" - # ddev task drupal:maintenance:on site=@lullabotsandbox.dev + ddev task drupal:maintenance:on site=@lullabotsandbox.dev # drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" # ddev task drupal:maintenance:on site=@lullabotsandbox.dev From 8ec891dae4ef3fa833d263d3dd171bff8be5cf80 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 17:19:38 -0500 Subject: [PATCH 087/159] ISSUE-204: more debugging --- scaffold/github/actions/acquia/deploy/action.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 9bea1ff38..8dc3aed52 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -72,13 +72,13 @@ runs: # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" shell: bash - # - name: Push to Acquia - # uses: ./drainpipe/scaffold/github/actions/acquia/push - # with: - # environment: ${{ inputs.environment }} - # commit-message: ${{ inputs.commit-message }} - # api-key: ${{ inputs.api-key }} - # api-secret: ${{ inputs.api-secret }} + - name: Push to Acquia + uses: ./drainpipe/scaffold/github/actions/acquia/push + with: + environment: ${{ inputs.environment }} + commit-message: ${{ inputs.commit-message }} + api-key: ${{ inputs.api-key }} + api-secret: ${{ inputs.api-secret }} # - name: Run updates # uses: ./drainpipe/scaffold/github/actions/acquia/update From a90f629f28536bca8f0881e80bff8a6dcf6a1e41 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 18:35:16 -0500 Subject: [PATCH 088/159] ISSUE-204: fix path --- scaffold/github/actions/acquia/push/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index f165401e4..49e034613 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -18,7 +18,7 @@ runs: steps: - name: Push to Acquia run: | - source .github/actions/drainpipe/common/set-env/bash_aliases + source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENV_INFO=$(drainpipe_exec "acli api:environments:find ${{ inputs.environment }}") VCS_TYPE=$(echo $ENV_INFO | jq -r ".vcs.type") From 8628314ed664ff8a2873f0235bf20b803f0c7f14 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 18:40:47 -0500 Subject: [PATCH 089/159] ISSUE-204: debug --- scaffold/github/actions/acquia/push/action.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index 49e034613..725560d18 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -18,6 +18,7 @@ runs: steps: - name: Push to Acquia run: | + source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENV_INFO=$(drainpipe_exec "acli api:environments:find ${{ inputs.environment }}") @@ -26,10 +27,10 @@ runs: echo "Unrecognised VCS type" exit 1 fi - BRANCH=$(echo $ENV_INFO | jq -r ".vcs.path") - REMOTE=$(echo $ENV_INFO | jq -r ".vcs.url") - drainpipe_exec "./vendor/bin/task deploy:git directory=/tmp/release branch=\"$BRANCH\" remote=\"$REMOTE\" message=\"${{ inputs.commit-message }}\"" - # Run code-switch to the same branch so we wait for everything to sync. - drainpipe_exec "acli api:environments:code-switch ${{ inputs.environment }} \"$BRANCH\"" + # BRANCH=$(echo $ENV_INFO | jq -r ".vcs.path") + # REMOTE=$(echo $ENV_INFO | jq -r ".vcs.url") + # drainpipe_exec "./vendor/bin/task deploy:git directory=/tmp/release branch=\"$BRANCH\" remote=\"$REMOTE\" message=\"${{ inputs.commit-message }}\"" + # # Run code-switch to the same branch so we wait for everything to sync. + # drainpipe_exec "acli api:environments:code-switch ${{ inputs.environment }} \"$BRANCH\"" shell: bash From 9d23eea390e0c6a09da8530b487ba23dacdc30cb Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 18:53:14 -0500 Subject: [PATCH 090/159] ISSUE-204: debug --- scaffold/github/actions/acquia/push/action.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index 725560d18..62fb9176b 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -22,11 +22,11 @@ runs: source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENV_INFO=$(drainpipe_exec "acli api:environments:find ${{ inputs.environment }}") - VCS_TYPE=$(echo $ENV_INFO | jq -r ".vcs.type") - if [ "$VCS_TYPE" != "git" ]; then - echo "Unrecognised VCS type" - exit 1 - fi + # VCS_TYPE=$(echo $ENV_INFO | jq -r ".vcs.type") + # if [ "$VCS_TYPE" != "git" ]; then + # echo "Unrecognised VCS type" + # exit 1 + # fi # BRANCH=$(echo $ENV_INFO | jq -r ".vcs.path") # REMOTE=$(echo $ENV_INFO | jq -r ".vcs.url") # drainpipe_exec "./vendor/bin/task deploy:git directory=/tmp/release branch=\"$BRANCH\" remote=\"$REMOTE\" message=\"${{ inputs.commit-message }}\"" From 12da1c9c6cb3d55ff1d7f68e65bd95727051dbc2 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 20 Dec 2024 20:00:17 -0500 Subject: [PATCH 091/159] ISSUE-204: restore action --- .../github/actions/acquia/deploy/action.yml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 8dc3aed52..045768163 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -80,21 +80,21 @@ runs: api-key: ${{ inputs.api-key }} api-secret: ${{ inputs.api-secret }} - # - name: Run updates - # uses: ./drainpipe/scaffold/github/actions/acquia/update - # with: - # environment: ${{ inputs.environment }} - # run-installer: ${{ inputs.run-installer }} - - # - name: Set Deployment Status - # uses: ./.github/actions/drainpipe/deployment-status - # with: - # github-token: ${{ inputs.github-token }} - # environment-url: ${{ inputs.environment-url }} - - # - name: Take site out of Maintenance Mode - # run: | - # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" - # shell: bash + - name: Run updates + uses: ./drainpipe/scaffold/github/actions/acquia/update + with: + environment: ${{ inputs.environment }} + run-installer: ${{ inputs.run-installer }} + + - name: Set Deployment Status + uses: ./.github/actions/drainpipe/deployment-status + with: + github-token: ${{ inputs.github-token }} + environment-url: ${{ inputs.environment-url }} + + - name: Take site out of Maintenance Mode + run: | + drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" + shell: bash From fb428637d8a207b7ffab2f460802ece562e59813 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 23 Dec 2024 08:52:57 -0500 Subject: [PATCH 092/159] ISSUE-204: fix path --- scaffold/github/actions/acquia/update/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/update/action.yml b/scaffold/github/actions/acquia/update/action.yml index 512ba70ad..c3cbc8a3d 100644 --- a/scaffold/github/actions/acquia/update/action.yml +++ b/scaffold/github/actions/acquia/update/action.yml @@ -12,7 +12,7 @@ runs: steps: - name: Update site on Acquia run: | - source .github/actions/drainpipe/common/set-env/bash_aliases + source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENVIRONMENT="${{ inputs.environment }}" APPLICATION=${ENVIRONMENT%.*} From 84ed7c13f0e732f1b214985044d336cd97d3c3bc Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 23 Dec 2024 09:57:40 -0500 Subject: [PATCH 093/159] ISSUE-204: debug api-key --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 045768163..01f1318fd 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -35,6 +35,10 @@ runs: run: | source .github/actions/drainpipe/set-env/bash_aliases + + echo ${{ inputs.api-key }}| cut -c 1-4 + + drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENVIRONMENT="${{ inputs.environment }}" APPLICATION=${ENVIRONMENT%.*} From f7cac731bad069a53bb43d80271a18fefff0d42e Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 23 Dec 2024 10:18:52 -0500 Subject: [PATCH 094/159] ISSUE-204: debug api key --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- scaffold/github/actions/acquia/push/action.yml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 01f1318fd..ec4cd927b 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -36,8 +36,8 @@ runs: source .github/actions/drainpipe/set-env/bash_aliases - echo ${{ inputs.api-key }}| cut -c 1-4 - + echo "API KEY" + echo ${{ inputs.api-key }}| cut -c 1-10 drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENVIRONMENT="${{ inputs.environment }}" diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index 62fb9176b..39929dd90 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -20,6 +20,10 @@ runs: run: | source .github/actions/drainpipe/set-env/bash_aliases + + echo "API KEY" + echo ${{ inputs.api-key }}| cut -c 1-4 + drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENV_INFO=$(drainpipe_exec "acli api:environments:find ${{ inputs.environment }}") # VCS_TYPE=$(echo $ENV_INFO | jq -r ".vcs.type") From f04829aff36debd7e9deabe187cdef2290194c54 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 23 Dec 2024 10:35:21 -0500 Subject: [PATCH 095/159] ISSUE-204: api key and secret for updates action --- scaffold/github/actions/acquia/deploy/action.yml | 2 ++ scaffold/github/actions/acquia/update/action.yml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index ec4cd927b..e99b261f7 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -89,6 +89,8 @@ runs: with: environment: ${{ inputs.environment }} run-installer: ${{ inputs.run-installer }} + api-key: ${{ inputs.api-key }} + api-secret: ${{ inputs.api-secret }} - name: Set Deployment Status uses: ./.github/actions/drainpipe/deployment-status diff --git a/scaffold/github/actions/acquia/update/action.yml b/scaffold/github/actions/acquia/update/action.yml index c3cbc8a3d..60b01fd67 100644 --- a/scaffold/github/actions/acquia/update/action.yml +++ b/scaffold/github/actions/acquia/update/action.yml @@ -7,6 +7,12 @@ inputs: run-installer: description: "Whether or not to run the Drupal site installer. Defaults to false." required: false + api-key: + description: "Acquia API Key" + required: true + api-secret: + description: "Acquia API Secret" + required: true runs: using: "composite" steps: From 61f9c8f017dc6a8e9eee95dbb1c55f8bd2b78999 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 23 Dec 2024 10:44:47 -0500 Subject: [PATCH 096/159] ISSUE-204: avoid using drush9 --- scaffold/github/actions/acquia/update/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scaffold/github/actions/acquia/update/action.yml b/scaffold/github/actions/acquia/update/action.yml index 60b01fd67..4784d3981 100644 --- a/scaffold/github/actions/acquia/update/action.yml +++ b/scaffold/github/actions/acquia/update/action.yml @@ -18,11 +18,17 @@ runs: steps: - name: Update site on Acquia run: | + source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENVIRONMENT="${{ inputs.environment }}" APPLICATION=${ENVIRONMENT%.*} drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" + + # Avoid using drush9 + drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + + if [ "${{ inputs.run-installer }}" == "true" ]; then drainpipe_exec "./vendor/bin/drush @${{ inputs.environment }} --yes site:install --existing-config" elif drainpipe_exec "./vendor/bin/task -l | grep '* update: ')"; then From 32b693e47227f12db7aa94c5abf48777c4e4f0d9 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 23 Dec 2024 11:05:22 -0500 Subject: [PATCH 097/159] ISSUE-204: restore action commands --- scaffold/github/actions/acquia/push/action.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index 39929dd90..aa4d40abc 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -26,15 +26,18 @@ runs: drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENV_INFO=$(drainpipe_exec "acli api:environments:find ${{ inputs.environment }}") + # VCS_TYPE=$(echo $ENV_INFO | jq -r ".vcs.type") # if [ "$VCS_TYPE" != "git" ]; then # echo "Unrecognised VCS type" # exit 1 # fi - # BRANCH=$(echo $ENV_INFO | jq -r ".vcs.path") - # REMOTE=$(echo $ENV_INFO | jq -r ".vcs.url") - # drainpipe_exec "./vendor/bin/task deploy:git directory=/tmp/release branch=\"$BRANCH\" remote=\"$REMOTE\" message=\"${{ inputs.commit-message }}\"" - # # Run code-switch to the same branch so we wait for everything to sync. - # drainpipe_exec "acli api:environments:code-switch ${{ inputs.environment }} \"$BRANCH\"" + + BRANCH=$(echo $ENV_INFO | jq -r ".vcs.path") + REMOTE=$(echo $ENV_INFO | jq -r ".vcs.url") + drainpipe_exec "./vendor/bin/task deploy:git directory=/tmp/release branch=\"$BRANCH\" remote=\"$REMOTE\" message=\"${{ inputs.commit-message }}\"" + # Run code-switch to the same branch so we wait for everything to sync. + drainpipe_exec "acli api:environments:code-switch ${{ inputs.environment }} \"$BRANCH\"" + shell: bash From e1fb8d22250a2c722c249ccd96b5b679e8a7d22c Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 23 Dec 2024 11:22:01 -0500 Subject: [PATCH 098/159] ISSUE-204: debug --- scaffold/github/actions/acquia/push/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index aa4d40abc..6dac29aed 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -27,6 +27,8 @@ runs: drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENV_INFO=$(drainpipe_exec "acli api:environments:find ${{ inputs.environment }}") + echo $ENV_INFO + # VCS_TYPE=$(echo $ENV_INFO | jq -r ".vcs.type") # if [ "$VCS_TYPE" != "git" ]; then # echo "Unrecognised VCS type" From 6886342a0bdb50302f71051bc5e1caf06822edd6 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 23 Dec 2024 11:32:41 -0500 Subject: [PATCH 099/159] ISSUE-204: debug origin of 'We strive to give you the best...' in env variables --- scaffold/github/actions/acquia/push/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index 6dac29aed..c3ce6f0f1 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -27,6 +27,11 @@ runs: drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENV_INFO=$(drainpipe_exec "acli api:environments:find ${{ inputs.environment }}") + + echo "=========================" + echo ${{ inputs.environment }}") + echo "=========================" + echo $ENV_INFO # VCS_TYPE=$(echo $ENV_INFO | jq -r ".vcs.type") From 7180d0e9128811cb8ab10f3644b0ff44d36f3039 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 23 Dec 2024 11:43:18 -0500 Subject: [PATCH 100/159] ISSUE-204: typo --- scaffold/github/actions/acquia/push/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index c3ce6f0f1..932f30285 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -29,7 +29,7 @@ runs: echo "=========================" - echo ${{ inputs.environment }}") + echo ${{ inputs.environment }} echo "=========================" echo $ENV_INFO From d046f22967fb7050889fadc16c1730091246be31 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 23 Dec 2024 12:14:04 -0500 Subject: [PATCH 101/159] ISSUE-204: avoid questions from acli like 'Would you like to share anonymous performance' --- scaffold/github/actions/acquia/push/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index 932f30285..6559aaab6 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -25,7 +25,7 @@ runs: echo ${{ inputs.api-key }}| cut -c 1-4 drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" - ENV_INFO=$(drainpipe_exec "acli api:environments:find ${{ inputs.environment }}") + ENV_INFO=$(drainpipe_exec "acli --no-interaction api:environments:find ${{ inputs.environment }}") echo "=========================" From 63ea490974fd015e37b0974dd1c9b3bd3cf64ba6 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 7 Jan 2025 13:36:44 -0500 Subject: [PATCH 102/159] ISSUE-204: settings file already created | change label for step --- .github/workflows/TestAcquia.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 590062263..87d2dba83 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -35,7 +35,9 @@ jobs: ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev exec --raw composer config extra.drainpipe.github --json '{"acquia": []}' ddev exec --raw composer config minimum-stability dev ddev composer require lullabot/drainpipe --with-all-dependencies @@ -54,13 +56,6 @@ jobs: echo "settings.ddev.php" >> .drainpipeignore echo "/drainpipe" >> .drainpipeignore - - name: Create settings.php - run: | - echo ' web/sites/default/settings.php - echo "\$settings['container_yamls'][] = __DIR__ . '/services.yml';" >> web/sites/default/settings.php - echo "include __DIR__ . \"/settings.acquia.php\";" >> web/sites/default/settings.php - echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php - - name: Snapshot Project env: directory: /tmp/release @@ -71,7 +66,7 @@ jobs: echo "/drainpipe" >> .drainpipeignore ddev task snapshot:directory directory=/tmp/release - - name: Clone from production to dev + - name: Clone from test to dev uses: ./drainpipe/scaffold/github/actions/acquia/clone-env with: source-environment: lullabotsandbox.test From b58e41a3858e97ede44261f935ab9e16c375c51d Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 7 Jan 2025 15:36:07 -0500 Subject: [PATCH 103/159] ISSUE-204: acquia needs docroot instead of web [skip ci] --- .github/workflows/TestAcquia.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 87d2dba83..c9dedf20e 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -11,7 +11,14 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Create a Drupal project - run: composer create-project drupal/recommended-project:10.4.0 . --ignore-platform-req=ext-gd + run: | + + composer create-project drupal/recommended-project:10.4.0 . \ + --ignore-platform-req=ext-gd + + # Acquia needs "docroot" instead of "web" + mv web docroot + ln -s docroot web - uses: actions/checkout@v4 with: From 0afdbbbdbc14a2da82821b93bc97501e96f5f422 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 7 Jan 2025 15:36:32 -0500 Subject: [PATCH 104/159] ISSUE-204: ensure acquia and ddev settings work after deployment --- .github/workflows/TestAcquia.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index c9dedf20e..bfb36beed 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -35,6 +35,7 @@ jobs: - name: Setup Project run: | + ddev config --auto ddev start ddev exec --raw composer config extra.drupal-scaffold.gitignore true @@ -48,8 +49,31 @@ jobs: ddev exec --raw composer config extra.drainpipe.github --json '{"acquia": []}' ddev exec --raw composer config minimum-stability dev ddev composer require lullabot/drainpipe --with-all-dependencies + + # Recommended settings for Acquia + ddev composer config --no-plugins allow-plugins.acquia/drupal-recommended-settings true + ddev composer require acquia/drupal-recommended-settings + yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml + # Move DDEV settings to the bottom again. + # When acquia/drupal-recommended-settings modifies the settings.php + # breaks DDEV database default connection. So, we move the DDEV + # settings to the bottom of the settings page again. + SETTINGS_PHP="web/sites/default/settings.php" + # Define the block of text to be deleted and appended + read -r -d '' TEXT << 'EOF' + // Automatically generated include for settings managed by ddev. + $ddev_settings = __DIR__ . '/settings.ddev.php'; + if (getenv('IS_DDEV_PROJECT') == 'true' && is_readable($ddev_settings)) { + require $ddev_settings; + } + EOF + # Remove the DDEV code block. + sed -i "/$(echo "$ESCAPED_TEXT" | head -n 1)/,/\$(echo "$ESCAPED_TEXT" | tail -n 1)/d" "$SETTINGS_PHP" + # Reinstall DDEV code block. + ddev config --auto + - name: Install Drupal run: | ddev drush site:install minimal -y From 2fabc349d8c2f239614d25a40484ed3e032a54d8 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 7 Jan 2025 15:51:18 -0500 Subject: [PATCH 105/159] ISSUE-204: typo --- .github/workflows/TestAcquia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index bfb36beed..a3e8af8b1 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -63,7 +63,7 @@ jobs: SETTINGS_PHP="web/sites/default/settings.php" # Define the block of text to be deleted and appended read -r -d '' TEXT << 'EOF' - // Automatically generated include for settings managed by ddev. + # Automatically generated include for settings managed by ddev. $ddev_settings = __DIR__ . '/settings.ddev.php'; if (getenv('IS_DDEV_PROJECT') == 'true' && is_readable($ddev_settings)) { require $ddev_settings; From a22a2763d36015a7e003fd56f965eeb95b1a723a Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 7 Jan 2025 16:14:57 -0500 Subject: [PATCH 106/159] ISSUE-204: improve the removal/restotr of DDEV config code --- .github/workflows/TestAcquia.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index a3e8af8b1..1bca039a1 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -61,16 +61,13 @@ jobs: # breaks DDEV database default connection. So, we move the DDEV # settings to the bottom of the settings page again. SETTINGS_PHP="web/sites/default/settings.php" - # Define the block of text to be deleted and appended - read -r -d '' TEXT << 'EOF' - # Automatically generated include for settings managed by ddev. - $ddev_settings = __DIR__ . '/settings.ddev.php'; - if (getenv('IS_DDEV_PROJECT') == 'true' && is_readable($ddev_settings)) { - require $ddev_settings; - } - EOF - # Remove the DDEV code block. - sed -i "/$(echo "$ESCAPED_TEXT" | head -n 1)/,/\$(echo "$ESCAPED_TEXT" | tail -n 1)/d" "$SETTINGS_PHP" + # Removing DDEV generated code. + # Removes if close bracket below require $ddev_settings. + sed -i '/require \$ddev_settings;/ {n;d}' "$SETTINGS_PHP" + # Removes DDEV comment. + sed -i '/Automatically .* by ddev/d' "$SETTINGS_PHP" + # Removes all $ddev_settings instances. + sed -i '/\$ddev_settings/d' "$SETTINGS_PHP" # Reinstall DDEV code block. ddev config --auto From 782ca7f8946085d941e49b1b0e4f0b344d511fa1 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 7 Jan 2025 16:22:47 -0500 Subject: [PATCH 107/159] ISSUE-204: debug --- .github/workflows/TestAcquia.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 1bca039a1..ee77dc354 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -71,6 +71,9 @@ jobs: # Reinstall DDEV code block. ddev config --auto + - name: Debug + run: cat web/sites/default/settings.php + - name: Install Drupal run: | ddev drush site:install minimal -y From 42854ae84b778b5e3c9205308c2ead221ef18ff4 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 7 Jan 2025 16:38:25 -0500 Subject: [PATCH 108/159] ISSUE-204: fixing ddev settings --- .github/workflows/TestAcquia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index ee77dc354..3e65e1ed4 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -54,7 +54,7 @@ jobs: ddev composer config --no-plugins allow-plugins.acquia/drupal-recommended-settings true ddev composer require acquia/drupal-recommended-settings - yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml + yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml -y # Move DDEV settings to the bottom again. # When acquia/drupal-recommended-settings modifies the settings.php From bbd3020544c66e31539a69673a50c42d5815bd17 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 7 Jan 2025 16:42:04 -0500 Subject: [PATCH 109/159] ISSUE-204: apparently not needed :shrug: --- .github/workflows/TestAcquia.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 3e65e1ed4..af9652893 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -54,13 +54,13 @@ jobs: ddev composer config --no-plugins allow-plugins.acquia/drupal-recommended-settings true ddev composer require acquia/drupal-recommended-settings - yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml -y + yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml # Move DDEV settings to the bottom again. # When acquia/drupal-recommended-settings modifies the settings.php # breaks DDEV database default connection. So, we move the DDEV # settings to the bottom of the settings page again. - SETTINGS_PHP="web/sites/default/settings.php" + SETTINGS_PHP="docroot/sites/default/settings.php" # Removing DDEV generated code. # Removes if close bracket below require $ddev_settings. sed -i '/require \$ddev_settings;/ {n;d}' "$SETTINGS_PHP" From f3678741ff8c49aeeb0d0041aba24792567fce8e Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 7 Jan 2025 16:45:39 -0500 Subject: [PATCH 110/159] ISSUE-204: debug last lines --- .github/workflows/TestAcquia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index af9652893..0e63cceb3 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -72,7 +72,7 @@ jobs: ddev config --auto - name: Debug - run: cat web/sites/default/settings.php + run: tail docroot/sites/default/settings.php - name: Install Drupal run: | From a6c33a34dbb2330493333813698795bead977797 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 7 Jan 2025 17:49:47 -0500 Subject: [PATCH 111/159] ISSUE-204: debug last 50 lines... insert acquia recommended settings manually --- .github/workflows/TestAcquia.yml | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 0e63cceb3..534b7334f 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -51,28 +51,15 @@ jobs: ddev composer require lullabot/drainpipe --with-all-dependencies # Recommended settings for Acquia - ddev composer config --no-plugins allow-plugins.acquia/drupal-recommended-settings true + ddev composer config --no-plugins allow-plugins.acquia/drupal-recommended-settings false ddev composer require acquia/drupal-recommended-settings + # Apply Acquia recommended settings manually, before DDEV settings. + sed -i '/\/\/ Automatically generated include for settings managed by ddev./i require DRUPAL_ROOT . "/../vendor/acquia/drupal-recommended-settings/settings/acquia-recommended.settings.php";' settings.php yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml - # Move DDEV settings to the bottom again. - # When acquia/drupal-recommended-settings modifies the settings.php - # breaks DDEV database default connection. So, we move the DDEV - # settings to the bottom of the settings page again. - SETTINGS_PHP="docroot/sites/default/settings.php" - # Removing DDEV generated code. - # Removes if close bracket below require $ddev_settings. - sed -i '/require \$ddev_settings;/ {n;d}' "$SETTINGS_PHP" - # Removes DDEV comment. - sed -i '/Automatically .* by ddev/d' "$SETTINGS_PHP" - # Removes all $ddev_settings instances. - sed -i '/\$ddev_settings/d' "$SETTINGS_PHP" - # Reinstall DDEV code block. - ddev config --auto - - name: Debug - run: tail docroot/sites/default/settings.php + run: tail -n 50 docroot/sites/default/settings.php - name: Install Drupal run: | From 224272d34c6d703d07d1300bad46c32a4c086669 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 7 Jan 2025 18:34:41 -0500 Subject: [PATCH 112/159] ISSUE-204: fix typo] --- .github/workflows/TestAcquia.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 534b7334f..af8e5d206 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -54,7 +54,9 @@ jobs: ddev composer config --no-plugins allow-plugins.acquia/drupal-recommended-settings false ddev composer require acquia/drupal-recommended-settings # Apply Acquia recommended settings manually, before DDEV settings. - sed -i '/\/\/ Automatically generated include for settings managed by ddev./i require DRUPAL_ROOT . "/../vendor/acquia/drupal-recommended-settings/settings/acquia-recommended.settings.php";' settings.php + sed -i '/\/\/ Automatically generated include for settings managed by ddev./i require DRUPAL_ROOT . \ + "/../vendor/acquia/drupal-recommended-settings/settings/acquia-recommended.settings.php";' \ + docroot/sites/default/settings.php yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml From 6129c3fd59675cdd783e97468e8bb0016c8cdb72 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 27 Jan 2025 17:20:10 -0500 Subject: [PATCH 113/159] ISSUE-204: create .htaccess for configuration folder --- .github/workflows/TestAcquia.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index af8e5d206..ea2305a2a 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -65,10 +65,17 @@ jobs: - name: Install Drupal run: | + ddev drush site:install minimal -y echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php ddev drush config:export -y + # When config is move to ../config, the .htaccess to avoid execution + # is not create automatically. Running cron once does that for us. + ddev drush cron + + cp config/default/.htaccess config/default + - name: Create .drainpipeignore run: | echo "/web/sites/default/files" >> .drainpipeignore From a81cad124ebebdb10b29a7350b35b7580dd83aa7 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 27 Jan 2025 17:30:11 -0500 Subject: [PATCH 114/159] ISSUE-204: removing uneeded commands --- .github/workflows/TestAcquia.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index ea2305a2a..44d05f73e 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -74,8 +74,6 @@ jobs: # is not create automatically. Running cron once does that for us. ddev drush cron - cp config/default/.htaccess config/default - - name: Create .drainpipeignore run: | echo "/web/sites/default/files" >> .drainpipeignore From 1dfa946410afb35b279727fd7af29c5933686e8e Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 27 Jan 2025 17:45:48 -0500 Subject: [PATCH 115/159] ISSUE-204: debug --- .github/workflows/TestAcquia.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 44d05f73e..67675134d 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -70,10 +70,13 @@ jobs: echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php ddev drush config:export -y - # When config is move to ../config, the .htaccess to avoid execution + # When config is moved to ../config, the .htaccess to avoid execution # is not create automatically. Running cron once does that for us. ddev drush cron + - name: Debug + run: cat config/.htaccess + - name: Create .drainpipeignore run: | echo "/web/sites/default/files" >> .drainpipeignore From bcf88ad4109894056435147c4ee91d6d0aae1ff5 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 27 Jan 2025 17:54:10 -0500 Subject: [PATCH 116/159] ISSUE-204: fixing potential path mismatch --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index e99b261f7..1f6e20581 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -34,7 +34,7 @@ runs: - name: Put site in Maintenance Mode run: | - source .github/actions/drainpipe/set-env/bash_aliases + source .github/actions/drainpipe/common/set-env/bash_aliases echo "API KEY" echo ${{ inputs.api-key }}| cut -c 1-10 From 734fc734d2cec578bd2da0e000a399caf3be4b8a Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 27 Jan 2025 18:08:30 -0500 Subject: [PATCH 117/159] ISSUE-204: debug --- scaffold/github/actions/acquia/deploy/action.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 1f6e20581..430f7d371 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -34,7 +34,19 @@ runs: - name: Put site in Maintenance Mode run: | - source .github/actions/drainpipe/common/set-env/bash_aliases + # @TODO: restore + # source .github/actions/drainpipe/set-env/bash_aliases + + # @TODO: remove + # Temporarily adding drainpipe_exec here. + drainpipe_exec() { + if [ "$DRAINPIPE_DDEV" == "true" ]; then + ddev exec "$@" + else + eval "$@" + fi + } + echo "API KEY" echo ${{ inputs.api-key }}| cut -c 1-10 From ee8fdfc277ec98a9d2df16a393355dbc0d49a587 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 27 Jan 2025 18:20:31 -0500 Subject: [PATCH 118/159] ISSUE-204: debug --- scaffold/github/actions/acquia/deploy/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 430f7d371..1f52b422c 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -80,7 +80,9 @@ runs: # drainpipe_exec "./vendor/bin/drush site:alias" - ddev task drupal:maintenance:on site=@lullabotsandbox.dev + # @TODO: restore, debug + # ddev task drupal:maintenance:on site=@lullabotsandbox.dev + # drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" # ddev task drupal:maintenance:on site=@lullabotsandbox.dev From 31393a9dceecbd62a626bfbb5ccba5f2e54d863a Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 27 Jan 2025 18:39:32 -0500 Subject: [PATCH 119/159] ISSUE-204: avoid drainpipe_exec not found --- scaffold/github/actions/acquia/deploy/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 1f52b422c..24ed3747a 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -114,6 +114,8 @@ runs: - name: Take site out of Maintenance Mode run: | + source .github/actions/drainpipe/set-env/bash_aliases + drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" shell: bash From ab5444f5f288a153f2e9ed979fa8e7f34b40c994 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 27 Jan 2025 18:45:13 -0500 Subject: [PATCH 120/159] ISSUE-204: restoring site maintenance commands --- .../github/actions/acquia/deploy/action.yml | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 24ed3747a..10cff3544 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -34,22 +34,7 @@ runs: - name: Put site in Maintenance Mode run: | - # @TODO: restore - # source .github/actions/drainpipe/set-env/bash_aliases - - # @TODO: remove - # Temporarily adding drainpipe_exec here. - drainpipe_exec() { - if [ "$DRAINPIPE_DDEV" == "true" ]; then - ddev exec "$@" - else - eval "$@" - fi - } - - - echo "API KEY" - echo ${{ inputs.api-key }}| cut -c 1-10 + source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENVIRONMENT="${{ inputs.environment }}" @@ -83,11 +68,11 @@ runs: # @TODO: restore, debug # ddev task drupal:maintenance:on site=@lullabotsandbox.dev - # drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" + drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" # ddev task drupal:maintenance:on site=@lullabotsandbox.dev -# drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" + # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" shell: bash - name: Push to Acquia @@ -116,7 +101,7 @@ runs: run: | source .github/actions/drainpipe/set-env/bash_aliases - drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@${{ inputs.environment }}" + drainpipe_exec "./vendor/bin/task drupal:maintenance:off site=@${{ inputs.environment }}" shell: bash From cb8e1abecff11cb9959312ccb4dab0fc2fae74c1 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 09:27:08 -0500 Subject: [PATCH 121/159] ISSUE-204: debug --- .../github/actions/acquia/deploy/action.yml | 40 ++++++------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 10cff3544..82574279c 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -32,6 +32,7 @@ runs: environment: ${{ inputs.environment }} - name: Put site in Maintenance Mode + shell: bash run: | source .github/actions/drainpipe/set-env/bash_aliases @@ -39,41 +40,26 @@ runs: drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENVIRONMENT="${{ inputs.environment }}" APPLICATION=${ENVIRONMENT%.*} - drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - - # echo "======================================" - # drainpipe_exec "ls -al /var/www/html/drush" - # echo "======================================" - # drainpipe_exec "ls -al /var/www/html/drush/sites/lullabotsandbox.site.yml" - drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" + - name: debug lullabotsandbox.site.yml before + shell: bash + run: cat lullabotsandbox.site.yml - hostname="${{ inputs.environment-url }}" - hostname="${hostname#*://}" + - name: continue + shell: bash + run: | + # Avoid using drush9 + drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - - - # # drainpipe_exec "ssh-keyscan -T 60 -t rsa,ecdsa,ed25519 "$hostname" >> ~/.ssh/known_hosts" - - # ddev drush version - - # # debug site aliases - # ddev drush site:alias - - # drainpipe_exec "./vendor/bin/drush site:alias" - - # @TODO: restore, debug - # ddev task drupal:maintenance:on site=@lullabotsandbox.dev - drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" - # ddev task drupal:maintenance:on site=@lullabotsandbox.dev - - # drainpipe_exec "./vendor/bin/task drupal:maintenance:on site=@lullabotsandbox.dev" + - name: debug lullabotsandbox.site.yml after shell: bash + run: cat lullabotsandbox.site.yml + - name: Push to Acquia uses: ./drainpipe/scaffold/github/actions/acquia/push From 76810dffcfcd4de2b06fe37d175f3d13117581e8 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 09:31:35 -0500 Subject: [PATCH 122/159] ISSUE-204: debug --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 82574279c..0c4396a62 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -45,7 +45,7 @@ runs: - name: debug lullabotsandbox.site.yml before shell: bash - run: cat lullabotsandbox.site.yml + run: cat /var/www/html/drush/sites/lullabotsandbox.site.yml - name: continue shell: bash @@ -58,7 +58,7 @@ runs: - name: debug lullabotsandbox.site.yml after shell: bash - run: cat lullabotsandbox.site.yml + run: cat /var/www/html/drush/sites/lullabotsandbox.site.yml - name: Push to Acquia From 0f77522a25bdda0cdf955221081c27d53068a0d1 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 09:37:12 -0500 Subject: [PATCH 123/159] ISSUE-204: debug --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 0c4396a62..3d5438a3f 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -45,7 +45,7 @@ runs: - name: debug lullabotsandbox.site.yml before shell: bash - run: cat /var/www/html/drush/sites/lullabotsandbox.site.yml + run: drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" - name: continue shell: bash @@ -58,7 +58,7 @@ runs: - name: debug lullabotsandbox.site.yml after shell: bash - run: cat /var/www/html/drush/sites/lullabotsandbox.site.yml + run: drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" - name: Push to Acquia From 10209c716a1202647368285138a264ac97a9e599 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 10:00:49 -0500 Subject: [PATCH 124/159] ISSUE-204: avoid changing aliases file, test --- scaffold/github/actions/acquia/deploy/action.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 3d5438a3f..78f885de7 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -43,22 +43,22 @@ runs: drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - - name: debug lullabotsandbox.site.yml before - shell: bash - run: drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" + # - name: debug lullabotsandbox.site.yml before + # shell: bash + # run: drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" - name: continue shell: bash run: | # Avoid using drush9 - drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + # drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" - - name: debug lullabotsandbox.site.yml after - shell: bash - run: drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" + # - name: debug lullabotsandbox.site.yml after + # shell: bash + # run: drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" - name: Push to Acquia From b124f5f242ee21e73537fce93554e02431d3101c Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 10:08:36 -0500 Subject: [PATCH 125/159] ISSUE-204: use drainpipe_exec --- scaffold/github/actions/acquia/deploy/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 78f885de7..0941345dc 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -51,6 +51,8 @@ runs: shell: bash run: | + source .github/actions/drainpipe/set-env/bash_aliases + # Avoid using drush9 # drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" From a3aa03308ceb4d3fcccc0399858966f5df9cd7cf Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 10:15:27 -0500 Subject: [PATCH 126/159] ISSUE-204: debug --- scaffold/github/actions/acquia/deploy/action.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 0941345dc..1e7677fdc 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -53,8 +53,18 @@ runs: source .github/actions/drainpipe/set-env/bash_aliases + + echo "BEFORE" + drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" + # Avoid using drush9 - # drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + + + echo "AFTER" + drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" + + drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" From 98572c7a0c1d42a3fe0ff5b2dae3ad430b35640d Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 10:43:55 -0500 Subject: [PATCH 127/159] ISSUE-204: specify root https://docs.acquia.com/acquia-cloud-platform/manage-apps/command-line/drush\#section-specifying-a-version-of-drush-in-commands --- tasks/drupal.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/drupal.yml b/tasks/drupal.yml index 2aedd941e..df8b9c9da 100644 --- a/tasks/drupal.yml +++ b/tasks/drupal.yml @@ -68,7 +68,7 @@ tasks: - ./vendor/bin/drush {{.site}} --yes cache:rebuild - ./vendor/bin/drush {{.site}} --yes deploy:hook - | - # drush config:status --format=json is outputting notices in Pantheon even with the json format, + # drush config:status --format=json is outputting notices in Pantheon even with the json format, # so we need to tail the last line. config_status_output=$(./vendor/bin/drush {{.site}} config:status --format=json --state=Different | tail -n1) if [[ $config_status_output != '[]' ]]; then @@ -81,8 +81,8 @@ tasks: maintenance:on: desc: Turn on Maintenance Mode cmds: - - ./vendor/bin/drush {{.site}} --yes state:set system.maintenance_mode 1 --input-format=integer + - ./vendor/bin/drush {{.site}} --root=/mnt/gfs/lullabotsandbox.dev/livedev/docroot --yes state:set system.maintenance_mode 1 --input-format=integer maintenance:off: desc: Turn off Maintenance Mode cmds: - - ./vendor/bin/drush {{.site}} --yes state:set system.maintenance_mode 0 --input-format=integer + - ./vendor/bin/drush {{.site}} --root=/mnt/gfs/lullabotsandbox.dev/livedev/docroot --yes state:set system.maintenance_mode 0 --input-format=integer From a6ccff86bea2963c5cab29c2dcfd198b59497b51 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 11:15:42 -0500 Subject: [PATCH 128/159] ISSUE-204: potential better way of avoiding drush, remove *.paths --- scaffold/github/actions/acquia/deploy/action.yml | 3 ++- tasks/drupal.yml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 1e7677fdc..9373b55c5 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -58,7 +58,8 @@ runs: drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" # Avoid using drush9 - drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + # drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + drainpipe_exec "yq eval '.. | select(has("paths")) | .paths' /var/www/html/drush/sites/lullabotsandbox.site.yml" echo "AFTER" diff --git a/tasks/drupal.yml b/tasks/drupal.yml index df8b9c9da..72c6ac975 100644 --- a/tasks/drupal.yml +++ b/tasks/drupal.yml @@ -81,8 +81,8 @@ tasks: maintenance:on: desc: Turn on Maintenance Mode cmds: - - ./vendor/bin/drush {{.site}} --root=/mnt/gfs/lullabotsandbox.dev/livedev/docroot --yes state:set system.maintenance_mode 1 --input-format=integer + - ./vendor/bin/drush {{.site}} --yes state:set system.maintenance_mode 1 --input-format=integer maintenance:off: desc: Turn off Maintenance Mode cmds: - - ./vendor/bin/drush {{.site}} --root=/mnt/gfs/lullabotsandbox.dev/livedev/docroot --yes state:set system.maintenance_mode 0 --input-format=integer + - ./vendor/bin/drush {{.site}} --yes state:set system.maintenance_mode 0 --input-format=integer From a19b94eba3dba4b21ecc06c89f12e339a445144e Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 11:19:41 -0500 Subject: [PATCH 129/159] ISSUE-204: fix typo --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 9373b55c5..448a02ce8 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -59,7 +59,7 @@ runs: # Avoid using drush9 # drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" - drainpipe_exec "yq eval '.. | select(has("paths")) | .paths' /var/www/html/drush/sites/lullabotsandbox.site.yml" + drainpipe_exec "yq eval '.. | select(has(\"paths\")) | .paths' /var/www/html/drush/sites/lullabotsandbox.site.yml" echo "AFTER" From 65594c1703c650626357eede04d413b74115d425 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 11:36:54 -0500 Subject: [PATCH 130/159] ISSUE-204: fix typo --- scaffold/github/actions/acquia/deploy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 448a02ce8..d181ac3df 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -59,7 +59,7 @@ runs: # Avoid using drush9 # drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" - drainpipe_exec "yq eval '.. | select(has(\"paths\")) | .paths' /var/www/html/drush/sites/lullabotsandbox.site.yml" + drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/lullabotsandbox.site.yml" echo "AFTER" From 5ce6c01219d05c0719d4e81b7eef0b4c9fa200ec Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 11:51:54 -0500 Subject: [PATCH 131/159] ISSUE-204: remove debugging commands --- .github/workflows/TestAcquia.yml | 6 ---- .../github/actions/acquia/deploy/action.yml | 31 ++----------------- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 67675134d..fad6c6cdf 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -60,9 +60,6 @@ jobs: yq -i '.includes.acquia="./vendor/lullabot/drainpipe/tasks/acquia.yml"' Taskfile.yml - - name: Debug - run: tail -n 50 docroot/sites/default/settings.php - - name: Install Drupal run: | @@ -74,9 +71,6 @@ jobs: # is not create automatically. Running cron once does that for us. ddev drush cron - - name: Debug - run: cat config/.htaccess - - name: Create .drainpipeignore run: | echo "/web/sites/default/files" >> .drainpipeignore diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index d181ac3df..8cdae8d50 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -40,40 +40,15 @@ runs: drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENVIRONMENT="${{ inputs.environment }}" APPLICATION=${ENVIRONMENT%.*} - drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" - # - name: debug lullabotsandbox.site.yml before - # shell: bash - # run: drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" - - - name: continue - shell: bash - run: | - - source .github/actions/drainpipe/set-env/bash_aliases - - - echo "BEFORE" - drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" - - # Avoid using drush9 - # drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" + # Avoid using drush9, it seems to be an Acquia issue. + # https://docs.acquia.com/acquia-cloud-platform/manage-apps/command-line/drush#section-specifying-a-version-of-drush-in-commands + # Removes *.paths where drush9 is specified. drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/lullabotsandbox.site.yml" - - - echo "AFTER" - drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" - - drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" - # - name: debug lullabotsandbox.site.yml after - # shell: bash - # run: drainpipe_exec "cat /var/www/html/drush/sites/lullabotsandbox.site.yml" - - - name: Push to Acquia uses: ./drainpipe/scaffold/github/actions/acquia/push with: From c484cfd5021def49117e9a2d10d20e040bc62cd1 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 12:36:36 -0500 Subject: [PATCH 132/159] ISSUE-204: final changes --- .github/workflows/TestAcquia.yml | 8 +++++--- scaffold/github/actions/acquia/deploy/action.yml | 2 +- tasks/drupal.yml | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index fad6c6cdf..11cea6348 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -53,7 +53,8 @@ jobs: # Recommended settings for Acquia ddev composer config --no-plugins allow-plugins.acquia/drupal-recommended-settings false ddev composer require acquia/drupal-recommended-settings - # Apply Acquia recommended settings manually, before DDEV settings. + + # Acquia recommended settings before DDEV settings. sed -i '/\/\/ Automatically generated include for settings managed by ddev./i require DRUPAL_ROOT . \ "/../vendor/acquia/drupal-recommended-settings/settings/acquia-recommended.settings.php";' \ docroot/sites/default/settings.php @@ -67,8 +68,9 @@ jobs: echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php ddev drush config:export -y - # When config is moved to ../config, the .htaccess to avoid execution - # is not create automatically. Running cron once does that for us. + # When config is moved to ../config, the .htaccess to avoid code + # execution is not created automatically. Running cron once creates + # the needed .htaccess file which improves security. ddev drush cron - name: Create .drainpipeignore diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 8cdae8d50..f9b033265 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -73,8 +73,8 @@ runs: - name: Take site out of Maintenance Mode run: | - source .github/actions/drainpipe/set-env/bash_aliases + source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "./vendor/bin/task drupal:maintenance:off site=@${{ inputs.environment }}" shell: bash diff --git a/tasks/drupal.yml b/tasks/drupal.yml index 72c6ac975..2baecefd4 100644 --- a/tasks/drupal.yml +++ b/tasks/drupal.yml @@ -85,4 +85,4 @@ tasks: maintenance:off: desc: Turn off Maintenance Mode cmds: - - ./vendor/bin/drush {{.site}} --yes state:set system.maintenance_mode 0 --input-format=integer + - ./vendor/bin/drush {{.site}} --yes state:set system.maintenance_mode 0 --input-format=integer From 380e636c732ffde9f5e0b7886c27fc7751f03d00 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 15:40:18 -0500 Subject: [PATCH 133/159] ISSUE-204: site UUID consistent --- .github/workflows/TestAcquia.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 11cea6348..2eef50c81 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -66,6 +66,9 @@ jobs: ddev drush site:install minimal -y echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php + + # We need a consistent site ID. + ddev drush config-set "system.site" uuid "6b7eca14-f1b5-4059-901e-cbe5ffe59998" ddev drush config:export -y # When config is moved to ../config, the .htaccess to avoid code @@ -90,10 +93,10 @@ jobs: echo "/drainpipe" >> .drainpipeignore ddev task snapshot:directory directory=/tmp/release - - name: Clone from test to dev + - name: Clone from production to dev uses: ./drainpipe/scaffold/github/actions/acquia/clone-env with: - source-environment: lullabotsandbox.test + source-environment: lullabotsandbox.prod target-environment: lullabotsandbox.dev api-key: ${{ secrets.ACQUIA_API_KEY }} api-secret: ${{ secrets.ACQUIA_API_SECRET }} From 9bc99783ddfb6fdb8cf0275907f3486a4e9fc6bb Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 16:05:54 -0500 Subject: [PATCH 134/159] ISSUE-204: restore [skip ci] --- scaffold/github/actions/acquia/push/action.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index 6559aaab6..9a7c77576 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -27,18 +27,11 @@ runs: drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENV_INFO=$(drainpipe_exec "acli --no-interaction api:environments:find ${{ inputs.environment }}") - - echo "=========================" - echo ${{ inputs.environment }} - echo "=========================" - - echo $ENV_INFO - - # VCS_TYPE=$(echo $ENV_INFO | jq -r ".vcs.type") - # if [ "$VCS_TYPE" != "git" ]; then - # echo "Unrecognised VCS type" - # exit 1 - # fi + VCS_TYPE=$(echo $ENV_INFO | jq -r ".vcs.type") + if [ "$VCS_TYPE" != "git" ]; then + echo "Unrecognised VCS type" + exit 1 + fi BRANCH=$(echo $ENV_INFO | jq -r ".vcs.path") REMOTE=$(echo $ENV_INFO | jq -r ".vcs.url") From 4ce0ba1e900ba4bdf91d16a143782aec496448cb Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 16:06:04 -0500 Subject: [PATCH 135/159] ISSUE-204: debug --- scaffold/github/actions/acquia/update/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/update/action.yml b/scaffold/github/actions/acquia/update/action.yml index 4784d3981..24c49ef5c 100644 --- a/scaffold/github/actions/acquia/update/action.yml +++ b/scaffold/github/actions/acquia/update/action.yml @@ -26,14 +26,16 @@ runs: drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" # Avoid using drush9 - drainpipe_exec "sed -i.bak 's|drush9|/var/www/html/lullabotsandbox.dev/vendor/bin/drush|g' /var/www/html/drush/sites/lullabotsandbox.site.yml" - + drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/lullabotsandbox.site.yml" if [ "${{ inputs.run-installer }}" == "true" ]; then + echo "Running site install" drainpipe_exec "./vendor/bin/drush @${{ inputs.environment }} --yes site:install --existing-config" elif drainpipe_exec "./vendor/bin/task -l | grep '* update: ')"; then + echo "Running task update" drainpipe_exec "./vendor/bin/task update site=@${{ inputs.environment }}" else + echo "Running task drupal:update" drainpipe_exec "./vendor/bin/task drupal:update site=@${{ inputs.environment }}" fi shell: bash From 0d2e13d9798374dc85e2064d02c4c23c75293253 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 16:19:39 -0500 Subject: [PATCH 136/159] ISSUE-204: run site-install if required, then update drupal --- scaffold/github/actions/acquia/update/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/update/action.yml b/scaffold/github/actions/acquia/update/action.yml index 24c49ef5c..d5f1b4879 100644 --- a/scaffold/github/actions/acquia/update/action.yml +++ b/scaffold/github/actions/acquia/update/action.yml @@ -31,7 +31,9 @@ runs: if [ "${{ inputs.run-installer }}" == "true" ]; then echo "Running site install" drainpipe_exec "./vendor/bin/drush @${{ inputs.environment }} --yes site:install --existing-config" - elif drainpipe_exec "./vendor/bin/task -l | grep '* update: ')"; then + fi + + if drainpipe_exec "./vendor/bin/task -l | grep '* update: ')"; then echo "Running task update" drainpipe_exec "./vendor/bin/task update site=@${{ inputs.environment }}" else From 8df50732c945950bb477d28ace11835927b98467 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 28 Jan 2025 16:31:30 -0500 Subject: [PATCH 137/159] ISSUE-204: fix typo --- scaffold/github/actions/acquia/update/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/update/action.yml b/scaffold/github/actions/acquia/update/action.yml index d5f1b4879..ec8f85665 100644 --- a/scaffold/github/actions/acquia/update/action.yml +++ b/scaffold/github/actions/acquia/update/action.yml @@ -17,6 +17,7 @@ runs: using: "composite" steps: - name: Update site on Acquia + shell: bash run: | source .github/actions/drainpipe/set-env/bash_aliases @@ -33,11 +34,10 @@ runs: drainpipe_exec "./vendor/bin/drush @${{ inputs.environment }} --yes site:install --existing-config" fi - if drainpipe_exec "./vendor/bin/task -l | grep '* update: ')"; then + if drainpipe_exec "./vendor/bin/task -l | grep -q '* update: '"; then echo "Running task update" drainpipe_exec "./vendor/bin/task update site=@${{ inputs.environment }}" else echo "Running task drupal:update" drainpipe_exec "./vendor/bin/task drupal:update site=@${{ inputs.environment }}" fi - shell: bash From 9a0dd7fc0a3bd57a6b0148102dd849239b6f2bad Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 3 Feb 2025 11:42:37 -0500 Subject: [PATCH 138/159] ISSUE-204: wait for the code switch to end --- scaffold/github/actions/acquia/push/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index 9a7c77576..4c99ff67c 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -37,7 +37,7 @@ runs: REMOTE=$(echo $ENV_INFO | jq -r ".vcs.url") drainpipe_exec "./vendor/bin/task deploy:git directory=/tmp/release branch=\"$BRANCH\" remote=\"$REMOTE\" message=\"${{ inputs.commit-message }}\"" # Run code-switch to the same branch so we wait for everything to sync. - drainpipe_exec "acli api:environments:code-switch ${{ inputs.environment }} \"$BRANCH\"" + drainpipe_exec "acli api:environments:code-switch --task-wait ${{ inputs.environment }} \"$BRANCH\"" shell: bash From e24b4a738dbcb878bf5fb993d192239f52e96803 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 3 Feb 2025 12:00:07 -0500 Subject: [PATCH 139/159] to run workflows From a0087ca83550b0557b4bed9f45bf793b93c5332b Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 14 Feb 2025 11:19:51 -0500 Subject: [PATCH 140/159] ISSUE-204: Parameterize Acquia deployment action --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- scaffold/github/actions/acquia/update/action.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index f9b033265..3cc09c4e1 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -45,9 +45,9 @@ runs: # Avoid using drush9, it seems to be an Acquia issue. # https://docs.acquia.com/acquia-cloud-platform/manage-apps/command-line/drush#section-specifying-a-version-of-drush-in-commands # Removes *.paths where drush9 is specified. - drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/lullabotsandbox.site.yml" + drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/${APPLICATION}.site.yml" drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" + drainpipe_exec "task drupal:maintenance:on site=@${{ inputs.environment }}" - name: Push to Acquia uses: ./drainpipe/scaffold/github/actions/acquia/push diff --git a/scaffold/github/actions/acquia/update/action.yml b/scaffold/github/actions/acquia/update/action.yml index ec8f85665..5d732f8ec 100644 --- a/scaffold/github/actions/acquia/update/action.yml +++ b/scaffold/github/actions/acquia/update/action.yml @@ -27,7 +27,7 @@ runs: drainpipe_exec "acli remote:aliases:download --no-interaction $APPLICATION" # Avoid using drush9 - drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/lullabotsandbox.site.yml" + drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/${APPLICATION}.site.yml" if [ "${{ inputs.run-installer }}" == "true" ]; then echo "Running site install" From b5feb6d2f84ad4441b8dff4249ad6d50dfe918ba Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 14 Feb 2025 11:58:22 -0500 Subject: [PATCH 141/159] ISSUE-204: Refactor Acquia deployment action to dynamically fetch environment URL --- .github/workflows/TestAcquia.yml | 1 - .../github/actions/acquia/deploy/action.yml | 18 +++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 2eef50c81..72fb49265 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -106,7 +106,6 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} environment: lullabotsandbox.dev - environment-url: https://lullabotsandboxffi2ugpgwh.devcloud.acquia-sites.com run-installer: true commit-message: ${{ github.sha }} api-key: ${{ secrets.ACQUIA_API_KEY }} diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 3cc09c4e1..b71606c97 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -1,5 +1,5 @@ -name: 'Deploy a branch to Acquia' -description: 'Deploys a review app to an Acquia Environment' +name: "Deploy a branch to Acquia" +description: "Deploys a review app to an Acquia Environment" inputs: github-token: description: "GitHub token as generated automatically in secrets.GITHUB_TOKEN" @@ -7,9 +7,6 @@ inputs: environment: description: "The environment to push to, either uuid or alias" required: true - environment-url: - description: "The environment URL" - required: true run-installer: description: "Whether or not to run the Drupal site installer. Defaults to false." required: false @@ -47,7 +44,12 @@ runs: # Removes *.paths where drush9 is specified. drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/${APPLICATION}.site.yml" drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - drainpipe_exec "task drupal:maintenance:on site=@${{ inputs.environment }}" + drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" + + # Define variables + aliases_yml="/var/www/html/drush/sites/${APPLICATION}.site.yml" + # Extract the dev.uri value + echo "env_uri=$(yq e ".$env.uri" "$aliases_yml")" >> $GITHUB_ENV - name: Push to Acquia uses: ./drainpipe/scaffold/github/actions/acquia/push @@ -69,7 +71,7 @@ runs: uses: ./.github/actions/drainpipe/deployment-status with: github-token: ${{ inputs.github-token }} - environment-url: ${{ inputs.environment-url }} + environment-url: ${{ env_uri }} - name: Take site out of Maintenance Mode run: | @@ -77,5 +79,3 @@ runs: source .github/actions/drainpipe/set-env/bash_aliases drainpipe_exec "./vendor/bin/task drupal:maintenance:off site=@${{ inputs.environment }}" shell: bash - - From 469809678b8a6130406af5d3f02e6342cc2409c2 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 14 Feb 2025 12:05:46 -0500 Subject: [PATCH 142/159] ISSUE-204: Update Acquia deployment action environment URI variable and use it to set deployment status --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index b71606c97..0a75165ee 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -49,7 +49,7 @@ runs: # Define variables aliases_yml="/var/www/html/drush/sites/${APPLICATION}.site.yml" # Extract the dev.uri value - echo "env_uri=$(yq e ".$env.uri" "$aliases_yml")" >> $GITHUB_ENV + echo "acquia_env_uri=$(yq e ".$env.uri" "$aliases_yml")" >> $GITHUB_ENV - name: Push to Acquia uses: ./drainpipe/scaffold/github/actions/acquia/push @@ -71,7 +71,7 @@ runs: uses: ./.github/actions/drainpipe/deployment-status with: github-token: ${{ inputs.github-token }} - environment-url: ${{ env_uri }} + environment-url: ${{ env.acquia_env_uri }} - name: Take site out of Maintenance Mode run: | From 610a82f351d138c099e4d6cc9e09da8764930c28 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 14 Feb 2025 15:58:54 -0500 Subject: [PATCH 143/159] ISSUE-204: Add fallback for DRAINPIPE_SHA when empty or null - When creating a Github Deployment, a SHA or reference is needed, so this fallback may work when we the action is not being triggering by a PR push event --- .github/actions/drainpipe/common/set-env/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/drainpipe/common/set-env/action.yml b/.github/actions/drainpipe/common/set-env/action.yml index 32862b6fe..63f91cad1 100644 --- a/.github/actions/drainpipe/common/set-env/action.yml +++ b/.github/actions/drainpipe/common/set-env/action.yml @@ -14,4 +14,9 @@ runs: echo "Setting Drainpipe environment variables:" echo "DRAINPIPE_PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')" >> $GITHUB_ENV echo "DRAINPIPE_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)" >> $GITHUB_ENV + + if [ -z "$DRAINPIPE_SHA" ] || [ "$DRAINPIPE_SHA" = "null" ]; then + echo "DRAINPIPE_SHA=$DRAINPIPE_PR_NUMBER" >> $GITHUB_ENV + fi + shell: bash From 0ee1c80cfc41d616eb899f6d00db6ff56b849e2d Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 14 Feb 2025 16:13:23 -0500 Subject: [PATCH 144/159] ISSUE-204: Add fallback for DRAINPIPE_SHA when empty or null - When creating a Github Deployment, a SHA or reference is needed, so this fallback may work when we the action is not being triggering by a PR push event --- scaffold/github/actions/common/set-env/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scaffold/github/actions/common/set-env/action.yml b/scaffold/github/actions/common/set-env/action.yml index 32862b6fe..63f91cad1 100644 --- a/scaffold/github/actions/common/set-env/action.yml +++ b/scaffold/github/actions/common/set-env/action.yml @@ -14,4 +14,9 @@ runs: echo "Setting Drainpipe environment variables:" echo "DRAINPIPE_PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')" >> $GITHUB_ENV echo "DRAINPIPE_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)" >> $GITHUB_ENV + + if [ -z "$DRAINPIPE_SHA" ] || [ "$DRAINPIPE_SHA" = "null" ]; then + echo "DRAINPIPE_SHA=$DRAINPIPE_PR_NUMBER" >> $GITHUB_ENV + fi + shell: bash From a0b3f926a5d3f16c3719e4a5f9582019089a5903 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 14 Feb 2025 16:27:37 -0500 Subject: [PATCH 145/159] ISSUE-204: using DRAINPIPE_SHA the correct way --- scaffold/github/actions/common/deployment-create/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scaffold/github/actions/common/deployment-create/action.yml b/scaffold/github/actions/common/deployment-create/action.yml index 61d857697..a6cd7fd0b 100644 --- a/scaffold/github/actions/common/deployment-create/action.yml +++ b/scaffold/github/actions/common/deployment-create/action.yml @@ -1,5 +1,5 @@ -name: 'Create a GitHub deployment' -description: 'Creates a GitHub deployment and echos the ID to the $GITHUB_ENV file' +name: "Create a GitHub deployment" +description: "Creates a GitHub deployment and echos the ID to the $GITHUB_ENV file" inputs: github-token: description: "GitHub token as generated automatically in secrets.GITHUB_TOKEN" @@ -18,7 +18,7 @@ runs: https://api.github.com/repos/$GITHUB_REPOSITORY/deployments \ -H 'Accept: application/vnd.github.v3+json' \ -H "Authorization: token ${{ inputs.github-token }}" \ - -d "{\"ref\": \"$DRAINPIPE_SHA\", \"auto_merge\": false, \"environment\": \"${{ inputs.environment }}\", \"transient_environment\": false, \"required_contexts\": [], \"description\": \"Acquia Cloud environment\"}" \ + -d "{\"ref\": \"${{ env.DRAINPIPE_SHA }}\", \"auto_merge\": false, \"environment\": \"${{ inputs.environment }}\", \"transient_environment\": false, \"required_contexts\": [], \"description\": \"Acquia Cloud environment\"}" \ ) export GITHUB_DEPLOYMENT_ID=$(echo $GITHUB_DEPLOYMENT | jq '.id') echo "GITHUB_DEPLOYMENT_ID=$GITHUB_DEPLOYMENT_ID" >> $GITHUB_ENV From cb63b2f4390cae70371191b9f5c043b926587100 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Fri, 14 Feb 2025 16:46:13 -0500 Subject: [PATCH 146/159] ISSUE-204: debug [skip ci] --- .github/actions/drainpipe/common/set-env/action.yml | 2 ++ scaffold/github/actions/common/set-env/action.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/actions/drainpipe/common/set-env/action.yml b/.github/actions/drainpipe/common/set-env/action.yml index 63f91cad1..b3a5322ec 100644 --- a/.github/actions/drainpipe/common/set-env/action.yml +++ b/.github/actions/drainpipe/common/set-env/action.yml @@ -15,7 +15,9 @@ runs: echo "DRAINPIPE_PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')" >> $GITHUB_ENV echo "DRAINPIPE_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)" >> $GITHUB_ENV + echo "DRAINPIPE_SHA: $DRAINPIPE_SHA" if [ -z "$DRAINPIPE_SHA" ] || [ "$DRAINPIPE_SHA" = "null" ]; then + echo "Rewriting DRAINPIPE_SHA to PR number because SHA is null" echo "DRAINPIPE_SHA=$DRAINPIPE_PR_NUMBER" >> $GITHUB_ENV fi diff --git a/scaffold/github/actions/common/set-env/action.yml b/scaffold/github/actions/common/set-env/action.yml index 63f91cad1..b3a5322ec 100644 --- a/scaffold/github/actions/common/set-env/action.yml +++ b/scaffold/github/actions/common/set-env/action.yml @@ -15,7 +15,9 @@ runs: echo "DRAINPIPE_PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')" >> $GITHUB_ENV echo "DRAINPIPE_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)" >> $GITHUB_ENV + echo "DRAINPIPE_SHA: $DRAINPIPE_SHA" if [ -z "$DRAINPIPE_SHA" ] || [ "$DRAINPIPE_SHA" = "null" ]; then + echo "Rewriting DRAINPIPE_SHA to PR number because SHA is null" echo "DRAINPIPE_SHA=$DRAINPIPE_PR_NUMBER" >> $GITHUB_ENV fi From b3df9d94dce017afb82adfd49fa6d6903b2298c3 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 17 Feb 2025 10:04:02 -0500 Subject: [PATCH 147/159] ISSUE-204: debug [skip ci] --- .github/actions/drainpipe/common/set-env/action.yml | 2 +- scaffold/github/actions/common/set-env/action.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/drainpipe/common/set-env/action.yml b/.github/actions/drainpipe/common/set-env/action.yml index b3a5322ec..8cf855e7e 100644 --- a/.github/actions/drainpipe/common/set-env/action.yml +++ b/.github/actions/drainpipe/common/set-env/action.yml @@ -17,7 +17,7 @@ runs: echo "DRAINPIPE_SHA: $DRAINPIPE_SHA" if [ -z "$DRAINPIPE_SHA" ] || [ "$DRAINPIPE_SHA" = "null" ]; then - echo "Rewriting DRAINPIPE_SHA to PR number because SHA is null" + echo "Rewriting DRAINPIPE_SHA to PR number because SHA is null - debug1" echo "DRAINPIPE_SHA=$DRAINPIPE_PR_NUMBER" >> $GITHUB_ENV fi diff --git a/scaffold/github/actions/common/set-env/action.yml b/scaffold/github/actions/common/set-env/action.yml index b3a5322ec..ad6fc9737 100644 --- a/scaffold/github/actions/common/set-env/action.yml +++ b/scaffold/github/actions/common/set-env/action.yml @@ -17,7 +17,9 @@ runs: echo "DRAINPIPE_SHA: $DRAINPIPE_SHA" if [ -z "$DRAINPIPE_SHA" ] || [ "$DRAINPIPE_SHA" = "null" ]; then - echo "Rewriting DRAINPIPE_SHA to PR number because SHA is null" + echo "Rewriting DRAINPIPE_SHA to PR number because SHA is null - debug2" + echo "Drainpipe SHA: $DRAINPIPE_SHA" + echo "Drainpipe PR Number: $DRAINPIPE_PR_NUMBER" echo "DRAINPIPE_SHA=$DRAINPIPE_PR_NUMBER" >> $GITHUB_ENV fi From c09a33927e077127a7c9365edcd5d32141411641 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 17 Feb 2025 10:15:35 -0500 Subject: [PATCH 148/159] ISSUE-204: debug [skip ci] --- scaffold/github/actions/common/set-env/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scaffold/github/actions/common/set-env/action.yml b/scaffold/github/actions/common/set-env/action.yml index ad6fc9737..7c4bd44b4 100644 --- a/scaffold/github/actions/common/set-env/action.yml +++ b/scaffold/github/actions/common/set-env/action.yml @@ -15,6 +15,10 @@ runs: echo "DRAINPIPE_PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')" >> $GITHUB_ENV echo "DRAINPIPE_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)" >> $GITHUB_ENV + echo "Debug :bug:" + echo "GITHUB_REF: $GITHUB_REF" + echo "GITHUB_EVENT_PATH: $GITHUB_EVENT_PATH" + echo "DRAINPIPE_SHA: $DRAINPIPE_SHA" if [ -z "$DRAINPIPE_SHA" ] || [ "$DRAINPIPE_SHA" = "null" ]; then echo "Rewriting DRAINPIPE_SHA to PR number because SHA is null - debug2" From 00e5ca2a529291d982f2fb5756a0e35d7ab68bfa Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 17 Feb 2025 10:33:53 -0500 Subject: [PATCH 149/159] ISSUE-204: debug [skip ci] --- scaffold/github/actions/common/set-env/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/scaffold/github/actions/common/set-env/action.yml b/scaffold/github/actions/common/set-env/action.yml index 7c4bd44b4..1b0eac24b 100644 --- a/scaffold/github/actions/common/set-env/action.yml +++ b/scaffold/github/actions/common/set-env/action.yml @@ -22,6 +22,7 @@ runs: echo "DRAINPIPE_SHA: $DRAINPIPE_SHA" if [ -z "$DRAINPIPE_SHA" ] || [ "$DRAINPIPE_SHA" = "null" ]; then echo "Rewriting DRAINPIPE_SHA to PR number because SHA is null - debug2" + DRAINPIPE_SHA=$DRAINPIPE_PR_NUMBER echo "Drainpipe SHA: $DRAINPIPE_SHA" echo "Drainpipe PR Number: $DRAINPIPE_PR_NUMBER" echo "DRAINPIPE_SHA=$DRAINPIPE_PR_NUMBER" >> $GITHUB_ENV From a184233240ac9c6b08b3091a5ff12bbcf47328bf Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 17 Feb 2025 10:46:01 -0500 Subject: [PATCH 150/159] ISSUE-204: Fixing/refactoring variable assignment issue --- scaffold/github/actions/common/set-env/action.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/common/set-env/action.yml b/scaffold/github/actions/common/set-env/action.yml index 1b0eac24b..40706e695 100644 --- a/scaffold/github/actions/common/set-env/action.yml +++ b/scaffold/github/actions/common/set-env/action.yml @@ -12,8 +12,11 @@ runs: steps: - run: | echo "Setting Drainpipe environment variables:" - echo "DRAINPIPE_PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')" >> $GITHUB_ENV - echo "DRAINPIPE_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)" >> $GITHUB_ENV + + DRAINPIPE_PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') + echo "DRAINPIPE_PR_NUMBER=$DRAINPIPE_PR_NUMBER" >> $GITHUB_ENV + DRAINPIPE_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha) + echo "DRAINPIPE_SHA=$DRAINPIPE_SHA" >> $GITHUB_ENV echo "Debug :bug:" echo "GITHUB_REF: $GITHUB_REF" From 81c29ef24c64fab7595c6c9218dd77943dfa2289 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 17 Feb 2025 11:15:22 -0500 Subject: [PATCH 151/159] ISSUE-204: more compatible way of setting maintenance on/off [skip ci] --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 0a75165ee..8e359cbf6 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -44,7 +44,7 @@ runs: # Removes *.paths where drush9 is specified. drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/${APPLICATION}.site.yml" drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - drainpipe_exec "task drupal:maintenance:on site=@lullabotsandbox.dev" + drainpipe_exec "drush system.maintenance_mode 1 site=@lullabotsandbox.dev" # Define variables aliases_yml="/var/www/html/drush/sites/${APPLICATION}.site.yml" @@ -77,5 +77,5 @@ runs: run: | source .github/actions/drainpipe/set-env/bash_aliases - drainpipe_exec "./vendor/bin/task drupal:maintenance:off site=@${{ inputs.environment }}" + drainpipe_exec "drush system.maintenance_mode 0 site=@${{ inputs.environment }}" shell: bash From 1ab57ab38ae9d64c3b4e3e7205614f5c3c3ece64 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 17 Feb 2025 11:16:35 -0500 Subject: [PATCH 152/159] ISSUE-204: fix typo, drush command needed [skip ci] --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 8e359cbf6..29a80ec9d 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -44,7 +44,7 @@ runs: # Removes *.paths where drush9 is specified. drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/${APPLICATION}.site.yml" drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - drainpipe_exec "drush system.maintenance_mode 1 site=@lullabotsandbox.dev" + drainpipe_exec "drush state:set system.maintenance_mode 1 --site=@${{ inputs.environment }}" # Define variables aliases_yml="/var/www/html/drush/sites/${APPLICATION}.site.yml" @@ -77,5 +77,5 @@ runs: run: | source .github/actions/drainpipe/set-env/bash_aliases - drainpipe_exec "drush system.maintenance_mode 0 site=@${{ inputs.environment }}" + drainpipe_exec "drush state:set system.maintenance_mode 0 --site=@${{ inputs.environment }}" shell: bash From 7b9493fe856ab5148d5ec24f1c54b67bdd76d770 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 17 Feb 2025 13:25:14 -0500 Subject: [PATCH 153/159] ISSUE-204: debug [skip ci] --- scaffold/github/actions/common/set-env/bash_aliases | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scaffold/github/actions/common/set-env/bash_aliases b/scaffold/github/actions/common/set-env/bash_aliases index 58fca27a8..5823c6f26 100644 --- a/scaffold/github/actions/common/set-env/bash_aliases +++ b/scaffold/github/actions/common/set-env/bash_aliases @@ -1,7 +1,9 @@ drainpipe_exec() { if [ "$DRAINPIPE_DDEV" == "true" ]; then + echo "using ddev: $@" ddev exec "$@" else + echo "using eval: $@" eval "$@" fi } From 058164ffa0eb5d70526925797202fe36c1fe3cc9 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 17 Feb 2025 14:12:54 -0500 Subject: [PATCH 154/159] ISSUE-204: use available command to change site maintenance configuration [skip ci] --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 29a80ec9d..e0fd6839a 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -44,7 +44,7 @@ runs: # Removes *.paths where drush9 is specified. drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/${APPLICATION}.site.yml" drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - drainpipe_exec "drush state:set system.maintenance_mode 1 --site=@${{ inputs.environment }}" + drainpipe_exec "drush config:set system.maintenance_mode 1 --site=@${{ inputs.environment }}" # Define variables aliases_yml="/var/www/html/drush/sites/${APPLICATION}.site.yml" @@ -77,5 +77,5 @@ runs: run: | source .github/actions/drainpipe/set-env/bash_aliases - drainpipe_exec "drush state:set system.maintenance_mode 0 --site=@${{ inputs.environment }}" + drainpipe_exec "drush config:set system.maintenance_mode 0 --site=@${{ inputs.environment }}" shell: bash From 59a950e66ee992c445819bb1c8ae690e4ec9eadc Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Mon, 17 Feb 2025 14:33:25 -0500 Subject: [PATCH 155/159] ISSUE-204: using drush syntax instead of task syntax [skip ci] --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index e0fd6839a..440c8dce6 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -44,7 +44,7 @@ runs: # Removes *.paths where drush9 is specified. drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/${APPLICATION}.site.yml" drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - drainpipe_exec "drush config:set system.maintenance_mode 1 --site=@${{ inputs.environment }}" + drainpipe_exec "drush @${{ inputs.environment }} config:set system.maintenance_mode TRUE --yes" # Define variables aliases_yml="/var/www/html/drush/sites/${APPLICATION}.site.yml" @@ -77,5 +77,5 @@ runs: run: | source .github/actions/drainpipe/set-env/bash_aliases - drainpipe_exec "drush config:set system.maintenance_mode 0 --site=@${{ inputs.environment }}" + drainpipe_exec "drush @${{ inputs.environment }} config:set system.maintenance_mode FALSE --yes" shell: bash From 3af9274423515fda9940573a5cae964c0d694448 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 18 Feb 2025 09:03:56 -0500 Subject: [PATCH 156/159] issue-204 restoring ACQUIA_SSH_PRIVATE_KEY, adding it to DDEV and adding the vcs host to known hosts --- .github/workflows/TestAcquia.yml | 1 + scaffold/github/actions/acquia/deploy/action.yml | 5 +++++ scaffold/github/actions/acquia/push/action.yml | 13 ++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/TestAcquia.yml b/.github/workflows/TestAcquia.yml index 72fb49265..743d7ecd9 100644 --- a/.github/workflows/TestAcquia.yml +++ b/.github/workflows/TestAcquia.yml @@ -110,3 +110,4 @@ jobs: commit-message: ${{ github.sha }} api-key: ${{ secrets.ACQUIA_API_KEY }} api-secret: ${{ secrets.ACQUIA_API_SECRET }} + acquia-ssh-private-key: ${{ secrets.ACQUIA_SSH_PRIVATE_KEY }} diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 440c8dce6..6d2600a7a 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -19,6 +19,10 @@ inputs: api-secret: description: "Acquia API Secret" required: true + acquia-ssh-private-key: + description: "Acquia SSH Private Key" + required: true + runs: using: "composite" steps: @@ -58,6 +62,7 @@ runs: commit-message: ${{ inputs.commit-message }} api-key: ${{ inputs.api-key }} api-secret: ${{ inputs.api-secret }} + acquia-ssh-private-key: ${{ inputs.acquia-ssh-private-key }} - name: Run updates uses: ./drainpipe/scaffold/github/actions/acquia/update diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index 4c99ff67c..5204a4291 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -13,6 +13,9 @@ inputs: api-secret: description: "Acquia API Secret" required: true + acquia-ssh-private-key: + description: "Acquia SSH Private Key" + required: true runs: using: "composite" steps: @@ -24,6 +27,9 @@ runs: echo "API KEY" echo ${{ inputs.api-key }}| cut -c 1-4 + drainpipe_exec "echo \"${{ inputs.acquia-ssh-private-key }}\" > ~/.ssh/id_rsa" + drainpipe_exec "chmod 600 ~/.ssh/id_rsa" + drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" ENV_INFO=$(drainpipe_exec "acli --no-interaction api:environments:find ${{ inputs.environment }}") @@ -34,7 +40,12 @@ runs: fi BRANCH=$(echo $ENV_INFO | jq -r ".vcs.path") - REMOTE=$(echo $ENV_INFO | jq -r ".vcs.url") + REMOTE_VCS=$(echo $ENV_INFO | jq -r ".vcs.url") + REMOTE_HOST=$(echo "$REMOTE_VCS" | awk -F'[@:]' '{print $2}') + + # Add Remote Hostf from VCS to known_hosts. + drainpipe_exec "ssh-keyscan -H $REMOTE_HOST >> ~/.ssh/known_hosts" || true + drainpipe_exec "./vendor/bin/task deploy:git directory=/tmp/release branch=\"$BRANCH\" remote=\"$REMOTE\" message=\"${{ inputs.commit-message }}\"" # Run code-switch to the same branch so we wait for everything to sync. drainpipe_exec "acli api:environments:code-switch --task-wait ${{ inputs.environment }} \"$BRANCH\"" From 6277aa2f7a19aa4341eb6a9a5701d944c1541c66 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 18 Feb 2025 09:17:04 -0500 Subject: [PATCH 157/159] ISSUE-204: adding the ssh key to known hosts --- scaffold/github/actions/acquia/push/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index 5204a4291..aa45fa2d3 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -42,10 +42,11 @@ runs: BRANCH=$(echo $ENV_INFO | jq -r ".vcs.path") REMOTE_VCS=$(echo $ENV_INFO | jq -r ".vcs.url") REMOTE_HOST=$(echo "$REMOTE_VCS" | awk -F'[@:]' '{print $2}') + REMOTE_SSH_URL=$(echo $ENV_INFO | jq -r ".ssh_url" | awk -F'[@:]' '{print $2}') # Add Remote Hostf from VCS to known_hosts. drainpipe_exec "ssh-keyscan -H $REMOTE_HOST >> ~/.ssh/known_hosts" || true - + drainpipe_exec "ssh-keyscan -H $REMOTE_SSH_URL >> ~/.ssh/known_hosts" || true drainpipe_exec "./vendor/bin/task deploy:git directory=/tmp/release branch=\"$BRANCH\" remote=\"$REMOTE\" message=\"${{ inputs.commit-message }}\"" # Run code-switch to the same branch so we wait for everything to sync. drainpipe_exec "acli api:environments:code-switch --task-wait ${{ inputs.environment }} \"$BRANCH\"" From bf8ae18bc99c3532d7c2ec04858f976709907970 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 18 Feb 2025 09:25:39 -0500 Subject: [PATCH 158/159] ISSUE-204: fixing drush arguments for config:set --- scaffold/github/actions/acquia/deploy/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/github/actions/acquia/deploy/action.yml b/scaffold/github/actions/acquia/deploy/action.yml index 6d2600a7a..11fc6fcfb 100644 --- a/scaffold/github/actions/acquia/deploy/action.yml +++ b/scaffold/github/actions/acquia/deploy/action.yml @@ -48,7 +48,7 @@ runs: # Removes *.paths where drush9 is specified. drainpipe_exec "yq eval '(.** | .paths) = {}' -i /var/www/html/drush/sites/${APPLICATION}.site.yml" drainpipe_exec "echo \"StrictHostKeyChecking no\" >> ~/.ssh/config" - drainpipe_exec "drush @${{ inputs.environment }} config:set system.maintenance_mode TRUE --yes" + drainpipe_exec "drush @${{ inputs.environment }} config:set system.maintenance_mode value TRUE --yes" # Define variables aliases_yml="/var/www/html/drush/sites/${APPLICATION}.site.yml" @@ -82,5 +82,5 @@ runs: run: | source .github/actions/drainpipe/set-env/bash_aliases - drainpipe_exec "drush @${{ inputs.environment }} config:set system.maintenance_mode FALSE --yes" + drainpipe_exec "drush @${{ inputs.environment }} config:set system.maintenance_mode value FALSE --yes" shell: bash From 7dedbcf4e3a338a61fdf0a80a6dfa62dae9aa962 Mon Sep 17 00:00:00 2001 From: Luis Aveiga Date: Tue, 18 Feb 2025 09:36:23 -0500 Subject: [PATCH 159/159] ISSUE-204: debug --- scaffold/github/actions/acquia/push/action.yml | 10 +++++++++- scaffold/github/actions/common/set-env/bash_aliases | 2 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scaffold/github/actions/acquia/push/action.yml b/scaffold/github/actions/acquia/push/action.yml index aa45fa2d3..984f9f6f0 100644 --- a/scaffold/github/actions/acquia/push/action.yml +++ b/scaffold/github/actions/acquia/push/action.yml @@ -24,13 +24,21 @@ runs: source .github/actions/drainpipe/set-env/bash_aliases - echo "API KEY" + echo "Debug: API KEY" echo ${{ inputs.api-key }}| cut -c 1-4 + echo "Debug: first ten chars of id_rsa" + echo ${{ inputs.acquia-ssh-private-key }}| cut -c 1-10 + + echo "Debug: last ten chars of id_rsa" + echo ${{ inputs.acquia-ssh-private-key }}| cut -c -10 + drainpipe_exec "echo \"${{ inputs.acquia-ssh-private-key }}\" > ~/.ssh/id_rsa" drainpipe_exec "chmod 600 ~/.ssh/id_rsa" drainpipe_exec "ACQUIA_API_KEY=${{ inputs.api-key }} ACQUIA_API_SECRET=${{ inputs.api-secret }} ./vendor/bin/task acquia:auth" + + echo "Debug: Getting environment info" ENV_INFO=$(drainpipe_exec "acli --no-interaction api:environments:find ${{ inputs.environment }}") VCS_TYPE=$(echo $ENV_INFO | jq -r ".vcs.type") diff --git a/scaffold/github/actions/common/set-env/bash_aliases b/scaffold/github/actions/common/set-env/bash_aliases index 5823c6f26..58fca27a8 100644 --- a/scaffold/github/actions/common/set-env/bash_aliases +++ b/scaffold/github/actions/common/set-env/bash_aliases @@ -1,9 +1,7 @@ drainpipe_exec() { if [ "$DRAINPIPE_DDEV" == "true" ]; then - echo "using ddev: $@" ddev exec "$@" else - echo "using eval: $@" eval "$@" fi }