Stop services required for build as part of build script

Halt build chain on any error
This commit is contained in:
Disassembler 2018-07-15 21:55:35 +02:00
parent 1c2d9c4124
commit 198b65ab29
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
30 changed files with 88 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
# For production builds change to DEBUG=0 or comment the line entirely
export DEBUG=1

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/activemq

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/basic-runtimes

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/basic

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/ckan-datapusher

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/ckan
@ -60,3 +61,8 @@ spotter-appmgr update-login ckan "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}"
# Install cron job
cp ${SOURCE_DIR}/etc/periodic/hourly/ckan /etc/periodic/hourly/ckan
# Stop services required for build
service solr stop
service redis stop
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/crisiscleanup
@ -37,3 +38,6 @@ envsubst <${SOURCE_DIR}/srv/crisiscleanup/db/seeds.rb >/tmp/seeds.rb
docker run --rm -h crisiscleanup --link postgres -v /srv/crisiscleanup/conf:/srv/crisiscleanup/config crisiscleanup rake db:schema:load
docker run --rm -h crisiscleanup --link postgres -v /srv/crisiscleanup/conf:/srv/crisiscleanup/config -v /tmp/seeds.rb:/srv/crisiscleanup/db/seeds.rb crisiscleanup rake db:seed
rm /tmp/seeds.rb
# Stop services required for build
service postgres stop

