summaryrefslogtreecommitdiffstats
path: root/integration/src/release_scripts/bumpSnapshots.sh
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2022-01-19 15:31:03 +0000
committerGerrit Code Review <gerrit@onap.org>2022-01-19 15:31:03 +0000
commit956c8d8c3ba66a4b2d585c59759fdbaf9199a77e (patch)
treef14dca0b3999fcdbdcb26837fa71dfecf535cc9b /integration/src/release_scripts/bumpSnapshots.sh
parent004586ddd68eb414ee5fed9fa24ba56d7226fb21 (diff)
parentb76315a09b466166a6eec6f0b22f58d3e432c7b9 (diff)
Merge "Add release script, fix sed for MacOS"
Diffstat (limited to 'integration/src/release_scripts/bumpSnapshots.sh')
-rwxr-xr-xintegration/src/release_scripts/bumpSnapshots.sh27
1 files changed, 20 insertions, 7 deletions
diff --git a/integration/src/release_scripts/bumpSnapshots.sh b/integration/src/release_scripts/bumpSnapshots.sh
index f8317e2a..ced6453c 100755
--- a/integration/src/release_scripts/bumpSnapshots.sh
+++ b/integration/src/release_scripts/bumpSnapshots.sh
@@ -26,6 +26,14 @@ SCRIPT_NAME=`basename $0`
repo_location="./"
release_data_file="./pf_release_data.csv"
+# Use the bash internal OSTYPE variable to check for MacOS
+if [[ "$OSTYPE" == "darwin"* ]]
+then
+ SED="gsed"
+else
+ SED="sed"
+fi
+
declare -a pf_repos=(
"policy/parent"
"policy/docker"
@@ -146,9 +154,9 @@ do
if [ "$latest_released_tag" = "$next_release_version" ]
then
- declare -i major_version=`echo $next_release_version | sed -E 's/^([0-9]*)\.[0-9]*\.[0-9]*$/\1/'`
- declare -i minor_version=`echo $next_release_version | sed -E 's/^[0-9]*\.([0-9]*)\.[0-9]*$/\1/'`
- declare -i patch_version=`echo $next_release_version | sed -E 's/^[0-9]*\.[0-9]*\.([0-9]*)$/\1/'`
+ declare -i major_version=`echo $next_release_version | $SED -E 's/^([0-9]*)\.[0-9]*\.[0-9]*$/\1/'`
+ declare -i minor_version=`echo $next_release_version | $SED -E 's/^[0-9]*\.([0-9]*)\.[0-9]*$/\1/'`
+ declare -i patch_version=`echo $next_release_version | $SED -E 's/^[0-9]*\.[0-9]*\.([0-9]*)$/\1/'`
declare -i new_patch_version=$(($patch_version+1))
new_snapshot_tag="$major_version"."$minor_version"."$new_patch_version"-SNAPSHOT
@@ -161,15 +169,20 @@ do
temp_file=$(mktemp)
echo updating snapshot version of repo $repo in $repo_location/$repo/version.properties
- sed -e "s/patch=$patch_version/patch=$new_patch_version/" $repo_location/$repo/version.properties > $temp_file
+ $SED -e "s/patch=$patch_version/patch=$new_patch_version/" $repo_location/$repo/version.properties > $temp_file
mv $temp_file $repo_location/$repo/version.properties
fi
updateRefs.sh -pcmos -d $release_data_file -l $repo_location -r $repo
- git -C $repo_location/$specified_repo status | grep '^[ \t]*modified:[ \t]*pom.xml' > /dev/null 2>&1
- references_updated=$?
- if [ "$latest_released_tag" != "$next_release_version" ] && [ $references_updated -eq 0 ]
+ if [ "$(git -C $repo_location/$specified_repo status | grep '^[ \t]*modified:[ \t]*pom.xml' > /dev/null 2>&1)" = 0 ]
+ then
+ references_updated=0
+ else
+ references_updated=1
+ fi
+
+ if [ "$latest_released_tag" != "$next_release_version" ] && [ $references_updated -ne 0 ]
then
continue
fi
#n259'>259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373