blob: 17a278d8fb0857c07744b6ad5856feb5f2db9b8e [file] [log] [blame]
Aleksandra Maciaga6def5972020-02-20 09:42:03 +01001#!/bin/bash
2#
Bogumil Zebek78bc8f32020-02-27 07:39:38 +01003# Copyright 2020 Nokia.
Aleksandra Maciaga6def5972020-02-20 09:42:03 +01004#
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
Bogumil Zebek78bc8f32020-02-27 07:39:38 +010018# ------------------------------------
Aleksandra Maciaga93f9ea42020-03-03 13:38:58 +010019# Resolve path to script's directory and cmp servers configuration
Bogumil Zebek78bc8f32020-02-27 07:39:38 +010020
21SCRIPT=`realpath $0`
22CURRENT_WORKDIR_PATH=`dirname $SCRIPT`
Aleksandra Maciaga93f9ea42020-03-03 13:38:58 +010023PROJECT_DIRECTORY="plans/aaf/certservice"
Bogumil Zebek78bc8f32020-02-27 07:39:38 +010024
Aleksandra Maciaga7a5e3f62020-03-03 12:35:16 +010025SCRIPTS_DIRECTORY="scripts"
Aleksandra Maciaga93f9ea42020-03-03 13:38:58 +010026
27JENKINS_SCRIPTS_PATH="$CURRENT_WORKDIR_PATH/$PROJECT_DIRECTORY/$SCRIPTS_DIRECTORY"
28LOCAL_SCRIPTS_PATH="$CURRENT_WORKDIR_PATH/$SCRIPTS_DIRECTORY"
29
30if test -d "$JENKINS_SCRIPTS_PATH"; then
31 SCRIPTS_PATH=$JENKINS_SCRIPTS_PATH
32else test -f "$LOCAL_SCRIPTS_PATH";
33 SCRIPTS_PATH=$LOCAL_SCRIPTS_PATH
Aleksandra Maciaga7a5e3f62020-03-03 12:35:16 +010034fi
35echo "Use scripts from: $SCRIPTS_PATH"
36
Bogumil Zebek78bc8f32020-02-27 07:39:38 +010037CONFIGURATION_FILE="cmpServers.json"
Aleksandra Maciaga93f9ea42020-03-03 13:38:58 +010038
39JENKINS_CONFIGURATION_PATH="$CURRENT_WORKDIR_PATH/$PROJECT_DIRECTORY/$CONFIGURATION_FILE"
40LOCAL_CONFIGURATION_PATH="$CURRENT_WORKDIR_PATH/$CONFIGURATION_FILE"
41
42if test -f "$JENKINS_CONFIGURATION_PATH"; then
43 CONFIGURATION_PATH="$JENKINS_CONFIGURATION_PATH"
44else test -f "$LOCAL_CONFIGURATION_PATH";
45 CONFIGURATION_PATH=$LOCAL_CONFIGURATION_PATH
Bogumil Zebek78bc8f32020-02-27 07:39:38 +010046fi
47echo "Use configuration from: $CONFIGURATION_PATH"
Aleksandra Maciaga7a5e3f62020-03-03 12:35:16 +010048
Bogumil Zebek78bc8f32020-02-27 07:39:38 +010049# -------------------------------------
50
Aleksandra Maciaga7a5e3f62020-03-03 12:35:16 +010051export CONFIGURATION_PATH=${CONFIGURATION_PATH}
52export SCRIPTS_PATH=${SCRIPTS_PATH}
53
54docker-compose up -d
Aleksandra Maciaga6def5972020-02-20 09:42:03 +010055
56AAFCERT_IP=`get-instance-ip.sh aafcert`
57export AAFCERT_IP=${AAFCERT_IP}
58
59# Wait container ready
Aleksandra Maciaga7a5e3f62020-03-03 12:35:16 +010060sleep 10
Aleksandra Maciaga6def5972020-02-20 09:42:03 +010061