File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,28 +46,21 @@ until confd -onetime -node $ETCD -config-file /app/confd.toml 2>/dev/null; do
4646 sleep $(( $ETCD_TTL / 2 )) # sleep for half the TTL
4747done
4848
49- # wait for confd to populate all values
50- while grep -q ' <no value>' /templates/confd_settings.py; do
51- echo " controller: waiting for confd to write all values..."
52- confd -onetime -node $ETCD -config-file /app/confd.toml 2> /dev/null
53- sleep $(( $ETCD_TTL / 2 )) # sleep for half the TTL
54- done
55-
5649cd /app
5750
5851# run an idempotent database migration
5952sudo -E -u deis ./manage.py syncdb --migrate --noinput
6053
61- # spawn celery worker in the background
54+ # spawn celery workers in the background
6255sudo -E -u deis celery worker --app=deis --loglevel=INFO --workdir=/app --pidfile=/tmp/celery.pid &
63- CELERY_PID=$!
6456
65- # spawn a gunicorn server in the foreground
57+ # spawn a gunicorn server in the background
6658sudo -E -u deis ./manage.py run_gunicorn -b 0.0.0.0 -w 8 -t 600 -n deis --log-level debug --pid=/tmp/gunicorn.pid --preload &
67- GUNICORN_PID=$!
6859
6960# smart shutdown on SIGINT and SIGTERM
7061function on_exit() {
62+ CELERY_PID=$( cat /tmp/celery.pid)
63+ GUNICORN_PID=$( cat /tmp/gunicorn.pid)
7164 kill -TERM $CELERY_PID $GUNICORN_PID
7265 wait $CELERY_PID $GUNICORN_PID 2> /dev/null
7366 exit 0
Original file line number Diff line number Diff line change 33# Check that the configuration for deis-controller is valid.
44#
55
6- if [[ -f /templates/confd_settings.py ]] ; then
7- set -e
8-
9- # check that "<no value>" isn't in the templated file
10- grep -q -v " <no value>" /templates/confd_settings.py
11-
12- THIS_DIR=$( cd $( dirname $0 ) ; pwd) # absolute path
13- PARENT_DIR=$( dirname $THIS_DIR )
14-
15- # check the Django configuration file compatibility
16- $PARENT_DIR /manage.py check > /dev/null
17-
18- # validate the Django models
19- $PARENT_DIR /manage.py validate > /dev/null
6+ if grep -q " <no value>" $1 ; then
7+ exit 1
208fi
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ kill -HUP $(cat /tmp/celery.pid)
66# gracefully reload gunicorn
77kill -HUP $( cat /tmp/gunicorn.pid)
88
9- exit 0
9+ exit 0
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ keys = [
1111 " /deis/registry" ,
1212 " /deis/domains" ,
1313]
14- check_cmd = " /app/bin/check"
14+ check_cmd = " /app/bin/check {{ .src }} "
1515reload_cmd = " /app/bin/reload"
Original file line number Diff line number Diff line change 33# Check that the configuration for deis-database is valid.
44#
55
6- set -e
7-
8- # check that "<no value>" isn't in the templated files
9- if [[ -f /etc/postgresql/9.3/main/postgresql.conf ]] ; then
10- grep -q -v " <no value>" /etc/postgresql/9.3/main/postgresql.conf
11- fi
12- if [[ -f /etc/postgresql/9.3/main/pg_hba.conf ]] ; then
13- grep -q -v " <no value>" /etc/postgresql/9.3/main/pg_hba.conf
14- fi
15- if [[ -f /usr/local/bin/reload ]] ; then
16- grep -q -v " <no value>" /usr/local/bin/reload
6+ if grep -q " <no value>" $1 ; then
7+ exit 1
178fi
Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ mode = "0640"
77keys = [
88 " /deis/database" ,
99]
10- check_cmd = " /app/bin/check"
10+ check_cmd = " /app/bin/check {{ .src }} "
1111reload_cmd = " /usr/local/bin/reload"
Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ mode = "0644"
77keys = [
88 " /deis/database" ,
99]
10- check_cmd = " /app/bin/check"
10+ check_cmd = " /app/bin/check {{ .src }} "
1111reload_cmd = " /usr/local/bin/reload"
Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ mode = "0755"
77keys = [
88 " /deis/database" ,
99]
10- check_cmd = " /app/bin/check"
10+ check_cmd = " /app/bin/check {{ .src }} "
1111reload_cmd = " /usr/local/bin/reload"
Original file line number Diff line number Diff line change 33# Check that the configuration for deis-registry is valid.
44#
55
6- if [[ -f /docker-registry/config/config.yml ]] ; then
7- set -e
8-
9- # check that "<no value>" isn't in the templated file
10- grep -q -v " <no value>" /docker-registry/config/config.yml
6+ if grep -q " <no value>" $1 ; then
7+ exit 1
118fi
Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ mode = "0644"
77keys = [
88 " /deis/registry" ,
99]
10- check_cmd = " /app/bin/check"
10+ check_cmd = " /app/bin/check {{ .src }} "
1111reload_cmd = " /app/bin/reload"
You can’t perform that action at this time.
0 commit comments