3 # ============LICENSE_START====================================================
4 # Copyright (C) 2024 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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END======================================================
22 function getDockerVersion
26 DEFAULT_DOCKER_IMAGE_NAME=${3:-}
27 DEFAULT_DOCKER_IMAGE_VERSION=${4:-}
31 "https://github.com/onap/policy-parent/raw/${GERRIT_BRANCH}/integration/src/main/resources/release/pf_release_data.csv" |
35 # shellcheck disable=SC2034
41 <<< "$(echo "$REPO_RELEASE_DATA" | tr ',' ' ' )"
43 if [[ -z "$docker_images" ]]
45 if [[ -z "$DEFAULT_DOCKER_IMAGE_NAME" ]]
47 echo "repo $REPO does not produce a docker image, execution terminated"
50 docker_images="$DEFAULT_DOCKER_IMAGE_NAME"
54 # docker_image_version=$(echo "$latest_snapshot_tag" | awk -F \. '{print $1"."$2"-SNAPSHOT-latest"}')
55 docker_image_version=$latest_snapshot_tag
56 docker_image_name=$(echo "$docker_images" | sed -e "s/^.*://" -e "s/^.//" -e "s/.$//")
60 "https://nexus3.onap.org/service/rest/repository/browse/docker.snapshot/v2/onap/$docker_image_name/tags/" |
61 grep -q "$docker_image_version"
63 echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
67 docker_image_version="$latest_released_tag"
70 "https://nexus3.onap.org/service/rest/repository/browse/docker.release/v2/onap/$docker_image_name/tags/" |
71 grep -q "$docker_image_version"
73 echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
77 docker_image_version="$DEFAULT_DOCKER_IMAGE_VERSION"
80 "https://nexus3.onap.org/service/rest/repository/browse/docker.release/v2/onap/$docker_image_name/tags/" |
81 grep -q "$docker_image_version"
83 echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
86 echo "docker image \"$docker_image_name:$docker_image_version\" not found for repo \"$repo\""
92 if [ -z "${WORKSPACE}" ]; then
93 WORKSPACE=$(git rev-parse --show-toplevel)
98 echo "No release versions provided. Fetching the default version for ACM and participants"
99 echo "Usage: $0 <acm_release> <participant_release> ..."
100 ACM_RELEASE=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
101 "${WORKSPACE}"/.gitreview)
102 PPNT_RELEASE=$ACM_RELEASE
112 export POLICY_MARIADB_VER=10.10.2
113 echo POLICY_MARIADB_VER=${POLICY_MARIADB_VER}
115 export POLICY_POSTGRES_VER=11.1
116 echo POLICY_POSTGRES_VER=${POLICY_POSTGRES_VER}
118 getDockerVersion models $ACM_RELEASE "'policy-models-simulator'" 3.0.1
119 export POLICY_MODELS_VERSION="$docker_image_version"
121 getDockerVersion docker $ACM_RELEASE
122 export POLICY_DOCKER_VERSION="$docker_image_version"
124 getDockerVersion api $ACM_RELEASE
125 export POLICY_API_VERSION="$docker_image_version"
127 getDockerVersion pap $ACM_RELEASE
128 export POLICY_PAP_VERSION="$docker_image_version"
130 getDockerVersion apex-pdp $ACM_RELEASE
131 export POLICY_APEX_PDP_VERSION="$docker_image_version"
133 getDockerVersion clamp $ACM_RELEASE
134 export POLICY_CLAMP_VERSION="$docker_image_version"
136 getDockerVersion clamp $PPNT_RELEASE
137 export POLICY_CLAMP_PPNT_VERSION="$docker_image_version"
139 getDockerVersion drools-pdp $ACM_RELEASE
140 export POLICY_DROOLS_PDP_VERSION="$docker_image_version"
142 getDockerVersion xacml-pdp $ACM_RELEASE
143 export POLICY_XACML_PDP_VERSION="$docker_image_version"
145 getDockerVersion distribution $ACM_RELEASE
146 export POLICY_DISTRIBUTION_VERSION="$docker_image_version"
148 getDockerVersion drools-applications $ACM_RELEASE
149 export POLICY_DROOLS_APPS_VERSION="$docker_image_version"