4
cts.sh
View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/cts
@ -39,3 +40,6 @@ export CTS_ADMIN_HASH=$(docker run --rm -h cts -v /srv/cts/conf:/srv/cts/cts/set
export CTS_ADMIN_SECRET=$(head -c 12 /dev/urandom | sha256sum | cut -c1-13)
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql cts
spotter-appmgr update-login cts "${CTS_ADMIN_EMAIL}" "${CTS_ADMIN_PWD}"
# Stop services required for build
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/frontlinesms

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/gnuhealth
@ -32,3 +33,6 @@ spotter-appmgr update-login gnuhealth "${GNUHEALTH_ADMIN_USER}" "${GNUHEALTH_ADM
wget http://health.gnu.org/downloads/postgres_dumps/gnuhealth-32-demo.sql.gz -O /tmp/gnuhealth_demo.sql.gz
zcat /tmp/gnuhealth_demo.sql.gz | docker exec -i -e PGPASSWORD=${GNUHEALTH_PWD} postgres psql gnuhealth_demo gnuhealth
rm -f /tmp/gnuhealth_demo.sql.gz
# Stop services required for build
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/kanboard
@ -29,3 +30,6 @@ spotter-appmgr update-login kanboard "${KANBOARD_ADMIN_USER}" "${KANBOARD_ADMIN_
# Install cron job
cp ${SOURCE_DIR}/etc/periodic/daily/kanboard /etc/periodic/daily/kanboard
# Stop services required for build
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/mariadb
@ -23,3 +24,4 @@ fi
# Configure MariaDB admin
service mariadb start
cat ${SOURCE_DIR}/adminpwd.sql | docker exec -i mariadb mysql
service mariadb stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/mifosx
@ -32,6 +33,7 @@ echo `date` '- Waiting for database to be populated. This should take about a mi
until docker logs mifosx 2>&1 | grep -q 'Migrating schema `mifostenant-default` to version 5000'; do
sleep 1
done
service mifosx stop
# Update admin account
export MIFOSX_ADMIN_USER=admin
@ -40,3 +42,7 @@ export MIFOSX_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d "+")
export MIFOSX_ADMIN_HASH=$(echo -n "${MIFOSX_ADMIN_PWD}{1}" | sha256sum | awk '{print $1}')
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i mariadb mysql mifostenant-default
spotter-appmgr update-login mifosx "${MIFOSX_ADMIN_USER}" "${MIFOSX_ADMIN_PWD}"
# Stop services required for build
service mariadb stop
service postfix stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/motech
@ -37,4 +38,9 @@ export MOTECH_ADMIN_USER="admin"
export MOTECH_ADMIN_EMAIL="admin@example.com"
export MOTECH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
curl -H "Content-Type: application/json" -X POST -d "{\"adminLogin\":\"${MOTECH_ADMIN_USER}\",\"adminEmail\":\"${MOTECH_ADMIN_EMAIL}\",\"adminPassword\":\"${MOTECH_ADMIN_PWD}\",\"adminConfirmPassword\":\"${MOTECH_ADMIN_PWD}\",\"language\":\"cs\",\"providerName\":\"\",\"providerUrl\":\"\",\"schedulerUrl\":\"\"}" http://${MOTECH_IP}:8080/module/server/startup/
service motech stop
spotter-appmgr update-login motech "${MOTECH_ADMIN_USER}" "${MOTECH_ADMIN_PWD}"
# Stop services required for build
service activemq stop
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/opendatakit-build
@ -20,3 +21,6 @@ export OPENDATAKITBUILD_COOKIE_SECRET=$(head -c 8 /dev/urandom | hexdump -e '"%x
mkdir -p /srv/opendatakit-build/conf
envsubst <${SOURCE_DIR}/srv/opendatakit-build/conf/config.yml >/srv/opendatakit-build/conf/config.yml
docker run --rm -h opendatakit-build --link postgres -v /srv/opendatakit-build/conf/config.yml:/srv/opendatakit-build/config.yml -w /srv/opendatakit-build opendatakit-build rake db:migrate
# Stop services required for build
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/opendatakit
@ -31,6 +32,7 @@ service opendatakit start
until docker logs opendatakit 2>&1 | grep -q 'org.apache.catalina.startup.Catalina.start'; do
sleep 1
done
service opendatakit stop
# Update admin account
export OPENDATAKIT_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
@ -39,3 +41,7 @@ export OPENDATAKIT_ADMIN_BASIC_HASH=$(echo -n "${OPENDATAKIT_ADMIN_PWD}{${OPENDA
export OPENDATAKIT_ADMIN_DIGEST_HASH=$(echo -n "${OPENDATAKIT_ADMIN_USER}:${OPENDATAKIT_ADMIN_REALM}:${OPENDATAKIT_ADMIN_PWD}" | md5sum | tr -d " -")
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql opendatakit
spotter-appmgr update-login opendatakit "${OPENDATAKIT_ADMIN_USER}" "${OPENDATAKIT_ADMIN_PWD}"
# Stop services required for build
service postgres stop
service postfix stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/openmapkit

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/pandora
@ -55,3 +56,7 @@ export PANDORA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export PANDORA_ADMIN_HASH=$(docker run --rm -h pandora -e DJANGO_SETTINGS_MODULE=pandora.settings -v /srv/pandora/conf:/srv/pandora/conf pandora python3 -c "from django.contrib.auth.hashers import make_password; print(make_password('${PANDORA_ADMIN_PWD}'))")
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql pandora
spotter-appmgr update-login pandora "${PANDORA_ADMIN_USER}" "${PANDORA_ADMIN_PWD}"
# Stop services required for build
service rabbitmq stop
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/postfix

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/postgres

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/rabbitmq

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/redis

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/sahana-demo
export TEMPLATE=${TEMPLATE:-"default"}
@ -35,3 +36,6 @@ spotter-appmgr update-login sahana-demo "${SAHANADEMO_ADMIN_USER}" "${SAHANADEMO
# Populate database
docker run --rm -h sahana-demo --link postgres -v /srv/sahana-demo/conf:/srv/web2py/applications/eden/models -v /srv/sahana-demo/data/databases:/srv/web2py/applications/eden/databases -v /tmp/masterUsers.csv:/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv sahana su - sahana -c "./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py"
rm /tmp/masterUsers.csv
# Stop services required for build
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/sahana
@ -44,3 +45,6 @@ if [ ${DEBUG:-0} -eq 0 ]; then
sed -i 's/settings.base.debug = True/settings.base.debug = False/' /srv/sahana/conf/000_config.py
sed -i 's/#settings.base.prepopulate = 0/settings.base.prepopulate = 0/' /srv/sahana/conf/000_config.py
fi
# Stop services required for build
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/sambro
@ -43,3 +44,6 @@ if [ ${DEBUG:-0} -eq 0 ]; then
sed -i 's/settings.base.debug = True/settings.base.debug = False/' /srv/sambro/conf/000_config.py
sed -i 's/#settings.base.prepopulate = 0/settings.base.prepopulate = 0/' /srv/sambro/conf/000_config.py
fi
# Stop services required for build
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/seeddms
@ -34,3 +35,6 @@ spotter-appmgr update-login seeddms "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD
# Install cron job
cp ${SOURCE_DIR}/etc/periodic/hourly/seeddms /etc/periodic/hourly/seeddms
# Stop services required for build
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/sigmah
@ -44,3 +45,6 @@ cat /tmp/sigmah-MinimumDataKit.sql | docker exec -i -e PGPASSWORD=${SIGMAH_PWD}
cat /tmp/sigmah-newOrganizationLaunchScript.sql | docker exec -i -e PGPASSWORD=${SIGMAH_PWD} postgres psql -U sigmah sigmah
rm -f /tmp/sigmah-MinimumDataKit.sql /tmp/sigmah-newOrganizationLaunchScript.sql
spotter-appmgr update-login sigmah "${SIGMAH_ADMIN_EMAIL}" "${SIGMAH_ADMIN_PWD}"
# Stop services required for build
service postgres stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/solr

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))/ushahidi
@ -35,3 +36,6 @@ spotter-appmgr update-login ushahidi "${USHAHIDI_ADMIN_USER}" "${USHAHIDI_ADMIN_
# Install cron job
cp ${SOURCE_DIR}/etc/periodic/15min/ushahidi /etc/periodic/15min/ushahidi
# Stop services required for build
service mariadb stop

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e
# Remove packages not necessary for release
apk --no-cache del .useful