blob: 7b102cadfd2d9f4fcdb89e3f4b6d0c2ba6a4f3b9 [file] [log] [blame]
Grinberg Moticd6eeaa2017-02-23 14:26:04 +02001#!/bin/bash
Michael Lando451a3402017-02-19 10:28:42 +02002
Petr Ospalý968cd1f2019-09-20 05:51:37 +02003# prepare env for HTTPS if used
4
5is_https=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
6 jq -cr '.default_attributes.disableHttp' | \
7 tr '[:upper:]' '[:lower:]')
8
9if [ "$is_https" = true ] ; then
10 # setup /etc/hosts
11 SDC_FE_IP=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
12 jq -cr '.default_attributes.Nodes.FE')
13 SDC_FE_HOSTNAME=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
14 jq -cr '.override_attributes.FE.domain_name')
15 if ! grep -q "^[[:space:]]*${SDC_FE_IP}[[:space:]]" ; then
16 echo "${SDC_FE_IP}" "${SDC_FE_HOSTNAME}" >> /etc/hosts
17 fi
18fi
19
20# run tests
21
Michael Lando451a3402017-02-19 10:28:42 +020022cd /root/chef-solo
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020023chef-solo -c solo.rb -E ${ENVNAME}
24
25rc=$?
26
27if [[ $rc != 0 ]]; then
kaihlavi02f48802019-07-30 19:23:52 +030028 echo "Startup failed !!!"
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020029 exit $rc
30else
kaihlavi02f48802019-07-30 19:23:52 +030031# Note that the output below is monitored in CSIT by
32# sdc/sdc-os-chef/scripts/docker_run.sh
33# If this text is changed, docker_run.sh check for sdc-api-tests docker
34# startup must be adjusted accordingly!
35 echo "Startup completed successfully"
36fi