-
Notifications
You must be signed in to change notification settings - Fork 20
Updated quant deploy script for no-database deploys. #1452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4f86cc1
Updated deploy script and reverted to use drevops script for provisio…
richardgaunt 7a6f8a7
Updated composer.
richardgaunt fd469ab
Change drush location.
richardgaunt ab203b5
Added drush_uri.
richardgaunt 3485f6a
Move the fix drush up stack to pre-deployment.
richardgaunt 4c9c75e
Uncommented provision script.
richardgaunt e7de9bc
Revert drush change back in drevops provision script.
richardgaunt 3914052
Increased memory limit for php processes.
richardgaunt 7434970
Cleanup.
richardgaunt b74e950
Remove sync database workflow.
richardgaunt 3020b9e
Remove lagoon deploy type.
richardgaunt f8710b0
Remove deploy job from circleci.
richardgaunt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ; Custom PHP memory limit | ||
| memory_limit = 768M |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/bin/sh | ||
| set -e | ||
|
|
||
| # Post-rollout task: Provision site | ||
| # Generated from .lagoon.yml | ||
|
|
||
| if [ "$LAGOON_ENVIRONMENT_TYPE" = "production" ] || [ "$LAGOON_GIT_BRANCH" = "${DREVOPS_LAGOON_PRODUCTION_BRANCH:-main}" ]; then | ||
| echo "==> Running in PRODUCTION environment." | ||
| # Never unblock admin user in production. | ||
| export DRUPAL_UNBLOCK_ADMIN=0 | ||
| # Never sanitize DB in production. | ||
| export DREVOPS_PROVISION_SANITIZE_DB_SKIP=1 | ||
| fi | ||
| # | ||
| # Deployments from UI are not able to bypass the value of | ||
| # DREVOPS_PROVISION_OVERRIDE_DB set by the deploy-lagoon.sh | ||
| # during previous deployments (it sets value to '0' to mitigate Lagoon bug | ||
| # where environment variables cannot be deleted and have to be set to a value). | ||
| # @see https://github.com/uselagoon/lagoon/issues/1922 | ||
| # Explicitly set DB overwrite flag to the value from .env file for | ||
| # deployments from the profile. | ||
| if [ "${DREVOPS_PROVISION_USE_PROFILE}" = "1" ]; then | ||
| export DREVOPS_PROVISION_OVERRIDE_DB="$(cat .env | grep ^DREVOPS_PROVISION_OVERRIDE_DB | cut -c31-)" | ||
| fi | ||
| ./scripts/drevops/provision.sh |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ name: Build and Push civictheme-monorepo-drupal to Quant Cloud | |
| - release/* | ||
| - hotfix/* | ||
| - feature/editorial-* | ||
| - project/quant-provision | ||
| tags: | ||
| - '*' | ||
|
|
||
|
|
@@ -37,28 +38,18 @@ jobs: | |
| quant_application: civictheme-monorepo-drupal | ||
| master_branch_override: main | ||
|
|
||
| - name: Override outputs for quant-cloud-migration branch | ||
| - name: Override outputs for special branches | ||
| id: override-outputs | ||
| run: |- | ||
| # Override outputs for quant-cloud-migration branch to treat it as production | ||
| if [[ "${{ github.ref }}" == "refs/heads/quant-cloud-migration" ]]; then | ||
| echo "image_suffix=-latest" >> $GITHUB_OUTPUT | ||
| echo "image_suffix_clean=latest" >> $GITHUB_OUTPUT | ||
| echo "is_production=true" >> $GITHUB_OUTPUT | ||
| echo "environment_name=production" >> $GITHUB_OUTPUT | ||
| echo "environment_exists=true" >> $GITHUB_OUTPUT | ||
| echo "Overriding outputs for quant-cloud-migration branch: using -latest suffix and production environment" | ||
| else | ||
| # Use the original action outputs | ||
| echo "image_suffix=${{ steps.init.outputs.image_suffix }}" >> $GITHUB_OUTPUT | ||
| # Remove leading hyphen from image_suffix for image_suffix parameter | ||
| suffix="${{ steps.init.outputs.image_suffix }}" | ||
| clean_suffix="${suffix#-}" | ||
| echo "image_suffix_clean=$clean_suffix" >> $GITHUB_OUTPUT | ||
| echo "is_production=${{ steps.init.outputs.is_production }}" >> $GITHUB_OUTPUT | ||
| echo "environment_name=${{ steps.init.outputs.environment_name }}" >> $GITHUB_OUTPUT | ||
| echo "environment_exists=${{ steps.init.outputs.environment_exists }}" >> $GITHUB_OUTPUT | ||
| fi | ||
| echo "image_suffix=${{ steps.init.outputs.image_suffix }}" >> $GITHUB_OUTPUT | ||
| # Remove leading hyphen from image_suffix for image_suffix parameter | ||
| suffix="${{ steps.init.outputs.image_suffix }}" | ||
| clean_suffix="${suffix#-}" | ||
| echo "image_suffix_clean=$clean_suffix" >> $GITHUB_OUTPUT | ||
| echo "is_production=${{ steps.init.outputs.is_production }}" >> $GITHUB_OUTPUT | ||
| echo "environment_name=${{ steps.init.outputs.environment_name }}" >> $GITHUB_OUTPUT | ||
| echo "environment_exists=${{ steps.init.outputs.environment_exists }}" >> $GITHUB_OUTPUT | ||
|
|
||
|
|
||
| - name: Build and push cli image | ||
| uses: docker/build-push-action@v5 | ||
|
|
@@ -119,21 +110,6 @@ jobs: | |
| from_environment: production | ||
| image_suffix: ${{ steps.override-outputs.outputs.image_suffix_clean }} | ||
|
|
||
| - name: Sync database from production to new environment | ||
| if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.override-outputs.outputs.environment_exists == 'false' && steps.override-outputs.outputs.environment_name | ||
| != 'production' }} | ||
| uses: quantcdn/[email protected] | ||
| with: | ||
| api_key: ${{ secrets.QUANT_API_KEY }} | ||
| organization: ${{ secrets.QUANT_ORGANIZATION }} | ||
| app_name: ${{ steps.init.outputs.quant_application }} | ||
| environment_name: ${{ steps.override-outputs.outputs.environment_name }} | ||
| source: production | ||
| type: database | ||
| wait: true | ||
| wait_interval: 10 | ||
| max_retries: 30 | ||
|
|
||
| - name: Redeploy existing environment | ||
| if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.override-outputs.outputs.environment_exists == 'true' }} | ||
| uses: quantcdn/quant-cloud-environment-state-action@v1 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: civictheme/monorepo-drupal
Length of output: 1219
🏁 Script executed:
Repository: civictheme/monorepo-drupal
Length of output: 7630
🏁 Script executed:
Repository: civictheme/monorepo-drupal
Length of output: 824
🏁 Script executed:
Repository: civictheme/monorepo-drupal
Length of output: 2857
🏁 Script executed:
Repository: civictheme/monorepo-drupal
Length of output: 1900
Now I have enough information to provide a comprehensive rewritten review comment. The original concern is substantively correct—this does disable all deployments—but the issue is more nuanced. The change appears intentional based on the commit message, but it uses an undocumented workaround instead of the proper mechanism.
Document the "none" deployment type and clarify the deployment strategy.
The value
DREVOPS_DEPLOY_TYPES=nonedisables all deployments, but this value is not documented as valid in the script comments (which list only:artifact,docker,webhook,lagoon). While the commit "Remove lagoon deploy type" confirms this is intentional, usingnoneis a workaround that bypasses the validation.The deploy script has a proper failsafe mechanism:
DREVOPS_DEPLOY_PROCEED=0(documented as "a failsafe to prevent any deployments"). Consider using that instead, or:scripts/drevops/deploy.shto documentnoneas a valid value in the comments (lines 23-25)..envto document thatnonedisables all deployments, or useDREVOPS_DEPLOY_PROCEED=0as the mechanism.🤖 Prompt for AI Agents