Skip to content

Commit

Permalink
Merge pull request #103 from govCMS/release/5.5.0
Browse files Browse the repository at this point in the history
Release 5.5.0
  • Loading branch information
steveworley authored Sep 8, 2024
2 parents c9d5095 + 59c102c commit 22d1cec
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 8 deletions.
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
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/[email protected]
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 }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ console

# Local development tools.
docker-compose.override.yml

# Local data directory.
.data
3 changes: 3 additions & 0 deletions scripts/scaffold-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ echo "[info]: Cleaning up"
mv ".docker/Dockerfile.$GOVCMS_TYPE" .docker/Dockerfile.cli
mv ".docker/Dockerfile.solr.$GOVCMS_TYPE" .docker/Dockerfile.solr

# Remove the GitHub Actions CI configuration.
rm -rf .github

if [[ "$GOVCMS_TYPE" == "paas" ]]; then
rm .docker/Dockerfile*saas*
rm -r themes
Expand Down

0 comments on commit 22d1cec

Please sign in to comment.