forked from danskernesdigitalebibliotek/dpl-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.lagoon.yml
119 lines (109 loc) · 4.13 KB
/
.lagoon.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
docker-compose-yaml: docker-compose.yml
project: dpl-cms-core
ssh: 20.238.147.183:22
api: https://api.lagoon.dplplat01.dpl.reload.dk/graphql
tasks:
post-rollout:
- run:
name: If drupal is not installed
command: |
set -e
if tables=$(drush sqlq "show tables like 'node';") && [ -z "$tables" ]; then
# Install and set the admin password to a Lagoon variable if it exists.
if [[ -n $PR_DRUPAL_PWD ]]; then
drush si --existing-config -y --account-pass=$PR_DRUPAL_PWD
else
# Otherwise install and let drush generate a password.
drush si --existing-config -y
fi
# Practice shows that the cache needs to be cleared to avoid
# configuration errors even after a site install.
drush cr
fi
service: cli
shell: bash
- run:
name: drush deploy
command: |
set -e
if [[ -f config/sync/system.site.yml ]]; then
echo "Config detected, doing a drush deploy"
drush deploy
# Purge all varnish cache to make sure
# that new changes will come through
# eg. js assets.
echo "...and clearing the external cache."
drush cache:rebuild-external -y || true
else
echo "No config detected, clearing cache"
drush cr
fi
service: cli
- run:
# We need this because if we create the directory before volume mount
# it will be gone.
name: Create module upload directory in public files
command: |
set -e
if [[ ! -d "web/sites/default/files/modules_local" ]]; then
echo "Creating directory for module uploads"
mkdir web/sites/default/files/modules_local
fi
service: cli
- run:
name: Import translations
command: |
set -e;
drush locale-check
drush locale-update
service: cli
- run:
name: Create test users
command: |
set -e
drush user:create editor --password="$PR_DRUPAL_PWD"
drush user:role:add 'editor' editor
drush user:create administrator --password="$PR_DRUPAL_PWD"
drush user:role:add 'administrator' administrator
drush user:create mediator --password="$PR_DRUPAL_PWD"
drush user:role:add 'mediator' mediator
drush user:create local_administrator --password="$PR_DRUPAL_PWD"
drush user:role:add 'local_administrator' local_administrator
drush user:create patron --password="$PR_DRUPAL_PWD"
drush user:role:add 'patron' patron
service: cli
environments:
main:
cronjobs:
- name: drush cron
schedule: "M/15 * * * *"
command: drush cron
service: cli
- name: import translations
# TODO Consider if translation checking frequency should be reduced.
# A high frequency is used to ensure quick turnaround time during
# development. Updating (or checking) translations could have side effects on
# caching etc. and once things have settled down a lower frequency may be
# more appropriate.
schedule: "M/30 * * * *"
command: drush locale-check && drush locale-update
service: cli
- name: import danish config translations
schedule: "M/30 * * * *"
command: drush dpl_po:import-remote-config-po da https://danskernesdigitalebibliotek.github.io/dpl-cms/translations/da.config.po
service: cli
pr-581:
cronjobs:
- name: drush cron
schedule: "M/15 * * * *"
command: drush cron
service: cli
- name: import translations
# Quite frequent translation import because of businezz.
schedule: "M/30 * * * *"
command: drush locale-check && drush locale-update
service: cli
- name: import danish config translations
schedule: "M/30 * * * *"
command: drush dpl_po:import-remote-config-po da https://danskernesdigitalebibliotek.github.io/dpl-cms/translations/da.config.po
service: cli