Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
11dbbcd
Merge pull request #77 from govCMS/release/3.2.0
steveworley Dec 14, 2023
6dbc5f2
[DEVOPS-394] Upgraded to docker compose v2.
sonnykt Jan 15, 2024
0015277
Add php-http/discovery to the composer allow-plugins
ruwanl Feb 12, 2024
92c8464
Remove dropzone/dropzone
ruwanl Mar 15, 2024
345e274
Merge pull request #85 from govCMS/feature/3.x/GOVCMSD10-622
ruwanl Mar 15, 2024
075ef44
GOVCMS-10295: Removed COPY from base images.
stooit Mar 18, 2024
cdaa676
Merge pull request #86 from govCMS/feat/govcms-10295
steveworley May 8, 2024
a83ebde
Merge pull request #81 from ruwanl/GOVCMSD10-540
steveworley May 8, 2024
dfc8565
Update .version.yml
steveworley May 8, 2024
c1b70bb
Remove version from docker compose.
steveworley May 8, 2024
eb4242a
Merge pull request #79 from govCMS/feature/DEVOPS-394
steveworley May 9, 2024
6fabe81
Merge pull request #88 from govCMS/release/3.3.0
steveworley May 14, 2024
1f2019b
Update container name.
steveworley Jul 9, 2024
b4f80b5
Merge pull request #91 from govCMS/fix/container-name-v2
steveworley Jul 9, 2024
435b7f7
Update the compose definition.
steveworley Jul 9, 2024
97b54ad
Merge pull request #92 from govCMS/fix/compose-image-definition
steveworley Jul 9, 2024
89b108e
Add simplesamlphp/composer-module-installer into allowed plugins
drupal-spider Jul 12, 2024
40e86ff
Merge pull request #93 from drupal-spider/feature/sso
ruwanl Jul 12, 2024
a6f6dc9
Merge pull request #90 from govCMS/release/3.4.0
steveworley Jul 16, 2024
f385e8b
Update .version.yml
steveworley Jul 17, 2024
47338aa
Update .version.yml
steveworley Jul 17, 2024
88e6de5
Fix: Remove network configuration for local containers
steveworley Aug 8, 2024
eae74c6
Merge pull request #95 from govCMS/fix/docker-compose-network-config
steveworley Aug 9, 2024
2e3d8fb
Preserve scaffold modules in PaaS
yusufhm Aug 9, 2024
42c4b99
Merge pull request #96 from govCMS/bugfix/preserve-paas-scaffold-modules
yusufhm Aug 9, 2024
b06d190
Conditionally add github token for composer
yusufhm Aug 9, 2024
28e54b5
Merge pull request #97 from govCMS/feature/composer-conditional-githu…
steveworley Aug 11, 2024
76197a5
Update .version.yml
steveworley Aug 16, 2024
a12e399
Merge branch 'master' into develop
steveworley Aug 16, 2024
c9d5095
Merge pull request #98 from govCMS/develop
steveworley Aug 16, 2024
56ccda5
Remove additional copies.
steveworley Aug 30, 2024
26b622f
Merge pull request #99 from govCMS/fix/drush-location-php83
steveworley Sep 2, 2024
45347fc
Update .gitignore
steveworley Sep 2, 2024
39af050
Merge pull request #100 from govCMS/feat/add-local-develop-data-ignore
steveworley Sep 2, 2024
b3991b4
[DEVOPS-615] Added Github workflow to test the scaffold.
sonnykt Sep 3, 2024
b11a598
[DEVOPS-615] Added Slack notification.
sonnykt Sep 3, 2024
5daff02
Remove conditions for notification testing.
steveworley Sep 3, 2024
9a12232
Update the JSON structure.
steveworley Sep 4, 2024
f8a4655
Move channel ID to secrets for now.
steveworley Sep 4, 2024
2db2640
[DEVOPS-615] Updated JSON payload.
sonnykt Sep 4, 2024
37bc84a
Add failure condition.
steveworley Sep 4, 2024
609002b
[DEVOPS-615] Added schedule to run at 2am Sunday.
sonnykt Sep 4, 2024
40de5aa
Merge pull request #101 from govCMS/feature/DEVOPS-615
steveworley Sep 4, 2024
bb5adae
Remove the Github Actions configuration on init.
steveworley Sep 4, 2024
59c102c
Merge pull request #102 from govCMS/feat/devops-618
steveworley Sep 4, 2024
22d1cec
Merge pull request #103 from govCMS/release/5.5.0
steveworley Sep 8, 2024
eab528f
Update .version.yml
steveworley Sep 8, 2024
1e291b6
Merge pull request #104 from govCMS/fix/version-3-5-0
steveworley Sep 9, 2024
9c6c2dc
Update composer.10.json
steveworley Sep 17, 2024
d29192d
Remove PHP version in composer platform config.
sonnykt Sep 23, 2024
4a690d3
Merge pull request #108 from govCMS/feature/remove_php_version
steveworley Sep 23, 2024
711fa14
Added missing RESTY_RESOLVER env var.
stooit Sep 24, 2024
111fe07
Merge pull request #107 from govCMS/feat/php-83-install
steveworley Sep 25, 2024
b0cdf17
Merge pull request #109 from govCMS/fix/local-resolver
steveworley Sep 25, 2024
6f217db
[DEVOPS-631] Replace clamav vars with httpav's
yusufhm Oct 2, 2024
a2dadfc
Merge pull request #111 from govCMS/fix/DEVOPS-631-httpav-vars
steveworley Oct 3, 2024
3460e22
[GOVCMSD10-1102] Add plugin tbachert/spi to Scaffold
Oct 3, 2024
8dd6bd5
Update composer.10.json
Tara-Wij Oct 3, 2024
65d9ac5
Update composer.10.json
Tara-Wij Oct 3, 2024
28cc5c0
3.6.0 release.
stooit Oct 3, 2024
f434b88
Merge pull request #112 from Tara-Wij/GOVCMSD10-1102
stooit Oct 3, 2024
36e5504
Merge branch 'develop' into release/3.6.0
stooit Oct 3, 2024
6454f78
Merge pull request #113 from govCMS/release/3.6.0
stooit Oct 3, 2024
ab12a87
fix: use latest CI image for new PaaS provisions
yusufhm Oct 11, 2024
e62cb71
Merge pull request #114 from govCMS/bugfix/new-paas-latest-ci
steveworley Oct 13, 2024
d034edd
Merge pull request #115 from govCMS/develop
yusufhm Oct 18, 2024
42429cf
[GOVCMSD10-1141] Disable simplesamlphp/composer-module-installer and …
Nov 15, 2024
7fbec26
Merge pull request #116 from Tara-Wij/GOVCMSD10-1141
ruwanl Nov 15, 2024
5e4cf91
Adds support for lagoon.base.image label.
stooit Feb 18, 2025
d602097
Merge pull request #119 from govCMS/feat/base-img-support
ruwanl Feb 19, 2025
859f909
feat: update shipshape usage for the new version
yusufhm Mar 7, 2025
a71e040
Merge pull request #120 from govCMS/feature/update-shipshape-usage
yusufhm Apr 22, 2025
d54e1d1
Update .version.yml
steveworley May 8, 2025
a9b6311
Merge branch 'master' into develop
steveworley May 13, 2025
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
68 changes: 34 additions & 34 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,110 +5,110 @@ commands:
up:
usage: Build project.
cmd: |
docker-compose up -d "$@" &&
docker-compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m &&
docker compose up -d "$@" &&
docker compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m &&
ahoy info;

