diff options
author | Sam Pearson <sam@sgp.me.uk> | 2018-09-18 16:28:15 +0100 |
---|---|---|
committer | Sam Pearson <sam@sgp.me.uk> | 2018-09-28 14:35:46 +0100 |
commit | f8aed6f02cf5084a43375d8680a2e5fafb761529 (patch) | |
tree | faf57711559de16fb1435b97125d43f0a91211cf /bin/site-specific-install.sh | |
parent | 43845231cccbea8abd37930c480ed46349ca1de3 (diff) |
[Docker] Support Docker builds in install scripts
- Adds support for additional variables intended to control when to
install postfix and postgres.
- Skips nginx setup and integration when performing a docker build.
- Don't print usage during docker build
Diffstat (limited to 'bin/site-specific-install.sh')
-rw-r--r-- | bin/site-specific-install.sh | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/bin/site-specific-install.sh b/bin/site-specific-install.sh index a92f92ef5..4d7f05f1e 100644 --- a/bin/site-specific-install.sh +++ b/bin/site-specific-install.sh @@ -26,27 +26,41 @@ misuse() { [ -z "$DISTRIBUTION" ] && misuse DISTRIBUTION [ -z "$VERSION" ] && misuse VERSION [ -z "$DEVELOPMENT_INSTALL" ] && misuse DEVELOPMENT_INSTALL +[ -z "$DOCKER" ] && misuse DOCKER +[ -z "$INSTALL_DB" ] && misuse INSTALL_DB +[ -z "$INSTALL_POSTFIX" ] && misuse INSTALL_POSTFIX add_locale cy_GB add_locale nb_NO add_locale de_CH -install_postfix +if [ $INSTALL_POSTFIX = true ]; then + install_postfix +fi if [ ! "$DEVELOPMENT_INSTALL" = true ]; then - install_nginx - add_website_to_nginx + if [ ! "$DOCKER" = true ]; then + install_nginx + add_website_to_nginx + fi # Check out the current released version su -l -c "cd '$REPOSITORY' && git checkout '$VERSION' && git submodule update" "$UNIX_USER" fi +# Create a log directoryfor Docker builds - this is normally done above. +if [ $DOCKER = true ]; then + make_log_directory +fi + install_website_packages su -l -c "touch '$DIRECTORY/admin-htpasswd'" "$UNIX_USER" -add_postgresql_user +if [ $INSTALL_DB = true ]; then + add_postgresql_user +fi -export DEVELOPMENT_INSTALL +export DEVELOPMENT_INSTALL DOCKER INSTALL_DB su -c "$REPOSITORY/bin/install-as-user '$UNIX_USER' '$HOST' '$DIRECTORY'" "$UNIX_USER" if [ ! "$DEVELOPMENT_INSTALL" = true ]; then @@ -61,7 +75,7 @@ then overwrite_rc_local fi -if [ ! "$DEVELOPMENT_INSTALL" = true ]; then +if [ ! "$DEVELOPMENT_INSTALL" = true ] && [ ! "$DOCKER" = true ]; then # Tell the user what to do next: echo Installation complete - you should now be able to view the site at: |