Kiran Kamineni | be7fcd9 | 2018-03-27 11:23:37 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright 2018 Intel Corporation |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | |
| 18 | # Not sure why this is needed. |
| 19 | source ${SCRIPTS}/common_functions.sh |
| 20 | |
| 21 | CONFIG_FILE=$(pwd)/config/smsconfig.json |
| 22 | |
| 23 | mkdir -p $(pwd)/config |
| 24 | |
Kiran Kamineni | be7fcd9 | 2018-03-27 11:23:37 -0700 | [diff] [blame] | 25 | docker login -u docker -p docker nexus3.onap.org:10001 |
| 26 | docker pull nexus3.onap.org:10001/onap/aaf/sms |
Kiran Kamineni | a42f86e | 2018-04-17 11:58:21 -0700 | [diff] [blame] | 27 | docker pull docker.io/vault:0.10.0 |
Kiran Kamineni | eaac220 | 2018-04-03 09:22:06 -0700 | [diff] [blame] | 28 | |
Kiran Kamineni | be7fcd9 | 2018-03-27 11:23:37 -0700 | [diff] [blame] | 29 | # |
| 30 | # Running vault in dev server mode here for CSIT |
| 31 | # In HELM it runs in production mode |
| 32 | # |
| 33 | docker run -e "VAULT_DEV_ROOT_TOKEN_ID=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" \ |
| 34 | -e SKIP_SETCAP=true \ |
Kiran Kamineni | a42f86e | 2018-04-17 11:58:21 -0700 | [diff] [blame] | 35 | --name vault -d -p 8200:8200 vault:0.10.0 |
Kiran Kamineni | eaac220 | 2018-04-03 09:22:06 -0700 | [diff] [blame] | 36 | |
| 37 | SMSDB_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vault) |
| 38 | cat << EOF > $CONFIG_FILE |
| 39 | { |
| 40 | "cafile": "auth/selfsignedca.pem", |
| 41 | "servercert": "auth/server.cert", |
| 42 | "serverkey": "auth/server.key", |
| 43 | |
| 44 | "smsdbaddress": "http://$SMSDB_IP:8200", |
| 45 | "vaulttoken": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", |
| 46 | "disable_tls": true |
| 47 | } |
| 48 | EOF |
| 49 | |
| 50 | cat $CONFIG_FILE |
| 51 | |
| 52 | docker run --workdir /sms -v $CONFIG_FILE:/sms/smsconfig.json \ |
Kiran Kamineni | be7fcd9 | 2018-03-27 11:23:37 -0700 | [diff] [blame] | 53 | --name sms -d -p 10443:10443 nexus3.onap.org:10001/onap/aaf/sms |
| 54 | |
Kiran Kamineni | eaac220 | 2018-04-03 09:22:06 -0700 | [diff] [blame] | 55 | SMS_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sms) |
| 56 | |
Kiran Kamineni | be7fcd9 | 2018-03-27 11:23:37 -0700 | [diff] [blame] | 57 | echo "###### WAITING FOR ALL CONTAINERS TO COME UP" |
Kiran Kamineni | eaac220 | 2018-04-03 09:22:06 -0700 | [diff] [blame] | 58 | sleep 20 |
| 59 | for i in {1..20}; do |
| 60 | curl -sS -m 1 http://${SMSDB_IP}:8200/v1/sys/seal-status && break |
| 61 | echo sleep $i |
| 62 | sleep $i |
| 63 | done |
Kiran Kamineni | be7fcd9 | 2018-03-27 11:23:37 -0700 | [diff] [blame] | 64 | |
| 65 | # |
| 66 | # add here all ROBOT_VARIABLES settings |
| 67 | # |
| 68 | echo "# sms robot variables settings"; |
Kiran Kamineni | eaac220 | 2018-04-03 09:22:06 -0700 | [diff] [blame] | 69 | ROBOT_VARIABLES="-v SMS_HOSTNAME:http://${SMS_IP} -v SMS_PORT:10443" |
Kiran Kamineni | be7fcd9 | 2018-03-27 11:23:37 -0700 | [diff] [blame] | 70 | |
| 71 | echo ${ROBOT_VARIABLES} |