down:
usage: Delete project (CAUTION).
cmd: |
if [ "$1" == "y" ]; then
docker-compose down --volumes
docker compose down --volumes
else
ahoy confirm "Running this command will destroy your current site, database and build? Are you sure you didn't mean ahoy stop?" &&
# Run this if confirm returns true
docker-compose down --volumes ||
docker compose down --volumes ||
# Run this if confirm returns false
echo "OK, probably a wise choice..."
fi

build:
usage: Build project.
cmd: |
docker-compose up -d --build "$@" &&
docker-compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m &&
docker compose up -d --build "$@" &&
docker compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m &&
ahoy govcms-deploy && ahoy info;

cli:
usage: Start a shell inside cli container.
cmd: docker-compose exec cli bash
cmd: docker compose exec cli bash

run:
usage: Run command inside cli container.
cmd: docker-compose exec -T cli bash -c "$*"
cmd: docker compose exec -T cli bash -c "$*"

govcms-deploy:
usage: Runs deployment commands (e.g. config import, updb, cr, set up file_stage_proxy).
cmd: |
docker-compose exec -T cli mkdir -p /app/web/sites/default/files/private/tmp && \
docker-compose exec -T cli /app/vendor/bin/govcms-db-update && \
docker-compose exec -T cli /app/vendor/bin/govcms-config-import && \
docker-compose exec -T cli /app/vendor/bin/govcms-cache-rebuild && \
docker-compose exec -T cli /app/vendor/bin/govcms-enable_modules
docker compose exec -T cli mkdir -p /app/web/sites/default/files/private/tmp && \
docker compose exec -T cli /app/vendor/bin/govcms-db-update && \
docker compose exec -T cli /app/vendor/bin/govcms-config-import && \
docker compose exec -T cli /app/vendor/bin/govcms-cache-rebuild && \
docker compose exec -T cli /app/vendor/bin/govcms-enable_modules

