blob: 9e67d487de3ff40af1c4d3d47f2db271b6d67b41 [file] [log] [blame]
Jim Hahn426ddc12020-04-14 15:19:53 -04001#!/bin/bash
2#
3# ============LICENSE_START===================================================
4# Copyright (C) 2020 AT&T Intellectual Property. 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# ============LICENSE_END=====================================================
18#
19
20source ${SCRIPTS}/policy/config/policy-csit.conf
21
Jim Hahnf340ddb2020-04-15 08:43:54 -040022rm -rf ${WORKSPACE}/simulators
23mkdir ${WORKSPACE}/simulators
24cd ${WORKSPACE}/simulators
25
Jim Hahn426ddc12020-04-14 15:19:53 -040026POLICY_MODELS_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/models/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
27export POLICY_MODELS_VERSION="${POLICY_MODELS_VERSION_EXTRACT}"
28echo ${POLICY_MODELS_VERSION}
29
30# download simulators tarball and build docker image
31git clone --depth 1 https://gerrit.onap.org/r/policy/models -b ${GERRIT_BRANCH}
32cd models/models-sim/policy-models-simulators
33item=`curl --silent -L ${NEXUS_URL}/org/onap/policy/models/sim/policy-models-simulators/${POLICY_MODELS_VERSION} | egrep 'policy-models-simulators-.*tarball' | cut '-d"' -f2 | egrep 'gz$' | sort | tail -1`
34mkdir target
35curl -L $item -o target/policy-models-simulators-${POLICY_MODELS_VERSION}-tarball.tar.gz
36bash ./src/main/package/docker/docker_build.sh
Jim Hahn426ddc12020-04-14 15:19:53 -040037
Jim Hahnf340ddb2020-04-15 08:43:54 -040038cd ${WORKSPACE}