blob: f2faad54cc18f3ffaa01a2b282a9bb3d2700295b [file] [log] [blame]
Fatih Degirmenciaadea7b2019-07-29 21:19:42 +02001#!/bin/bash
2
3# ============LICENSE_START=======================================================
4# Copyright (C) 2019 The Nordix Foundation. All rights reserved.
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# SPDX-License-Identifier: Apache-2.0
19# ============LICENSE_END=========================================================
20
21set -o errexit
22set -o nounset
23
24cd $WORKSPACE
Fatih Degirmencic01b6d52019-07-30 13:51:09 +020025/bin/rm -f ../inventory.ini
Fatih Degirmenciaadea7b2019-07-29 21:19:42 +020026echo "Info: Preparing for ONAP deployment"
27
28# checkout given engine version
29if [[ "$ENGINE_VERSION" != "master" ]]; then
30 echo "Warning: Checking out $ENGINE_VERSION"
31 git checkout -q $ENGINE_VERSION
32fi
33
34# checkout given engine refspec
35if [[ "$ENGINE_REFSPEC" != "master" ]]; then
Fatih Degirmenci0d464752019-07-30 12:14:02 +020036 echo "Warning: Checking out engine $ENGINE_REFSPEC"
37 echo "-------------------------------------------------------------------------"
38 git fetch https://gerrit.nordix.org/infra/engine $ENGINE_REFSPEC && git checkout -q FETCH_HEAD
39 echo "-------------------------------------------------------------------------"
Fatih Degirmenciaadea7b2019-07-29 21:19:42 +020040fi
41
42# update scenario version and refspec in engine/envine/var/sdf.yml
43if [[ "$DEPLOY_SCENARIO_VERSION" != "master" && "$DEPLOY_SCENARIO_REFSPEC" != "master" ]]; then
44 echo "Warning: Adding $DEPLOY_SCENARIO_VERSION as scenario version and $DEPLOY_SCENARIO_REFSPEC as scenario refspec"
45cat << EOF > $WORKSPACE/engine/var/sdf.yml
46scenario:
47 $DEPLOY_SCENARIO:
48 scm: git
49 src: https://gerrit.nordix.org/infra/swconfig.git
50 version: $DEPLOY_SCENARIO_VERSION
51 refspec: $DEPLOY_SCENARIO_REFSPEC
52 provisioners:
53 - $PROVISIONER_TYPE
54 installers:
55 $INSTALLER_TYPE:
56 role: scenarios/$DEPLOY_SCENARIO/$INSTALLER_TYPE/role/$DEPLOY_SCENARIO
57 distros:
58 - $DISTRO
59EOF
Fatih Degirmencif3afb6d2019-07-29 22:27:40 +020060
61 echo "Info: Temporary SDF content"
62 echo "-------------------------------------------------------------------------"
63 cat $WORKSPACE/engine/var/sdf.yml
64 echo "-------------------------------------------------------------------------"
Fatih Degirmenciaadea7b2019-07-29 21:19:42 +020065fi
66
67echo "Info: Starting K8S cluster creation and ONAP deployment"
68echo "-------------------------------------------------------------------------"
69cd $WORKSPACE
Fatih Degirmenci0a2e2132020-03-06 21:57:58 +010070./engine/deploy.sh -r $PROVISIONER_TYPE -u /tmp/openrc \
Fatih Degirmenciaadea7b2019-07-29 21:19:42 +020071 -s $DEPLOY_SCENARIO -e $HEAT_ENVIRONMENT_FILE
72
Fatih Degirmencic01b6d52019-07-30 13:51:09 +020073cd $WORKSPACE
Fatih Degirmenci108bf442020-01-08 10:28:24 +010074/bin/cp /opt/engine/.cache/config/inventory.ini ../inventory.ini
Fatih Degirmenciaadea7b2019-07-29 21:19:42 +020075# vim: set ts=2 sw=2 expandtab: