Grinberg Moti | cd6eeaa | 2017-02-23 14:26:04 +0200 | [diff] [blame] | 1 | #!/bin/bash |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 2 | |
Petr OspalĂ˝ | 968cd1f | 2019-09-20 05:51:37 +0200 | [diff] [blame] | 3 | # prepare env for HTTPS if used |
| 4 | |
| 5 | is_https=$(cat /root/chef-solo/environments/${ENVNAME}.json | \ |
| 6 | jq -cr '.default_attributes.disableHttp' | \ |
| 7 | tr '[:upper:]' '[:lower:]') |
| 8 | |
| 9 | if [ "$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 |
| 18 | fi |
| 19 | |
| 20 | # run tests |
| 21 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 22 | cd /root/chef-solo |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 23 | chef-solo -c solo.rb -E ${ENVNAME} |
| 24 | |
| 25 | rc=$? |
| 26 | |
| 27 | if [[ $rc != 0 ]]; then |
kaihlavi | 02f4880 | 2019-07-30 19:23:52 +0300 | [diff] [blame] | 28 | echo "Startup failed !!!" |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 29 | exit $rc |
| 30 | else |
kaihlavi | 02f4880 | 2019-07-30 19:23:52 +0300 | [diff] [blame] | 31 | # 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" |
| 36 | fi |