Bilal A | 9f54c00 | 2020-01-16 16:12:19 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ============LICENSE_START======================================================= |
| 3 | # Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. |
| 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 | # SPDX-License-Identifier: Apache-2.0 |
| 18 | # ============LICENSE_END========================================================= |
| 19 | |
| 20 | source ${SCRIPTS}/policy/config/policy-csit.conf |
| 21 | |
| 22 | POLICY_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()' -)" |
| 23 | export POLICY_MODELS_VERSION="${POLICY_MODELS_VERSION_EXTRACT}" |
| 24 | echo ${POLICY_MODELS_VERSION} |
| 25 | |
| 26 | # download dmaap tarball and build docker image |
| 27 | git clone --depth 1 https://gerrit.onap.org/r/policy/models -b ${GERRIT_BRANCH} |
| 28 | cd models/models-sim/models-sim-dmaap |
| 29 | item=`curl --silent -L ${NEXUS_URL}/org/onap/policy/models/sim/policy-models-sim-dmaap/${POLICY_MODELS_VERSION} | egrep 'policy-models-sim-dmaap-.*tarball' | cut '-d"' -f2 | egrep 'gz$' | sort | tail -1` |
| 30 | mkdir target |
| 31 | curl -L $item -o target/policy-models-sim-dmaap-${POLICY_MODELS_VERSION}-tarball.tar.gz |
| 32 | bash ./src/main/package/docker/docker_build.sh |
| 33 | cd ${WORKSPACE} |
| 34 | rm -rf ${WORK_DIR} |
| 35 | |