drush:
usage: Run drush commands in cli container.
cmd: docker-compose exec -T cli drush "$@"
cmd: docker compose exec -T cli drush "$@"

logs:
usage: Show Docker logs.
cmd: docker-compose logs "$@"
cmd: docker compose logs "$@"

ps:
usage: List running Docker containers.
cmd: docker-compose ps
cmd: docker compose ps

restart:
usage: Restart Docker containers.
cmd: docker-compose restart
cmd: docker compose restart

stop:
usage: Stop Docker containers.
cmd: docker-compose stop "$@"
cmd: docker compose stop "$@"

install:
usage: Install the profile.
cmd: docker-compose exec -T cli drush si -y govcms "$@" && ahoy govcms-deploy
cmd: docker compose exec -T cli drush si -y govcms "$@" && ahoy govcms-deploy

login:
usage: Login to a website.
cmd: |
docker-compose exec -T cli drush -y cset tfa.settings reset_pass_skip_enabled true && \
docker-compose exec -T cli drush uinf --uid 1 --field name | xargs docker-compose exec -T cli drush uublk && \
docker-compose exec -T cli drush uli
docker compose exec -T cli drush -y cset tfa.settings reset_pass_skip_enabled true && \
docker compose exec -T cli drush uinf --uid 1 --field name | xargs docker compose exec -T cli drush uublk && \
docker compose exec -T cli drush uli

unloop:
usage: Fix local redirect loop
cmd: |
docker-compose exec -T cli drush ev '$u=\Drupal\user\Entity\User::load(1); $u->set("field_password_expiration", "0"); $u->save()' && \
docker-compose exec -T cli drush ev '$u=\Drupal\user\Entity\User::load(1); $u->set("field_last_password_reset", date("Y-m-d\TH:i:s")); $u->save()'
docker compose exec -T cli drush ev '$u=\Drupal\user\Entity\User::load(1); $u->set("field_password_expiration", "0"); $u->save()' && \
docker compose exec -T cli drush ev '$u=\Drupal\user\Entity\User::load(1); $u->set("field_last_password_reset", date("Y-m-d\TH:i:s")); $u->save()'

mysql-import:
usage: Pipe in a sql file. `ahoy mysql-import local.sql`
cmd: |
if [ -e "$@" ] ; then
docker-compose exec cli bash -c 'drush sql-drop' &&
docker-compose exec -T cli bash -c 'drush sql-cli' < "$@"
docker compose exec cli bash -c 'drush sql-drop' &&
docker compose exec -T cli bash -c 'drush sql-cli' < "$@"
else echo "Provided sql file" "$@" "does not exist"
fi

mysql-dump:
usage: Dump data out into a file. `ahoy mysql-dump local.sql`
cmd: docker-compose exec -T cli bash -c 'drush sql-dump --ordered-dump' > "$@"
cmd: docker compose exec -T cli bash -c 'drush sql-dump --ordered-dump' > "$@"

lint:
usage: Lint code
cmd: |
docker-compose exec -T test ./vendor/bin/govcms-lint web/modules/custom
docker-compose exec -T test ./vendor/bin/govcms-lint web/themes/custom
docker compose exec -T test ./vendor/bin/govcms-lint web/modules/custom
docker compose exec -T test ./vendor/bin/govcms-lint web/themes/custom

test-behat:
usage: Run Behat tests.
cmd: docker-compose exec -T test ./vendor/bin/govcms-behat "$@"
cmd: docker compose exec -T test ./vendor/bin/govcms-behat "$@"

