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

Commit 7033107

Browse files
authored
Release 1.2.0 (#48)
* [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
1 parent 96126f0 commit 7033107

File tree

3 files changed

+27
-32
lines changed

3 files changed

+27
-32
lines changed

.lagoon.yml

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,68 +16,60 @@ environments:
1616

1717
tasks:
1818
# Pre-rollout tasks do not get called on first deploy; use post-rollout tasks instead.
19+
# Pre-rollout tasks need to have file existance checks as these are run in the active
20+
# containers and it is not guaranteed that the commands will be available there.
1921
pre-rollout:
20-
- run:
21-
name: Ensure backup folder exists - not all current envs have one
22-
command: mkdir -p /app/web/sites/default/files/private/backups
22+
-
23+
run:
24+
name: Pre-rollout database updates
25+
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.'"
2326
service: cli
24-
shell: bash
25-
- run:
27+
shell: bash
28+
-
29+
run:
2630
name: Snapshot the database and store
27-
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
31+
command: "[ -f /app/vendor/bin/govcms-db-backup ] && /app/vendor/bin/govcms-db-backup || echo 'Database backup is not available.'"
2832
service: cli
2933
shell: bash
30-
- run:
34+
-
35+
run:
3136
name: Snapshot the config and store
32-
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
37+
command: "[ -f /app/vendor/bin/govcms-config-backup ] && /app/vendor/bin/govcms-config-backup || echo 'Config backup is not available.'"
3338
service: cli
3439
shell: bash
35-
3640
post-rollout:
3741
- run:
38-
name: Correct legacy drush alias if necessary
39-
command: sed -i "s/%%PROJECT_NAME%%/\${env.LAGOON_PROJECT}/g" /app/drush/sites/govcms.site.yml
40-
service: cli
41-
shell: bash
42-
- run:
43-
name: Ensure backups and tmp folders exist
44-
command: mkdir -p /app/web/sites/default/files/private/{backups,tmp}
42+
name: Prepare the site for deployment
43+
command: /app/vendor/bin/govcms-update_site_alias
4544
service: cli
4645
shell: bash
4746
- run:
48-
name: If a new environment populate database from master
49-
command: drush status db-status | grep Connected || if [[ "$LAGOON_ENVIRONMENT_TYPE" != "production" ]]; then drush sql:sync @govcms.prod @self -y; fi
47+
name: Synchronise the database
48+
command: /app/vendor/bin/govcms-db-sync
5049
service: cli
5150
shell: bash
5251
- run:
5352
name: Perform database updates
54-
command: drush -y updatedb
53+
command: /app/vendor/bin/govcms-db-update
5554
service: cli
5655
shell: bash
5756
- run:
58-
name: Perform config import (uncomment to enable)
59-
command: |
60-
# drush cim -y sync && if [[ "$LAGOON_ENVIRONMENT_TYPE" != "production" ]]; then drush cim -y --partial --source=../config/dev; fi
57+
name: Perform config import
58+
command: /app/vendor/bin/govcms-config-import
6159
service: cli
6260
shell: bash
6361
- run:
6462
name: Perform cache rebuild
65-
command: drush -y cr
63+
command: /app/vendor/bin/govcms-cache-rebuild
6664
service: cli
6765
shell: bash
6866
- run:
6967
name: Ensure GovCMS/Lagoon modules are enabled
70-
command: drush en -y govcms_lagoon && drush pmu -y govcms_lagoon
71-
service: cli
72-
shell: bash
73-
- run:
74-
name: Enable any non-production modules
75-
command: if [[ "$LAGOON_ENVIRONMENT_TYPE" != "production" ]]; then drush en stage_file_proxy -y; fi
68+
command: /app/vendor/bin/govcms-enable_modules
7669
service: cli
7770
shell: bash
7871
- run:
7972
name: Preserve the last successful backup
80-
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
73+
command: /app/vendor/bin/govcms-backups-preserve
8174
service: cli
8275
shell: bash
83-

.version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version: 8
22
type: saas
3-
scaffold: 1.1.6
3+
scaffold: 1.2.0

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ which has a more conventional Drupal 8 structure.
1515

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

1922
## Customising this README
2023

0 commit comments

Comments
 (0)