blob: 9e1231ada9e9535b1a3d29a20f5b608907fc1f67 [file] [log] [blame]
liamfallon81c2c512021-12-16 12:56:37 +00001#!/bin/bash
2
3#
4# ============LICENSE_START================================================
5# ONAP
6# =========================================================================
7# Copyright (C) 2021-2022 Nordix Foundation.
8# =========================================================================
9# Licensed under the Apache License, Version 2.0 (the "License");
10# you may not use this file except in compliance with the License.
11# You may obtain a copy of the License at
12#
13# http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing, software
16# distributed under the License is distributed on an "AS IS" BASIS,
17# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18# See the License for the specific language governing permissions and
19# limitations under the License.
20# ============LICENSE_END==================================================
21#
22
23set -e
24
liamfallond7d9a662022-03-01 21:01:03 +000025SCRIPT_NAME=$(basename "$0")
liamfallon81c2c512021-12-16 12:56:37 +000026repo_location="./"
27release_data_file="./pf_release_data.csv"
28
liamfallonb76315a2022-01-12 13:24:54 +000029# Use the bash internal OSTYPE variable to check for MacOS
30if [[ "$OSTYPE" == "darwin"* ]]
31then
32 SED="gsed"
33else
34 SED="sed"
35fi
36
liamfallon81c2c512021-12-16 12:56:37 +000037usage()
38{
39 echo ""
40 echo "$SCRIPT_NAME - updates the inter-repo references in Policy Framework POM files"
41 echo ""
42 echo " usage: $SCRIPT_NAME [-options]"
43 echo ""
44 echo " options"
45 echo " -h - this help message"
46 echo " -d data_file - the policy release data file to use, generated by the 'getReleaseData.sh' script,"
47 echo " defaults to '$release_data_file'"
48 echo " -l location - the location of the policy framework repos on the file system,"
49 echo " defaults to '$repo_location'"
50 echo " -r repo - the policy repo to update"
51 echo " -p - update policy/parent references"
52 echo " -c - update policy/common references"
53 echo " -m - update policy/model references"
54 echo " -o - update policy/drools-pdp references"
liamfallon4d071bf2022-03-16 14:27:21 +000055 echo " -x - update policy/apex-pdp references"
liamfallon81c2c512021-12-16 12:56:37 +000056 echo " -k - update docker base images in Dockerfiles"
liamfallon55556532022-07-13 11:40:56 +010057 echo " -f - update release data in policy parent"
liamfallon81c2c512021-12-16 12:56:37 +000058 echo " -s - update release references to snapshot references,"
59 echo " if omitted, snapshot references are updated to release references"
60 echo ""
61 echo " examples:"
62 echo " $SCRIPT_NAME -pcm -r policy/pap"
63 echo " update the parent, common, and models references of policy/pap"
64 echo " to the current released version"
65 echo ""
66 echo " $SCRIPT_NAME -c -m -s -r policy/api"
67 echo " update the common and models references of policy/api"
68 echo " to the current snapshot version"
69 exit 255;
70}
71
72update_parent=false
73update_common=false
74update_models=false
75update_drools_pdp=false
liamfallon4d071bf2022-03-16 14:27:21 +000076update_apex_pdp=false
liamfallon81c2c512021-12-16 12:56:37 +000077update_snapshot=false
78update_docker=false
liamfallon55556532022-07-13 11:40:56 +010079update_file=false
liamfallon81c2c512021-12-16 12:56:37 +000080
liamfallon55556532022-07-13 11:40:56 +010081while getopts "hd:l:r:pcmoxkfs" opt
liamfallon81c2c512021-12-16 12:56:37 +000082do
83 case $opt in
84 h)
85 usage
86 ;;
87 d)
88 release_data_file=$OPTARG
89 ;;
90 l)
91 repo_location=$OPTARG
92 ;;
93 r)
94 specified_repo=$OPTARG
95 ;;
96 p)
97 update_parent=true
98 ;;
99 c)
100 update_common=true
101 ;;
102 m)
103 update_models=true
104 ;;
105 o)
106 update_drools_pdp=true
107 ;;
liamfallon4d071bf2022-03-16 14:27:21 +0000108 x)
109 update_apex_pdp=true
110 ;;
liamfallon81c2c512021-12-16 12:56:37 +0000111 k)
112 update_docker=true
113 ;;
liamfallon55556532022-07-13 11:40:56 +0100114 f)
115 update_file=true
116 ;;
liamfallon81c2c512021-12-16 12:56:37 +0000117 s)
118 update_snapshot=true
119 ;;
120 \?)
121 usage
122 exit 1
123 ;;
124 esac
125done
126
127if [ $OPTIND -eq 1 ]
128then
129 echo "no arguments were specified"
130 usage
131fi
132
133if [[ -z "$repo_location" ]]
134then
135 echo "policy repo location not specified on -l flag"
136 exit 1
137fi
138
139if ! [ -d "$repo_location" ]
140then
141 echo "policy repo location '$repo_location' not found"
142 exit 1
143fi
144
145if [[ -z "$release_data_file" ]]
146then
147 echo "policy release data file not specified on -d flag"
148 exit 1
149fi
150
151if ! [ -f "$release_data_file" ]
152then
153 echo "policy release data file '$release_data_file' not found"
154 exit 1
155fi
156
157if [ -z "$specified_repo" ]
158then
159 echo "repo not specified on -r flag"
160 exit 1
161fi
162
liamfallond7d9a662022-03-01 21:01:03 +0000163# shellcheck disable=SC2034
164# shellcheck disable=SC2046
165read -r parent_repo \
liamfallon81c2c512021-12-16 12:56:37 +0000166 parent_latest_released_tag \
167 parent_latest_snapshot_tag \
168 parent_changed_files \
169 parent_docker_images \
liamfallond7d9a662022-03-01 21:01:03 +0000170 <<< $(grep policy/parent "$release_data_file" | tr ',' ' ' )
liamfallon81c2c512021-12-16 12:56:37 +0000171
liamfallond7d9a662022-03-01 21:01:03 +0000172# shellcheck disable=SC2034
173# shellcheck disable=SC2046
174read -r common_repo \
liamfallon81c2c512021-12-16 12:56:37 +0000175 common_latest_released_tag \
176 common_latest_snapshot_tag \
177 common_changed_files \
178 common_docker_images \
liamfallond7d9a662022-03-01 21:01:03 +0000179 <<< $(grep policy/common "$release_data_file" | tr ',' ' ' )
liamfallon81c2c512021-12-16 12:56:37 +0000180
liamfallond7d9a662022-03-01 21:01:03 +0000181# shellcheck disable=SC2034
182# shellcheck disable=SC2046
183read -r docker_repo \
liamfallon81c2c512021-12-16 12:56:37 +0000184 docker_latest_released_tag \
185 docker_latest_snapshot_tag \
186 docker_changed_files \
187 docker_docker_images \
liamfallond7d9a662022-03-01 21:01:03 +0000188 <<< $(grep policy/docker "$release_data_file" | tr ',' ' ' )
liamfallon81c2c512021-12-16 12:56:37 +0000189
liamfallond7d9a662022-03-01 21:01:03 +0000190# shellcheck disable=SC2034
191# shellcheck disable=SC2046
192read -r models_repo \
liamfallon81c2c512021-12-16 12:56:37 +0000193 models_latest_released_tag \
194 models_latest_snapshot_tag \
195 models_changed_files \
196 models_docker_images \
liamfallond7d9a662022-03-01 21:01:03 +0000197 <<< $(grep policy/models "$release_data_file" | tr ',' ' ' )
liamfallon81c2c512021-12-16 12:56:37 +0000198
liamfallond7d9a662022-03-01 21:01:03 +0000199# shellcheck disable=SC2034
200# shellcheck disable=SC2046
201read -r drools_pdp_repo \
liamfallon81c2c512021-12-16 12:56:37 +0000202 drools_pdp_latest_released_tag \
203 drools_pdp_latest_snapshot_tag \
204 drools_pdp_changed_files \
205 drools_pdp_docker_images \
liamfallond7d9a662022-03-01 21:01:03 +0000206 <<< $(grep policy/drools-pdp "$release_data_file" | tr ',' ' ' )
liamfallon81c2c512021-12-16 12:56:37 +0000207
liamfallond7d9a662022-03-01 21:01:03 +0000208# shellcheck disable=SC2034
209# shellcheck disable=SC2046
liamfallon4d071bf2022-03-16 14:27:21 +0000210read -r apex_pdp_repo \
211 apex_pdp_latest_released_tag \
212 apex_pdp_latest_snapshot_tag \
213 apex_pdp_changed_files \
214 apex_pdp_docker_images \
215 <<< $(grep policy/apex-pdp "$release_data_file" | tr ',' ' ' )
216
217# shellcheck disable=SC2034
218# shellcheck disable=SC2046
liamfallond7d9a662022-03-01 21:01:03 +0000219read -r target_repo \
liamfallon81c2c512021-12-16 12:56:37 +0000220 target_latest_released_tag \
221 target_latest_snapshot_tag \
222 target_changed_files \
223 target_docker_images \
liamfallond7d9a662022-03-01 21:01:03 +0000224 <<< $(grep "$specified_repo" "$release_data_file" | tr ',' ' ' )
liamfallon81c2c512021-12-16 12:56:37 +0000225
226if [ -z "$target_repo" ]
227then
228 echo "specified repo '$specified_repo' not found in policy release data file '$release_data_file'"
229 exit 1
230fi
231
232if [ ! "$specified_repo" = "$target_repo" ]
233then
234 echo "specified repo '$specified_repo' does not match target repo '$target_repo'"
235 exit 1
236fi
237
238if [ "$update_parent" = true ]
239then
240 if [ "$specified_repo" = "policy/parent" ]
241 then
242 if [ "$update_snapshot" = true ]
243 then
liamfallond7d9a662022-03-01 21:01:03 +0000244 major_version=$(echo "$parent_latest_released_tag" | $SED -E 's/^([0-9]*)\.[0-9]*\.[0-9]*$/\1/')
245 minor_version=$(echo "$parent_latest_released_tag" | $SED -E 's/^[0-9]*\.([0-9]*)\.[0-9]*$/\1/')
246 patch_version=$(echo "$parent_latest_released_tag" | $SED -E 's/^[0-9]*\.[0-9]*\.([0-9]*)$/\1/')
liamfallond7d9a662022-03-01 21:01:03 +0000247
liamfallon6214bfb2022-09-08 16:58:30 +0100248 new_patch_version=$((patch_version+1))
liamfallond7d9a662022-03-01 21:01:03 +0000249 new_snapshot_tag="$major_version"."$minor_version"."$new_patch_version"-SNAPSHOT
250
251 echo updating policy parent reference to "$new_snapshot_tag" on "$repo_location/$target_repo" . . .
liamfallonb76315a2022-01-12 13:24:54 +0000252 $SED -i \
liamfallond7d9a662022-03-01 21:01:03 +0000253 "s/<version.parent.resources>.*<\/version.parent.resources>/<version.parent.resources>$new_snapshot_tag<\/version.parent.resources>/" \
254 "$repo_location/policy/parent/integration/pom.xml"
liamfallon81c2c512021-12-16 12:56:37 +0000255 result_code=$?
256 else
257 next_release_version=${parent_latest_snapshot_tag%-*}
258
liamfallond7d9a662022-03-01 21:01:03 +0000259 echo "updating policy parent reference to $next_release_version on $repo_location/$target_repo . . ."
liamfallonb76315a2022-01-12 13:24:54 +0000260 $SED -i \
liamfallon81c2c512021-12-16 12:56:37 +0000261 "s/<version.parent.resources>.*<\/version.parent.resources>/<version.parent.resources>$next_release_version<\/version.parent.resources>/" \
liamfallond7d9a662022-03-01 21:01:03 +0000262 "$repo_location/policy/parent/integration/pom.xml"
liamfallon81c2c512021-12-16 12:56:37 +0000263 result_code=$?
264 fi
265 else
266 if [ "$update_snapshot" = true ]
267 then
liamfallond7d9a662022-03-01 21:01:03 +0000268 echo "updating policy parent reference to $parent_latest_snapshot_tag on $repo_location/$target_repo . . ."
liamfallon81c2c512021-12-16 12:56:37 +0000269 updateParentRef.sh \
liamfallond7d9a662022-03-01 21:01:03 +0000270 -f "$repo_location/$target_repo/pom.xml" \
liamfallon81c2c512021-12-16 12:56:37 +0000271 -g org.onap.policy.parent \
272 -a integration \
liamfallond7d9a662022-03-01 21:01:03 +0000273 -v "$parent_latest_snapshot_tag"
liamfallon81c2c512021-12-16 12:56:37 +0000274 result_code=$?
275 else
liamfallond7d9a662022-03-01 21:01:03 +0000276 echo "updating policy parent reference to $parent_latest_released_tag on $repo_location/$target_repo . . ."
liamfallon81c2c512021-12-16 12:56:37 +0000277 updateParentRef.sh \
liamfallond7d9a662022-03-01 21:01:03 +0000278 -f "$repo_location/$target_repo/pom.xml" \
liamfallon81c2c512021-12-16 12:56:37 +0000279 -g org.onap.policy.parent \
280 -a integration \
liamfallond7d9a662022-03-01 21:01:03 +0000281 -v "$parent_latest_released_tag"
liamfallon81c2c512021-12-16 12:56:37 +0000282 result_code=$?
283 fi
284 fi
285 if [[ "$result_code" -eq 0 ]]
286 then
liamfallond7d9a662022-03-01 21:01:03 +0000287 echo "policy parent reference updated on $repo_location/$target_repo"
liamfallon81c2c512021-12-16 12:56:37 +0000288 else
liamfallond7d9a662022-03-01 21:01:03 +0000289 echo "policy parent reference update failed on $repo_location/$target_repo"
liamfallon81c2c512021-12-16 12:56:37 +0000290 exit 1
291 fi
292fi
293
294if [ "$update_common" = true ]
295then
296 if [ "$update_snapshot" = true ]
297 then
liamfallond7d9a662022-03-01 21:01:03 +0000298 echo "updating policy common reference to $common_latest_snapshot_tag on $repo_location/$target_repo . . ."
liamfallonb76315a2022-01-12 13:24:54 +0000299 $SED -i \
liamfallon81c2c512021-12-16 12:56:37 +0000300 -e "s/<policy.common.version>.*<\/policy.common.version>/<policy.common.version>$common_latest_snapshot_tag<\/policy.common.version>/" \
301 -e "s/<version.policy.common>.*<\/version.policy.common>/<version.policy.common>$common_latest_snapshot_tag<\/version.policy.common>/" \
liamfallond7d9a662022-03-01 21:01:03 +0000302 "$repo_location/$target_repo/pom.xml"
liamfallon81c2c512021-12-16 12:56:37 +0000303 result_code=$?
304 else
liamfallond7d9a662022-03-01 21:01:03 +0000305 echo "updating policy common reference to $common_latest_released_tag on $repo_location/$target_repo . . ."
liamfallonb76315a2022-01-12 13:24:54 +0000306 $SED -i \
liamfallon81c2c512021-12-16 12:56:37 +0000307 -e "s/<policy.common.version>.*<\/policy.common.version>/<policy.common.version>$common_latest_released_tag<\/policy.common.version>/" \
308 -e "s/<version.policy.common>.*<\/version.policy.common>/<version.policy.common>$common_latest_released_tag<\/version.policy.common>/" \
liamfallond7d9a662022-03-01 21:01:03 +0000309 "$repo_location/$target_repo/pom.xml"
liamfallon81c2c512021-12-16 12:56:37 +0000310 result_code=$?
311 fi
312 if [[ "$result_code" -eq 0 ]]
313 then
liamfallond7d9a662022-03-01 21:01:03 +0000314 echo "policy common reference updated on $repo_location/$target_repo"
liamfallon81c2c512021-12-16 12:56:37 +0000315 else
liamfallond7d9a662022-03-01 21:01:03 +0000316 echo "policy common reference update failed on $repo_location/$target_repo"
liamfallon81c2c512021-12-16 12:56:37 +0000317 exit 1
318 fi
319fi
320
321if [ "$update_models" = true ]
322then
323 if [ "$update_snapshot" = true ]
324 then
liamfallond7d9a662022-03-01 21:01:03 +0000325 echo "updating policy models reference to $models_latest_snapshot_tag on $repo_location/$target_repo . . ."
liamfallonb76315a2022-01-12 13:24:54 +0000326 $SED -i \
liamfallon81c2c512021-12-16 12:56:37 +0000327 -e "s/<policy.models.version>.*<\/policy.models.version>/<policy.models.version>$models_latest_snapshot_tag<\/policy.models.version>/" \
328 -e "s/<version.policy.models>.*<\/version.policy.models>/<version.policy.models>$models_latest_snapshot_tag<\/version.policy.models>/" \
liamfallond7d9a662022-03-01 21:01:03 +0000329 "$repo_location/$target_repo/pom.xml"
liamfallon81c2c512021-12-16 12:56:37 +0000330 result_code=$?
331 else
liamfallond7d9a662022-03-01 21:01:03 +0000332 echo "updating policy models reference to $models_latest_released_tag on $repo_location/$target_repo . . ."
liamfallonb76315a2022-01-12 13:24:54 +0000333 $SED -i \
liamfallon81c2c512021-12-16 12:56:37 +0000334 -e "s/<policy.models.version>.*<\/policy.models.version>/<policy.models.version>$models_latest_released_tag<\/policy.models.version>/" \
335 -e "s/<version.policy.models>.*<\/version.policy.models>/<version.policy.models>$models_latest_released_tag<\/version.policy.models>/" \
liamfallond7d9a662022-03-01 21:01:03 +0000336 "$repo_location/$target_repo/pom.xml"
liamfallon81c2c512021-12-16 12:56:37 +0000337 result_code=$?
338 fi
339 if [[ "$result_code" -eq 0 ]]
340 then
liamfallond7d9a662022-03-01 21:01:03 +0000341 echo "policy models reference updated on $repo_location/$target_repo"
liamfallon81c2c512021-12-16 12:56:37 +0000342 else
liamfallond7d9a662022-03-01 21:01:03 +0000343 echo "policy models reference update failed on $repo_location/$target_repo"
liamfallon81c2c512021-12-16 12:56:37 +0000344 exit 1
345 fi
346fi
347
348if [ "$update_drools_pdp" = true ]
349then
350 if [ "$update_snapshot" = true ]
351 then
liamfallond7d9a662022-03-01 21:01:03 +0000352 echo "updating policy drools-pdp reference to $drools_pdp_latest_snapshot_tag on $repo_location/$target_repo . . ."
liamfallonb76315a2022-01-12 13:24:54 +0000353 $SED -i \
liamfallon81c2c512021-12-16 12:56:37 +0000354 -e "s/<policy.drools-pdp.version>.*<\/policy.drools-pdp.version>/<policy.drools-pdp.version>$drools_pdp_latest_snapshot_tag<\/policy.drools-pdp.version>/" \
355 -e "s/<version.policy.drools-pdp>.*<\/version.policy.drools-pdp>/<version.policy.drools-pdp>$drools_pdp_latest_snapshot_tag<\/version.policy.drools-pdp>/" \
liamfallond7d9a662022-03-01 21:01:03 +0000356 "$repo_location/$target_repo/pom.xml"
liamfallon81c2c512021-12-16 12:56:37 +0000357 result_code=$?
358 else
liamfallond7d9a662022-03-01 21:01:03 +0000359 echo "updating policy drools-pdp reference to $drools_pdp_latest_released_tag on $repo_location/$target_repo . . ."
liamfallonb76315a2022-01-12 13:24:54 +0000360 $SED -i \
liamfallon81c2c512021-12-16 12:56:37 +0000361 -e "s/<policy.drools-pdp.version>.*<\/policy.drools-pdp.version>/<policy.drools-pdp.version>$drools_pdp_latest_released_tag<\/policy.drools-pdp.version>/" \
362 -e "s/<version.policy.drools-pdp>.*<\/version.policy.drools-pdp>/<version.policy.drools-pdp>$drools_pdp_latest_released_tag<\/version.policy.drools-pdp>/" \
liamfallond7d9a662022-03-01 21:01:03 +0000363 "$repo_location/$target_repo/pom.xml"
liamfallon81c2c512021-12-16 12:56:37 +0000364 result_code=$?
365 fi
366 if [[ "$result_code" -eq 0 ]]
367 then
liamfallond7d9a662022-03-01 21:01:03 +0000368 echo "policy drools-pdp reference updated on $repo_location/$target_repo"
liamfallon81c2c512021-12-16 12:56:37 +0000369 else
liamfallond7d9a662022-03-01 21:01:03 +0000370 echo "policy drools-pdp reference update failed on $repo_location/$target_repo"
liamfallon81c2c512021-12-16 12:56:37 +0000371 exit 1
372 fi
373fi
374
liamfallon4d071bf2022-03-16 14:27:21 +0000375if [ "$update_apex_pdp" = true ]
376then
377 if [ "$update_snapshot" = true ]
378 then
379 echo "updating policy apex-pdp reference to $apex_pdp_latest_snapshot_tag on $repo_location/$target_repo . . ."
380 $SED -i \
381 -e "s/<policy.apex-pdp.version>.*<\/policy.apex-pdp.version>/<policy.apex-pdp.version>$apex_pdp_latest_snapshot_tag<\/policy.apex-pdp.version>/" \
382 -e "s/<version.policy.apex-pdp>.*<\/version.policy.apex-pdp>/<version.policy.apex-pdp>$apex_pdp_latest_snapshot_tag<\/version.policy.apex-pdp>/" \
383 "$repo_location/$target_repo/pom.xml"
384 result_code=$?
385 else
386 echo "updating policy apex-pdp reference to $apex_pdp_latest_released_tag on $repo_location/$target_repo . . ."
387 $SED -i \
388 -e "s/<policy.apex-pdp.version>.*<\/policy.apex-pdp.version>/<policy.apex-pdp.version>$apex_pdp_latest_released_tag<\/policy.apex-pdp.version>/" \
389 -e "s/<version.policy.apex-pdp>.*<\/version.policy.apex-pdp>/<version.policy.apex-pdp>$apex_pdp_latest_released_tag<\/version.policy.apex-pdp>/" \
390 "$repo_location/$target_repo/pom.xml"
391 result_code=$?
392 fi
393 if [[ "$result_code" -eq 0 ]]
394 then
395 echo "policy apex-pdp reference updated on $repo_location/$target_repo"
396 else
397 echo "policy apex-pdp reference update failed on $repo_location/$target_repo"
398 exit 1
399 fi
400fi
401
liamfallon81c2c512021-12-16 12:56:37 +0000402if [ "$update_docker" = true ] && [ "$target_docker_images" != "" ]
403then
liamfallon2da18f62022-07-29 13:35:49 +0100404 if [ "$update_snapshot" == true ]
405 then
liamfallon6214bfb2022-09-08 16:58:30 +0100406 echo "updating docker base images to version $docker_latest_snapshot_tag on repo $repo_location/$target_repo . . ."
liamfallon2da18f62022-07-29 13:35:49 +0100407 find "$repo_location/$target_repo" \
408 -name '*Docker*' \
liamfallon6214bfb2022-09-08 16:58:30 +0100409 -exec $SED -r -i "s/^(FROM onap\/policy-j[d|r][k|e]-alpine:)[0-9]*.[0-9]*.[0-9].*$/\1$docker_latest_snapshot_tag/" {} \;
liamfallon2da18f62022-07-29 13:35:49 +0100410 result_code=$?
411 else
liamfallon6214bfb2022-09-08 16:58:30 +0100412 echo "updating docker base images to version $docker_latest_released_tag on repo $repo_location/$target_repo . . ."
liamfallon2da18f62022-07-29 13:35:49 +0100413 find "$repo_location/$target_repo" \
414 -name '*Docker*' \
liamfallon6214bfb2022-09-08 16:58:30 +0100415 -exec $SED -r -i "s/^(FROM onap\/policy-j[d|r][k|e]-alpine:)[0-9]*.[0-9]*.[0-9].*$/\1$docker_latest_released_tag/" {} \;
liamfallon2da18f62022-07-29 13:35:49 +0100416 result_code=$?
417 fi
418
liamfallon81c2c512021-12-16 12:56:37 +0000419 if [[ "$result_code" -eq 0 ]]
420 then
liamfallond7d9a662022-03-01 21:01:03 +0000421 echo "docker base images updated on $repo_location/$target_repo"
liamfallon81c2c512021-12-16 12:56:37 +0000422 else
liamfallond7d9a662022-03-01 21:01:03 +0000423 echo "docker base images update failed on $repo_location/$target_repo"
liamfallon81c2c512021-12-16 12:56:37 +0000424 exit 1
425 fi
426fi
liamfallon55556532022-07-13 11:40:56 +0100427
428if [ "$update_file" = true ]
429then
430 if [ ! "$target_repo" = "policy/parent" ]
431 then
432 echo "update of data file can only be done on the policy/parent repo"
433 exit 1
434 fi
435
436 echo "updating release data at $repo_location/$target_repo/integration/src/main/resources/release . . ."
437 cp "$release_data_file" "$repo_location/$target_repo"/integration/src/main/resources/release
438 echo "updated release data at $repo_location/$target_repo/integration/src/main/resources/release"
439fi