test-phpunit:
usage: Run phpunit tests
cmd: docker-compose exec -T test ./vendor/bin/govcms-phpunit --testsuite govcms
cmd: docker compose exec -T test ./vendor/bin/govcms-phpunit --testsuite govcms

pull:
usage: Pull latest docker images.
Expand All @@ -119,14 +119,14 @@ commands:
cmd: |
ahoy confirm "Running this command will replace your current database. Are you sure?" &&
# Run this if confirm returns true
( cat .env | grep ^MARIADB_DATA_IMAGE | cut -c20- | xargs -n1 docker pull; docker-compose rm -f -s -v mariadb && ahoy up ) ||
( cat .env | grep ^MARIADB_DATA_IMAGE | cut -c20- | xargs -n1 docker pull; docker compose rm -f -s -v mariadb && ahoy up ) ||
# Run this if confirm returns false
echo "OK, probably a wise choice..."

ship-shape:
usage: Run site validation scripts locally
cmd: |
docker-compose exec -T cli shipshape -f /app/vendor/govcms/scaffold-tooling/shipshape.yml --exclude-db --error-code "$@"
docker compose exec -T cli shipshape run -f /app/vendor/govcms/scaffold-tooling/shipshape.yml --exclude-db --error-code . "$@"

debug:
usage: Enable debug configuration.
Expand All @@ -139,7 +139,7 @@ commands:
cmd: |
echo "Project : " $(ahoy run "echo \$LAGOON_PROJECT")
echo "Site local URL : " $(ahoy run "echo \$LAGOON_ROUTE")
echo "DB port on host : " $(docker port $(docker-compose ps -q mariadb) 3306 | cut -d : -f 2)
echo "DB port on host : " $(docker port $(docker compose ps -q mariadb) 3306 | cut -d : -f 2)
if [ "$1" ]; then
echo "One-time login : " $(ahoy login -- --no-browser)
fi
Expand Down
10 changes: 4 additions & 6 deletions .docker/Dockerfile.paas
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
ARG CLI_IMAGE
ARG GOVCMS_IMAGE_VERSION={{ GOVCMS_VERSION }}.x-latest

# Keep the base so we can copy modules from it at the end.
FROM govcms/govcms:${GOVCMS_IMAGE_VERSION} as base

FROM govcms/govcms:${GOVCMS_IMAGE_VERSION}

ARG GOVCMS_GITHUB_TOKEN

ENV WEBROOT=web

# Clean up base image so as not to conflict with any changes.
RUN rm -rf /app
RUN mv /app/web/sites/all/modules /scaffold_modules \
&& rm -rf /app

RUN composer config --global github-oauth.github.com $GOVCMS_GITHUB_TOKEN

Expand All @@ -25,6 +23,8 @@ COPY custom /app/custom

# Run composer. Additional `rm`s can be added to reduce the image size, with diminishing returns.
RUN composer install --no-dev --no-interaction --no-suggest \
&& mkdir -p /app/web/sites/all \
&& mv /scaffold_modules /app/web/sites/all/modules \
&& rm -rf ~/.composer/cache \
&& rm -rf /app/web/core/tests \
&& rm -rf /app/web/modules/contrib/webform/tests
Expand All @@ -39,8 +39,6 @@ COPY .docker/config/cli/govcms.site.yml /app/drush/sites/
RUN rm -Rf /home/.composer/vendor/bin
ENV PATH="/app/vendor/bin:${PATH}"

COPY --from=base /app/web/sites/all/modules/ /app/web/sites/all/modules/

# Sanitize the Drupal install to remove potentially
# harmful files from the built image.
COPY .docker/scripts/sanitize.sh /tmp/sanitize.sh
Expand Down
4 changes: 3 additions & 1 deletion .docker/Dockerfile.saasplus
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ COPY config /app/config
COPY favicon.ico /app/web

# To enable SaaS+ uncomment these lines
RUN composer config --global github-oauth.github.com $GOVCMS_GITHUB_TOKEN
RUN [ ! -z "$GOVCMS_GITHUB_TOKEN" ] \
&& composer config --global github-oauth.github.com $GOVCMS_GITHUB_TOKEN \
|| echo "skipping github token"
COPY custom /app/custom
RUN jq -s '.[1].repositories = (.[0].repositories + .[1].repositories) | .[1]' /app/custom/composer/composer.json /app/composer.json > /tmp/composer.json
RUN mv /tmp/composer.json /app/composer.json
Expand Down
8 changes: 0 additions & 8 deletions .docker/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,3 @@ ENV WEBROOT=web

