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
Loading