summaryrefslogtreecommitdiffstats
path: root/plans/aaf/certservice/setup.sh
diff options
context:
space:
mode:
authorAleksandra Maciaga <aleksandra.maciaga@nokia.com>2020-03-09 10:01:12 +0100
committerAleksandra Maciaga <aleksandra.maciaga@nokia.com>2020-03-10 10:53:31 +0100
commit7ce0799f3ffd2c9ba9d29bb7240d174540f7ad62 (patch)
tree8b2d18367a8eadaf74d97eff2bd5277951a394c6 /plans/aaf/certservice/setup.sh
parent7ca7e9aabe2b2f35888e505061894ed0a491e4c2 (diff)
Add waiting for containers to set up
Signed-off-by: Aleksandra Maciaga <aleksandra.maciaga@nokia.com> Issue-ID: AAF-997 Change-Id: I049f7d2997f74b22dd53f47bc925dcfdb1df3b10
Diffstat (limited to 'plans/aaf/certservice/setup.sh')
-rw-r--r--plans/aaf/certservice/setup.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/plans/aaf/certservice/setup.sh b/plans/aaf/certservice/setup.sh
index dde516ae..a89a1625 100644
--- a/plans/aaf/certservice/setup.sh
+++ b/plans/aaf/certservice/setup.sh
@@ -53,9 +53,23 @@ export SCRIPTS_PATH=${SCRIPTS_PATH}
docker-compose up -d
-AAFCERT_IP=`get-instance-ip.sh aafcert`
-export AAFCERT_IP=${AAFCERT_IP}
-
+AAFCERT_IP='none'
# Wait container ready
-sleep 15
+for i in {1..9}
+do
+ AAFCERT_IP=`get-instance-ip.sh aafcert`
+ RESP_CODE=$(curl -I -s -o /dev/null -w "%{http_code}" http://${AAFCERT_IP}:8080/actuator/health)
+ if [[ "$RESP_CODE" == '200' ]]; then
+ echo 'AAF Cert Service is ready'
+ export AAFCERT_IP=${AAFCERT_IP}
+ docker exec aafcert-ejbca /opt/primekey/scripts/ejbca-configuration.sh
+ break
+ fi
+ echo 'Waiting for AAF Cert Service to start up...'
+ sleep 30s
+done
+if [[ $AAFCERT_IP == 'none' ] || [ $AAFCERT_IP == '' ]]; then
+ echo "AAF Cert Service is not ready!"
+ exit 1 # Return error code
+fi