COPY --from=cli /app /app
COPY tests /app/tests/

# Copy deploy and test scripts.
RUN cp /app/vendor/govcms/scaffold-tooling/scripts/govcms* /usr/local/bin/
RUN chmod +x /usr/local/bin/*

# @see also drush setup in Dockerfile.cli
COPY --from=cli /usr/local/bin/drush /usr/local/bin/
RUN chmod +x /usr/local/bin/drush && rm -Rf /home/.composer/vendor/bin
2 changes: 1 addition & 1 deletion .docker/config/test/sample.profile.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: 'Drupal 8 Sample Audit - run with docker-compose exec -T test drutiny profile:run sample @self'
title: 'Drupal 8 Sample Audit - run with docker compose exec -T test drutiny profile:run sample @self'
format:
html:
template: govcms-page
Expand Down
2 changes: 1 addition & 1 deletion .env.default
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##
# This file contains per-project environment variables.
# It is used by Ahoy, Docker-compose, Lagoon, and other scripts to read default values.
# Copy this file to '.env' to make docker-compose use overridden values.
# Copy this file to '.env' to make docker compose use overridden values.
#

# https://govcms.gov.au/wiki-vars#COMPOSE_PROJECT_NAME
Expand Down
153 changes: 153 additions & 0 deletions .github/workflows/test-scaffold.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: Test scaffold

on:
push:
branches:
- main
- develop
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
schedule:
# Sunday 2 AM Melbourne time.
- cron: '0 16 * * SUN'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
DREVOPS_CI_TEST_RESULTS: /tmp/tests
DREVOPS_CI_ARTIFACTS: /tmp/artifacts
GOVCMS_VERSION: 10

jobs:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 2
matrix:
govcms_image:
- "10.x-latest"
- "10.x-edge"
project_type:
- saas
- paas
fail-fast: false

container:
image: drevops/ci-runner:24.8.0
env:
CI: 1
# Prevent GitHub overriding the Docker config.
DOCKER_CONFIG: /root/.docker
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TZ: "Australia/Melbourne"
# Set runner terminal capabilities.
TERM: xterm-256color
# Directory to store test results.
DREVOPS_CI_TEST_RESULTS: ${{ env.DREVOPS_CI_TEST_RESULTS }}
# Directory to store test artifacts.
DREVOPS_CI_ARTIFACTS: ${{ env.DREVOPS_CI_ARTIFACTS }}
# Check only minimal stack requirements.
DREVOPS_DOCTOR_CHECK_MINIMAL: 1
# Directory to store code exported between jobs.
DREVOPS_EXPORT_CODE_DIR: /tmp/workspace/code

steps:
-
name: Checkout the repo
uses: actions/checkout@main

-
name: Check Docker and Compose version
run: |
echo "[INFO] Docker version."
docker version
echo "[INFO] Docker Compose version."
docker compose version

-
name: Setup Docker network
run: docker network prune -f >/dev/null 2>&1 && docker network inspect amazeeio-network >/dev/null 2>&1 || docker network create amazeeio-network >/dev/null 2>&1 || true

-
name: Process 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/##//'' {} && sed -i -e 's#- .:/app:delegated#[]#' {}"
mkdir -p "${DREVOPS_EXPORT_CODE_DIR}"

-
name: Init scaffold
run: ahoy init scaffold-test ${{ matrix.project_type }} ${{ env.GOVCMS_VERSION }}

-
name: Build project
run: ahoy up
env:
GOVCMS_IMAGE_VERSION: ${{ matrix.govcms_image }}
GOVCMS_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

-
name: Install GovCMS profile
run: ahoy install

notify:
runs-on: ubuntu-latest
needs: [ test ]
if: ${{ !cancelled() }}
steps:
-
name: Notify failures to Slack
id: failure_slack
if: ${{ contains(needs.*.result, 'failure') }}
uses: slackapi/slack-github-action@v1.27.0
with:
# See https://github.com/slackapi/slack-github-action?tab=readme-ov-file
channel-id: ${{ secrets.SLACK_CHANNEL }}
payload: |
{
"attachments": [
{
"color": "#ff0000",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "GovCMS Scaffold test failure"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Some jobs were not successful, please view the pipeline and rerun."
}
]
},
{
"type": "actions",
"block_id": "view_pipeline",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View pipeline"
},
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
Loading