-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
41 lines (33 loc) · 1.11 KB
/
entrypoint.sh
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
MY=(
[ROLE]=app
[RUN_AS]=www
[APP_NAME]="${APP_NAME:-TurnKey Drupal}"
[APP_USER]="${APP_USER:-admin}"
[APP_MAIL]="${APP_MAIL:[email protected]}" # unused for now
[APP_PASS]="${APP_PASS:-}"
[APP_SITE]="${APP_SITE:-}" # unused for now
[APP_MODS]="${APP_MODS:-ctools field_group google_analytics honeypot imce pathauto token}"
[DB_HOST]="${DB_HOST:-127.0.0.1}"
[DB_USER]="${DB_USER:-drupal}"
[DB_NAME]="${DB_NAME:-drupal}"
[DB_PASS]="${DB_PASS:-$(secret consume DB_PASS)}"
)
export PATH="${PATH}:${OUR[WEBDIR]}/vendor/bin"
passthrough_unless 'php-fpm' "$@"
add vhosts drupal
web_extract_src drupal
random_if_empty APP_PASS
cd "${OUR[WEBDIR]}"
poll drush site-install standard -y \
--account-name="${MY[APP_USER]}" \
--account-pass="${MY[APP_PASS]}" \
--site-name="${MY[APP_NAME]}" \
--db-url="mysql://${MY[DB_USER]}:${MY[DB_PASS]}@${MY[DB_HOST]}/${MY[DB_NAME]}" \
|| fatal "DB took too long to reply"
for module in ${MY[APP_MODS]}; do
drush en -y "${module}"
done
drush entity-updates -y
drush cache-rebuild -y
chown -R www-data:www-data "${OUR[WEBDIR]}"
run "$@"