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
# In case Tower 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
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
if [ -f "/tower_devel/manage.py" ] ; then
cd /tower_devel
elif [ -f "/tower_devel/ansible-tower/manage.py" ] ; then
cd /tower_devel/ansible-tower
else
echo "Failed to find tower source tree, map your development tree volume"
fi
2015-09-10 18:03:45 +03:00
2016-03-18 05:54:12 +03:00
cp -nR /tmp/ansible_tower.egg-info /tower_devel/ || true
2015-09-10 00:16:35 +03:00
# Check if we need to build dependencies
2016-04-06 19:24:19 +03:00
#if [ -f "awx/lib/.deps_built" ]; then
# echo "Skipping dependency build - remove awx/lib/.deps_built to force a rebuild"
#else
2016-08-24 23:23:47 +03:00
#SWIG_FEATURES="-cpperraswarn -includeall -D__`uname -m`__ -I/usr/include/openssl" make requirements_dev
2016-04-06 19:24:19 +03:00
# touch awx/lib/.deps_built
#fi
2015-09-10 00:16:35 +03:00
2016-08-24 23:23:47 +03:00
cp /tmp/ansible-tower.egg-link /venv/tower/lib/python2.7/site-packages/ansible-tower.egg-link
2016-03-09 22:33:42 +03:00
2015-09-10 00:16:35 +03:00
# Tower bootstrapping
make version_file
make migrate
make init
# Start the service
make honcho