vrvarma | 3fe70c7 | 2018-09-28 10:30:00 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # ------------------------------------------------------------------------- |
| 4 | # Copyright (c) 2018 AT&T Intellectual Property |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # |
| 18 | # ------------------------------------------------------------------------- |
| 19 | # |
| 20 | |
| 21 | echo "### This is ${WORKSPACE}/scripts/optf-osdf/osdf/osdf_script.sh" |
| 22 | # |
| 23 | # add here whatever commands is needed to prepare the optf/osdf CSIT testing |
| 24 | # |
| 25 | |
| 26 | # assume the base is /tmp dir |
| 27 | DIR=/tmp |
| 28 | |
| 29 | # the directory of the script |
| 30 | echo ${DIR} |
| 31 | cd ${DIR} |
| 32 | |
| 33 | # create directory for volume and copy configuration file |
| 34 | # run docker containers |
| 35 | OSDF_CONF=/tmp/osdf/properties/osdf_config.yaml |
| 36 | IMAGE_NAME=nexus3.onap.org:10001/onap/optf-osdf |
vrvarma | c59a09a | 2020-03-18 15:59:21 -0400 | [diff] [blame^] | 37 | IMAGE_VER=2.0.1-SNAPSHOT-latest |
vrvarma | 3fe70c7 | 2018-09-28 10:30:00 -0400 | [diff] [blame] | 38 | |
| 39 | mkdir -p /tmp/osdf/properties |
Dileep Ranganathan | 425ba92 | 2018-10-04 15:34:34 -0700 | [diff] [blame] | 40 | mkdir -p /tmp/sms/properties |
vrvarma | 3fe70c7 | 2018-09-28 10:30:00 -0400 | [diff] [blame] | 41 | |
| 42 | cp ${WORKSPACE}/scripts/optf-osdf/osdf/osdf-properties/*.yaml /tmp/osdf/properties/. |
Dileep Ranganathan | 425ba92 | 2018-10-04 15:34:34 -0700 | [diff] [blame] | 43 | cp ${WORKSPACE}/scripts/optf-osdf/osdf/osdf-properties/osdf.json /tmp/sms/properties/. |
vrvarma | 3fe70c7 | 2018-09-28 10:30:00 -0400 | [diff] [blame] | 44 | |
| 45 | #change conductor/configdb simulator urls |
| 46 | OSDF_SIM_IP=`get-instance-ip.sh osdf_sim` |
| 47 | echo "OSDF_SIM_IP=${OSDF_SIM_IP}" |
Dileep Ranganathan | 425ba92 | 2018-10-04 15:34:34 -0700 | [diff] [blame] | 48 | SMS_IP=`get-instance-ip.sh sms` |
| 49 | echo "SMS_IP=${SMS_IP}" |
vrvarma | 3fe70c7 | 2018-09-28 10:30:00 -0400 | [diff] [blame] | 50 | |
| 51 | sed -i -e "s%127.0.0.1:5000%${OSDF_SIM_IP}:5000%g" $OSDF_CONF |
Dileep Ranganathan | 425ba92 | 2018-10-04 15:34:34 -0700 | [diff] [blame] | 52 | sed -i -e "s%aaf-sms.onap:10443%${SMS_IP}:10443%g" $OSDF_CONF |
vrvarma | 3fe70c7 | 2018-09-28 10:30:00 -0400 | [diff] [blame] | 53 | |
Dileep Ranganathan | 425ba92 | 2018-10-04 15:34:34 -0700 | [diff] [blame] | 54 | #Preload secrets |
| 55 | docker exec -i sms /bin/sh -c "mkdir -p /preload/config" |
| 56 | docker cp /tmp/sms/properties/osdf.json sms:/preload/config/osdf.json |
| 57 | docker exec -i sms /bin/sh -c "/sms/bin/preload -cacert /sms/certs/aaf_root_ca.cer -jsondir /preload/config -serviceport 10443 -serviceurl http://localhost" |
| 58 | |
| 59 | docker logs vault |
vrvarma | 3fe70c7 | 2018-09-28 10:30:00 -0400 | [diff] [blame] | 60 | docker run -d --name optf-osdf -v ${OSDF_CONF}:/opt/osdf/config/osdf_config.yaml -p "8698:8699" ${IMAGE_NAME}:${IMAGE_VER} |
| 61 | |
| 62 | sleep 20 |
| 63 | |
| 64 | OSDF_IP=`get-instance-ip.sh optf-osdf` |
| 65 | ${WORKSPACE}/scripts/optf-osdf/osdf/wait_for_port.sh ${OSDF_IP} 8699 |
| 66 | |
| 67 | echo "inspect docker things for tracing purpose" |
| 68 | docker inspect optf-osdf |