From c42c59d9ac745a59173dc4bf4628e8d08ea1ce82 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Tue, 27 Mar 2018 16:27:09 +0200 Subject: [PATCH] Use Motech IP in install script instead of hostname --- motech.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/motech.sh b/motech.sh index 65ab933..5b755e6 100755 --- a/motech.sh +++ b/motech.sh @@ -31,13 +31,14 @@ service motech start # Configure Motech admin echo `date` '- Waiting for database to be populated. This should take about a minute.' -until curl -s "http://motech:8080/motech/module/server/startup/" | grep -q adminLogin; do +MOTECH_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' motech) +until curl -s "http://${MOTECH_IP}:8080/motech/module/server/startup/" | grep -q adminLogin; do sleep 1 done 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:8080/motech/module/server/startup/ +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/motech/module/server/startup/ # Add application definition spotter-appmgr add-app motech "https://motech.{host}/motech/" "${MOTECH_ADMIN_USER}" "${MOTECH_ADMIN_PWD}"