2015-09-10 00:16:35 +03:00
#!/bin/bash
2016-02-16 00:59:21 +03:00
set +x
2015-09-10 00:16:35 +03:00
2015-09-10 16:32:01 +03:00
# Wait for the databases to come up
ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=postgres port=5432" all
2016-08-24 23:23:47 +03:00
ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=memcached port=11211" all
2016-09-08 18:02:51 +03:00
ansible -i "127.0.0.1," -c local -v -m wait_for -a " host= ${ RABBITMQ_HOST } port=5672 " all
2015-09-10 00:16:35 +03:00
2017-07-18 18:16:18 +03:00
# In case AWX in the container wants to connect to itself, use "docker exec" to attach to the container otherwise
2016-08-24 23:23:47 +03:00
# TODO: FIX
#/etc/init.d/ssh start
2016-10-06 23:05:39 +03:00
2015-09-10 00:16:35 +03:00
ansible -i "127.0.0.1," -c local -v -m postgresql_user -U postgres -a "name=awx-dev password=AWXsome1 login_user=postgres login_host=postgres" all
ansible -i "127.0.0.1," -c local -v -m postgresql_db -U postgres -a "name=awx-dev owner=awx-dev login_user=postgres login_host=postgres" all
# Move to the source directory so we can bootstrap
2017-07-18 18:16:18 +03:00
if [ -f "/awx_devel/manage.py" ] ; then
cd /awx_devel
2015-09-10 00:16:35 +03:00
else
2017-07-18 18:16:18 +03:00
echo "Failed to find awx source tree, map your development tree volume"
2015-09-10 00:16:35 +03:00
fi
2015-09-10 18:03:45 +03:00
2017-07-26 17:58:46 +03:00
cp -R /tmp/awx.egg-info /awx_devel/ || true
sed -i " s/placeholder/ $( git describe --long | sed 's/\./\\./g' ) / " /awx_devel/awx.egg-info/PKG-INFO
cp /tmp/awx.egg-link /venv/awx/lib/python2.7/site-packages/awx.egg-link
2017-07-18 18:16:18 +03:00
ln -s /awx_devel/tools/rdb.py /venv/awx/lib/python2.7/site-packages/rdb.py || true
yes | cp -rf /awx_devel/tools/docker-compose/supervisor.conf /supervisor.conf
2016-03-09 22:33:42 +03:00
2017-07-18 18:16:18 +03:00
# AWX bootstrapping
2015-09-10 00:16:35 +03:00
make version_file
make migrate
2017-06-22 15:37:37 +03:00
make init
2015-09-10 00:16:35 +03:00
2017-07-18 18:16:18 +03:00
mkdir -p /awx_devel/awx/public/static
mkdir -p /awx_devel/awx/ui/static
2016-10-28 21:21:19 +03:00
2015-09-10 00:16:35 +03:00
# Start the service
2017-02-13 00:13:15 +03:00
2017-07-18 18:16:18 +03:00
if [ -f "/awx_devel/tools/docker-compose/use_dev_supervisor.txt" ] ; then
2017-02-13 00:13:15 +03:00
make supervisor
else
2017-06-22 15:37:37 +03:00
honcho start -f "tools/docker-compose/Procfile"
2017-02-13 00:13:15 +03:00
fi