start/stop prepreqs
This commit is contained in:
parent
86f4f940c7
commit
b7aedad589
@ -4,10 +4,9 @@ set -e
|
|||||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
||||||
|
|
||||||
# Check prerequisites
|
# Check prerequisites
|
||||||
# TODO: Have setup prereqs in a manifest file
|
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
|
||||||
for SERVICE in postgres redis solr; do
|
[ ! -e /run/openrc/started/redis ] && service redis start && STOP_REDIS=1
|
||||||
[ ! -e /run/openrc/started/${SERVICE} ] && service ${SERVICE} start && STOP_SERVICES="${STOP_SERVICES} ${SERVICE}"
|
[ ! -e /run/openrc/started/solr ] && service solr start && STOP_SOLR=1
|
||||||
done
|
|
||||||
|
|
||||||
# Create database
|
# Create database
|
||||||
export CKAN_PWD=$(head -c 18 /dev/urandom | base64)
|
export CKAN_PWD=$(head -c 18 /dev/urandom | base64)
|
||||||
@ -57,6 +56,6 @@ cp ${SOURCE_DIR}/etc/init.d/ckan /etc/init.d/ckan
|
|||||||
rc-update -u
|
rc-update -u
|
||||||
|
|
||||||
# Stop services required for setup
|
# Stop services required for setup
|
||||||
for SERVICE in ${STOP_SERVICES}; do
|
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
|
||||||
service ${SERVICE} stop
|
[ ! -z ${STOP_REDIS} ] && service redis stop
|
||||||
done
|
[ ! -z ${STOP_SOLR} ] && service solr stop
|
||||||
|
@ -4,10 +4,7 @@ set -e
|
|||||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
||||||
|
|
||||||
# Check prerequisites
|
# Check prerequisites
|
||||||
# TODO: Have setup prereqs in a manifest file
|
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
|
||||||
for SERVICE in postgres; do
|
|
||||||
[ ! -e /run/openrc/started/${SERVICE} ] && service ${SERVICE} start && STOP_SERVICES="${STOP_SERVICES} ${SERVICE}"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Create database
|
# Create database
|
||||||
export CRISISCLEANUP_PWD=$(head -c 18 /dev/urandom | base64)
|
export CRISISCLEANUP_PWD=$(head -c 18 /dev/urandom | base64)
|
||||||
@ -39,6 +36,4 @@ cp ${SOURCE_DIR}/etc/init.d/crisiscleanup /etc/init.d/crisiscleanup
|
|||||||
rc-update -u
|
rc-update -u
|
||||||
|
|
||||||
# Stop services required for setup
|
# Stop services required for setup
|
||||||
for SERVICE in ${STOP_SERVICES}; do
|
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
|
||||||
service ${SERVICE} stop
|
|
||||||
done
|
|
||||||
|
@ -4,10 +4,7 @@ set -e
|
|||||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
||||||
|
|
||||||
# Check prerequisites
|
# Check prerequisites
|
||||||
# TODO: Have setup prereqs in a manifest file
|
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
|
||||||
for SERVICE in postgres; do
|
|
||||||
[ ! -e /run/openrc/started/${SERVICE} ] && service ${SERVICE} start && STOP_SERVICES="${STOP_SERVICES} ${SERVICE}"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Create database
|
# Create database
|
||||||
export CTS_PWD=$(head -c 18 /dev/urandom | base64)
|
export CTS_PWD=$(head -c 18 /dev/urandom | base64)
|
||||||
@ -43,6 +40,4 @@ cp ${SOURCE_DIR}/etc/init.d/cts /etc/init.d/cts
|
|||||||
rc-update -u
|
rc-update -u
|
||||||
|
|
||||||
# Stop services required for setup
|
# Stop services required for setup
|
||||||
for SERVICE in ${STOP_SERVICES}; do
|
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
|
||||||
service ${SERVICE} stop
|
|
||||||
done
|
|
||||||
|
@ -4,10 +4,7 @@ set -e
|
|||||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
||||||
|
|
||||||
# Check prerequisites
|
# Check prerequisites
|
||||||
# TODO: Have setup prereqs in a manifest file
|
[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1
|
||||||
for SERVICE in postgres; do
|
|
||||||
[ ! -e /run/openrc/started/${SERVICE} ] && service ${SERVICE} start && STOP_SERVICES="${STOP_SERVICES} ${SERVICE}"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Create databases
|
# Create databases
|
||||||
export GNUHEALTH_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '/+=')
|
export GNUHEALTH_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '/+=')
|
||||||
@ -27,7 +24,7 @@ vmmgr update-login gnuhealth "${GNUHEALTH_ADMIN_USER}" "${GNUHEALTH_ADMIN_PWD}"
|
|||||||
|
|
||||||
# Populate demo database
|
# Populate demo database
|
||||||
wget http://health.gnu.org/downloads/postgres_dumps/gnuhealth-32-demo.sql.gz -O /tmp/gnuhealth_demo.sql.gz
|
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 | lxc-attach -u 5432 -g 5432 postgres -- sh -c 'PGPASSWORD=${GNUHEALTH_PWD} psql gnuhealth_demo gnuhealth'
|
zcat /tmp/gnuhealth_demo.sql.gz | lxc-attach -u 5432 -g 5432 postgres -- sh -c "PGPASSWORD=${GNUHEALTH_PWD} psql gnuhealth_demo gnuhealth"
|
||||||
rm -f /tmp/gnuhealth_demo.sql.gz
|
rm -f /tmp/gnuhealth_demo.sql.gz
|
||||||
|
|
||||||
# Install service
|
# Install service
|
||||||
@ -35,6 +32,4 @@ cp ${SOURCE_DIR}/etc/init.d/gnuhealth /etc/init.d/gnuhealth
|
|||||||
rc-update -u
|
rc-update -u
|
||||||
|
|
||||||
# Stop services required for setup
|
# Stop services required for setup
|
||||||
for SERVICE in ${STOP_SERVICES}; do
|
[ ! -z ${STOP_POSTGRES} ] && service postgres stop
|
||||||
service ${SERVICE} stop
|
|
||||||
done
|
|
||||||
|
@ -16,9 +16,9 @@ ${SOURCE_DIR}/solr/setup.sh
|
|||||||
${SOURCE_DIR}/ckan/setup.sh
|
${SOURCE_DIR}/ckan/setup.sh
|
||||||
${SOURCE_DIR}/crisiscleanup/setup.sh
|
${SOURCE_DIR}/crisiscleanup/setup.sh
|
||||||
${SOURCE_DIR}/cts/setup.sh
|
${SOURCE_DIR}/cts/setup.sh
|
||||||
#${SOURCE_DIR}/frontlinesms/setup.sh
|
${SOURCE_DIR}/frontlinesms/setup.sh
|
||||||
#${SOURCE_DIR}/gnuhealth/setup.sh
|
${SOURCE_DIR}/gnuhealth/setup.sh
|
||||||
#${SOURCE_DIR}/kanboard/setup.sh
|
${SOURCE_DIR}/kanboard/setup.sh
|
||||||
#${SOURCE_DIR}/opendatakit/setup.sh
|
#${SOURCE_DIR}/opendatakit/setup.sh
|
||||||
#${SOURCE_DIR}/opendatakit-build/setup.sh
|
#${SOURCE_DIR}/opendatakit-build/setup.sh
|
||||||
#${SOURCE_DIR}/openmapkit/setup.sh
|
#${SOURCE_DIR}/openmapkit/setup.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user