Skip to content
Merged
6 changes: 3 additions & 3 deletions .docker/entrypoints/cli/03-provision-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ set -e
# Delegate Drupal provisioning to the Quant-aware script. The standard
# DrevOps provision script is not compatible with Quant Cloud because it relies
# on Lagoon-specific tooling (e.g., rsync to Lagoon SSH).
if [ -x "./scripts/quant/provision-quant.sh" ]; then
./scripts/quant/provision-quant.sh
if [ -x "./scripts/drevops/provision.sh" ]; then
./scripts/drevops/provision.sh
else
echo "Quant provisioning script missing or not executable." >&2
echo "Drevops provisioning script missing or not executable." >&2
exit 1
fi
21 changes: 19 additions & 2 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ name: Build and Push civictheme-monorepo-drupal to Quant Cloud
- release/*
- hotfix/*
- feature/editorial-*
- project/quant-provision
tags:
- '*'

Expand Down Expand Up @@ -37,9 +38,12 @@ 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: |-
# Default: do not skip database sync
skip_db_sync="false"

# 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
Expand All @@ -48,6 +52,17 @@ jobs:
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"
# Override for project/quant-provision branch to skip database sync (fresh install from static content)
elif [[ "${{ github.ref }}" == "refs/heads/project/quant-provision" ]]; then
echo "image_suffix=${{ steps.init.outputs.image_suffix }}" >> $GITHUB_OUTPUT
suffix="${{ steps.init.outputs.image_suffix }}"
clean_suffix="${suffix#-}"
echo "image_suffix_clean=$clean_suffix" >> $GITHUB_OUTPUT
echo "is_production=false" >> $GITHUB_OUTPUT
echo "environment_name=${{ steps.init.outputs.environment_name }}" >> $GITHUB_OUTPUT
echo "environment_exists=${{ steps.init.outputs.environment_exists }}" >> $GITHUB_OUTPUT
skip_db_sync="true"
echo "Overriding outputs for project/quant-provision branch: skipping database sync"
else
# Use the original action outputs
echo "image_suffix=${{ steps.init.outputs.image_suffix }}" >> $GITHUB_OUTPUT
Expand All @@ -60,6 +75,8 @@ jobs:
echo "environment_exists=${{ steps.init.outputs.environment_exists }}" >> $GITHUB_OUTPUT
fi

echo "skip_db_sync=$skip_db_sync" >> $GITHUB_OUTPUT

- name: Build and push cli image
uses: docker/build-push-action@v5
with:
Expand Down Expand Up @@ -121,7 +138,7 @@ jobs:

- 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' }}
!= 'production' && steps.override-outputs.outputs.skip_db_sync != 'true' }}
uses: quantcdn/[email protected]
with:
api_key: ${{ secrets.QUANT_API_KEY }}
Expand Down
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,6 @@
"drupal/sdc_devel": {
"Change visibility of the rules constants in TwigValidatorRulePluginBase - https://www.drupal.org/project/sdc_devel/issues/3517321": "./patches/modules/sdc_devel/3517321--updated-visibility-of-rule-constants.patch",
"Remove check for use of default filter in boolean filter": "./patches/modules/sdc_devel/remove-boolean-filter-default.patch"
},
"drupal/simple_sitemap": {
"Error on installing / enabling simple_sitemap in D11: https://www.drupal.org/project/simple_sitemap/issues/3507718": "./patches/modules/simple_sitemap/fix-error-on-install.patch"
}
},
"preserve-paths": [
Expand Down
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion scripts/drevops/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\03
# @formatter:on

yesno() { [ "${1}" = "1" ] && echo "Yes" || echo "No"; }
drush() { ./vendor/bin/drush -y "$@"; }
drush() {
if [ -n "${drush_uri}" ]; then
./vendor/bin/drush -y --uri="${drush_uri}" "$@"
else
./vendor/bin/drush -y "$@"
fi
}

info "Started site provisioning."

Expand Down