Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,10 @@ jobs:
docker compose up --detach && sleep 15
docker compose exec cli mkdir -p .data && docker compose --progress quiet cp -L .data/db.sql cli:/app/.data/db.sql || true
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c "VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 ${provision_opts:-} ./vendor/bin/vortex-provision"
grep -q ^VORTEX_DB_IMAGE .env && rm .data/db.sql || true
# Database-in-image storage caches the exported image archive instead of the dump.
[ -n "${VORTEX_DB_IMAGE:-}" ] && rm -f .data/db.sql || true
./vendor/bin/vortex-export-db db.sql
docker compose exec -T cli test -f /app/.data/db.sql && docker compose --progress quiet cp -L cli:/app/.data/db.sql .data/db.sql || true
[ -z "${VORTEX_DB_IMAGE:-}" ] && docker compose exec -T cli test -f /app/.data/db.sql && docker compose --progress quiet cp -L cli:/app/.data/db.sql .data/db.sql || true
no_output_timeout: 30m

# Deploy the freshly-exported database image to the container registry.
Expand Down
5 changes: 3 additions & 2 deletions .circleci/vortex-test-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ jobs:
docker compose up --detach && sleep 15
docker compose exec cli mkdir -p .data && docker compose --progress quiet cp -L .data/db.sql cli:/app/.data/db.sql || true
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c "VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 ${provision_opts:-} ./vendor/bin/vortex-provision"
grep -q ^VORTEX_DB_IMAGE .env && rm .data/db.sql || true
# Database-in-image storage caches the exported image archive instead of the dump.
[ -n "${VORTEX_DB_IMAGE:-}" ] && rm -f .data/db.sql || true
./vendor/bin/vortex-export-db db.sql
docker compose exec -T cli test -f /app/.data/db.sql && docker compose --progress quiet cp -L cli:/app/.data/db.sql .data/db.sql || true
[ -z "${VORTEX_DB_IMAGE:-}" ] && docker compose exec -T cli test -f /app/.data/db.sql && docker compose --progress quiet cp -L cli:/app/.data/db.sql .data/db.sql || true
no_output_timeout: 30m

# Deploy the freshly-exported database image to the container registry.
Expand Down
3 changes: 1 addition & 2 deletions .claude/skills/prepare-vortex-release/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ Work through each checklist item from the release process doc:
Use npm, NOT yarn.
6. **CI runner** - Check if `drevops/ci-runner` is at the latest version.
7. **Cache version** - The cache key has the form `v<YY>.<M>.<minor>` (CalVer).
Update it in `.circleci/config.yml`,
`.circleci/vortex-test-common.yml`, and `.github/workflows/build-test-deploy.yml`:
Update it in `.circleci/config.yml` and `.github/workflows/build-test-deploy.yml`, then run `ahoy lint-ci-fix` from `.vortex/` to regenerate `.circleci/vortex-test-common.yml` and `.github/workflows/vortex-test-didi.yml`:
- The `v<YY>.<M>.<minor>` prefix tracks the latest `uselagoon/*` container
image tag (e.g. `v26.4.0` for `uselagoon/mysql-8.4:26.4.0`). Lagoon
versions encode `YY.M.minor` (year, calendar month, minor), so this part
Expand Down
45 changes: 40 additions & 5 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,23 @@ jobs:
- name: Process the codebase to run in CI
run: find . -name "docker-compose.yml" -print0 | xargs -0 -I {} sh -c "sed -i -e '/###/d' {} && sed -i -e 's/##//' {}"

- name: Load environment variables from .env
run: t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && set +a && . "${t}" && env >> "$GITHUB_ENV"

- name: Install Vortex tooling
run: ./scripts/vortex-tooling.sh

- name: Adjust variables for a scheduled run
if: github.event_name == 'schedule'
run: |
echo "VORTEX_CI_DB_CACHE_FALLBACK=no" >> "$GITHUB_ENV"
echo "VORTEX_FRONTEND_BUILD_SKIP=1" >> "$GITHUB_ENV"
{
echo "VORTEX_CI_DB_CACHE_FALLBACK=no"
echo "VORTEX_FRONTEND_BUILD_SKIP=1"
# Import the fetched dump into a clean base image (if database-in-image storage is used).
echo "VORTEX_DB_IMAGE_BASE=drevops/mariadb-drupal-data:26.10.0"
# Deploy container image (if database-in-image storage is used).
echo "VORTEX_EXPORT_DB_CONTAINER_REGISTRY_PUSH_PROCEED=1"
} >> "$GITHUB_ENV"

- name: Create cache keys files for database caching
run: |
Expand Down Expand Up @@ -313,11 +322,37 @@ jobs:
run: |
if [ ! -f /tmp/fetch-db-fresh ]; then echo "==> Database fetch semaphore file is missing. DB export will not proceed."; exit 0; fi
./vendor/bin/vortex-login-container-registry
# A database built from the base image is empty, so it is
# provisioned from the dump file without the image.
if [ -n "${VORTEX_DB_IMAGE:-}" ] && [ -n "${VORTEX_DB_IMAGE_BASE:-}" ] && [ "${VORTEX_FETCH_DB_SOURCE:-url}" != "container_registry" ]; then
VORTEX_FETCH_DB_SOURCE=container_registry VORTEX_FETCH_DB_CONTAINER_REGISTRY_IMAGE_BASE="${VORTEX_DB_IMAGE_BASE}" ./vendor/bin/vortex-fetch-db
provision_opts="VORTEX_DB_IMAGE="
fi
docker compose up --detach && sleep 15
docker compose exec cli mkdir -p .data && docker compose --progress quiet cp -L .data/db.sql cli:/app/.data/db.sql
docker compose exec cli bash -c "VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 ./vendor/bin/vortex-provision"
# The 'container_registry' source fetches an image without a dump file.
if [ -f .data/db.sql ]; then
docker compose exec cli mkdir -p .data
docker compose --progress quiet cp -L .data/db.sql cli:/app/.data/db.sql
fi
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c "VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 ${provision_opts:-} ./vendor/bin/vortex-provision"
# Database-in-image storage caches the exported image archive instead of the dump.
if [ -n "${VORTEX_DB_IMAGE:-}" ]; then rm -f .data/db.sql; fi
./vendor/bin/vortex-export-db db.sql
docker compose --progress quiet cp -L cli:/app/.data/db.sql .data/db.sql
if [ -z "${VORTEX_DB_IMAGE:-}" ] && docker compose exec -T cli test -f /app/.data/db.sql; then docker compose --progress quiet cp -L cli:/app/.data/db.sql .data/db.sql; fi
# 'hashFiles()' runs as the runner user outside the container, so the
# root-owned files in '.data' must be readable by others.
chmod -R a+rX .data
timeout-minutes: 30

# Deploy the freshly-exported database image to the container registry.
# No-op unless a fresh DB was fetched (the fetch semaphore), the project
# uses database-in-image storage (VORTEX_DB_IMAGE), and deployment was
# requested (VORTEX_EXPORT_DB_CONTAINER_REGISTRY_PUSH_PROCEED, in the script).
- name: Deploy DB image
run: |
if [ -z "${VORTEX_DB_IMAGE:-}" ]; then echo "==> Database-in-image storage is not used. DB image deployment will not proceed."; exit 0; fi
if [ ! -f /tmp/fetch-db-fresh ]; then echo "==> No freshly fetched database. DB image deployment will not proceed."; exit 0; fi
./vendor/bin/vortex-push-db-image
timeout-minutes: 30

# Save cache per default branch and the timestamp.
Expand Down
Loading
Loading