Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Commit

Permalink
Release 1.2.0 (#48)
Browse files Browse the repository at this point in the history
* [GOVCMS-4392]: Update the deploy process. (#41)

* Update the deploy process.

- Align the deploy process with the scaffold tooling approach.

GovCMS base images now include the scaffold-tooling dependency, this installs deploy
scripts to the /app/vendor/bin directory and will allow us to align approaches and
centrally manage updates to the deployment process.

* Update script names to match naming convention.

* Update the govcms commands in lagoon.yml.

- Change to match the naming convention of `govcms-[object]-[action]`

govCMS/scaffold-tooling#33

* Ensure command files are available.

- Pre-deploy scripts run in existing containers, the atomic govcms deploy
scripts may not always be available.

* Message was causing errors in Lagoon.

* Update README.md

* Update version.yml
  • Loading branch information
steveworley authored Aug 7, 2020
1 parent 96126f0 commit 7033107
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 32 deletions.
54 changes: 23 additions & 31 deletions .lagoon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,68 +16,60 @@ environments:

tasks:
# Pre-rollout tasks do not get called on first deploy; use post-rollout tasks instead.
# Pre-rollout tasks need to have file existance checks as these are run in the active
# containers and it is not guaranteed that the commands will be available there.
pre-rollout:
- run:
name: Ensure backup folder exists - not all current envs have one
command: mkdir -p /app/web/sites/default/files/private/backups
-
run:
name: Pre-rollout database updates
command: "[ -f /app/vendor/bin/govcms-pre-deploy-db-update ] && /app/vendor/bin/govcms-pre-deploy-db-update || echo 'Pre Update databse is not available.'"
service: cli
shell: bash
- run:
shell: bash
-
run:
name: Snapshot the database and store
command: if [[ "$LAGOON_ENVIRONMENT_TYPE" = "production" ]]; then drush sql:dump --root=/app --gzip --result-file=/app/web/sites/default/files/private/backups/pre-deploy-dump.sql; fi
command: "[ -f /app/vendor/bin/govcms-db-backup ] && /app/vendor/bin/govcms-db-backup || echo 'Database backup is not available.'"
service: cli
shell: bash
- run:
-
run:
name: Snapshot the config and store
command: if [[ $(drush cex --root=/app sync -y --quiet --destination "$TMP"/config; echo "$?") = 0 ]]; then tar -czf /app/web/sites/default/files/private/backups/pre-deploy-config.tar.gz "$TMP"/config --remove-files; fi
command: "[ -f /app/vendor/bin/govcms-config-backup ] && /app/vendor/bin/govcms-config-backup || echo 'Config backup is not available.'"
service: cli
shell: bash

post-rollout:
- run:
name: Correct legacy drush alias if necessary
command: sed -i "s/%%PROJECT_NAME%%/\${env.LAGOON_PROJECT}/g" /app/drush/sites/govcms.site.yml
service: cli
shell: bash
- run:
name: Ensure backups and tmp folders exist
command: mkdir -p /app/web/sites/default/files/private/{backups,tmp}
name: Prepare the site for deployment
command: /app/vendor/bin/govcms-update_site_alias
service: cli
shell: bash
- run:
name: If a new environment populate database from master
command: drush status db-status | grep Connected || if [[ "$LAGOON_ENVIRONMENT_TYPE" != "production" ]]; then drush sql:sync @govcms.prod @self -y; fi
name: Synchronise the database
command: /app/vendor/bin/govcms-db-sync
service: cli
shell: bash
- run:
name: Perform database updates
command: drush -y updatedb
command: /app/vendor/bin/govcms-db-update
service: cli
shell: bash
- run:
name: Perform config import (uncomment to enable)
command: |
# drush cim -y sync && if [[ "$LAGOON_ENVIRONMENT_TYPE" != "production" ]]; then drush cim -y --partial --source=../config/dev; fi
name: Perform config import
command: /app/vendor/bin/govcms-config-import
service: cli
shell: bash
- run:
name: Perform cache rebuild
command: drush -y cr
command: /app/vendor/bin/govcms-cache-rebuild
service: cli
shell: bash
- run:
name: Ensure GovCMS/Lagoon modules are enabled
command: drush en -y govcms_lagoon && drush pmu -y govcms_lagoon
service: cli
shell: bash
- run:
name: Enable any non-production modules
command: if [[ "$LAGOON_ENVIRONMENT_TYPE" != "production" ]]; then drush en stage_file_proxy -y; fi
command: /app/vendor/bin/govcms-enable_modules
service: cli
shell: bash
- run:
name: Preserve the last successful backup
command: if [[ "$LAGOON_ENVIRONMENT_TYPE" = "production" ]]; then export BACKUP="/app/web/sites/default/files/private/backups/pre-deploy-dump" && mv "$BACKUP.sql.gz" "$BACKUP-last-good.sql.gz" || true; fi
command: /app/vendor/bin/govcms-backups-preserve
service: cli
shell: bash

2 changes: 1 addition & 1 deletion .version.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version: 8
type: saas
scaffold: 1.1.6
scaffold: 1.2.0
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ which has a more conventional Drupal 8 structure.

* [Drupal/GovCMS distribution](https://govcms.gov.au/wiki-distro)
* [GovCMS Platform](https://govcms.gov.au/wiki-platform)
* [GovCMS Maintenance](https://govcms.gov.au/wiki-maintenance)
* [GovCMS release process](https://github.com/govCMS/govcms8-scaffold-paas/wiki/Update-process)


## Customising this README

Expand Down

0 comments on commit 7033107

Please sign in to comment.