3 # ============LICENSE_START====================================================
4 # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
5 # Modification Copyright 2021-2024 Nordix Foundation.
6 # Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
7 # =============================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
20 # SPDX-License-Identifier: Apache-2.0
21 # ============LICENSE_END======================================================
23 if [ -z "${WORKSPACE}" ]; then
24 WORKSPACE=$(git rev-parse --show-toplevel)
28 GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
29 "${WORKSPACE}"/.gitreview)
31 echo GERRIT_BRANCH="${GERRIT_BRANCH}"
33 export POLICY_MARIADB_VER=10.10.2
34 echo POLICY_MARIADB_VER=${POLICY_MARIADB_VER}
36 export POLICY_POSTGRES_VER=11.1
37 echo POLICY_POSTGRES_VER=${POLICY_POSTGRES_VER}
39 function getDockerVersion
42 DEFAULT_DOCKER_IMAGE_NAME=${2:-}
43 DEFAULT_DOCKER_IMAGE_VERSION=${3:-}
47 "https://github.com/onap/policy-parent/raw/$GERRIT_BRANCH/integration/src/main/resources/release/pf_release_data.csv" |
51 # shellcheck disable=SC2034
57 <<< "$(echo "$REPO_RELEASE_DATA" | tr ',' ' ' )"
59 if [[ -z "$docker_images" ]]
61 if [[ -z "$DEFAULT_DOCKER_IMAGE_NAME" ]]
63 echo "repo $REPO does not produce a docker image, execution terminated"
66 docker_images="$DEFAULT_DOCKER_IMAGE_NAME"
70 # docker_image_version=$(echo "$latest_snapshot_tag" | awk -F \. '{print $1"."$2"-SNAPSHOT-latest"}')
71 docker_image_version=$latest_snapshot_tag
72 docker_image_name=$(echo "$docker_images" | sed -e "s/^.*://" -e "s/^.//" -e "s/.$//")
76 "https://nexus3.onap.org/service/rest/repository/browse/docker.snapshot/v2/onap/$docker_image_name/tags/" |
77 grep -q "$docker_image_version"
79 echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
83 docker_image_version="$latest_released_tag"
86 "https://nexus3.onap.org/service/rest/repository/browse/docker.release/v2/onap/$docker_image_name/tags/" |
87 grep -q "$docker_image_version"
89 echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
93 docker_image_version="$DEFAULT_DOCKER_IMAGE_VERSION"
96 "https://nexus3.onap.org/service/rest/repository/browse/docker.release/v2/onap/$docker_image_name/tags/" |
97 grep -q "$docker_image_version"
99 echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
102 echo "docker image \"$docker_image_name:$docker_image_version\" not found for repo \"$repo\""
107 getDockerVersion docker
108 export POLICY_DOCKER_VERSION="$docker_image_version"
110 getDockerVersion models "'policy-models-simulator'" 3.0.1
111 export POLICY_MODELS_VERSION="$docker_image_version"
114 export POLICY_API_VERSION="$docker_image_version"
117 export POLICY_PAP_VERSION="$docker_image_version"
119 getDockerVersion apex-pdp
120 export POLICY_APEX_PDP_VERSION="$docker_image_version"
122 getDockerVersion drools-pdp
123 export POLICY_DROOLS_PDP_VERSION="$docker_image_version"
125 getDockerVersion xacml-pdp
126 export POLICY_XACML_PDP_VERSION="$docker_image_version"
128 getDockerVersion distribution
129 export POLICY_DISTRIBUTION_VERSION="$docker_image_version"
131 getDockerVersion clamp
132 export POLICY_CLAMP_VERSION="$docker_image_version"
133 export POLICY_CLAMP_PPNT_VERSION=$POLICY_CLAMP_VERSION
136 export POLICY_GUI_VERSION="$docker_image_version"
138 getDockerVersion drools-applications
139 export POLICY_DROOLS_APPS_VERSION="$docker_image_version"