X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=integration%2Fsrc%2Frelease_scripts%2FgenerateCommit.sh;h=29e600a20d25c68b40eb6e5431147530fe14409b;hb=d7d9a664cb6d45b1019f8ac897feac512e5b37e8;hp=8c21c308bb0ea9678446faf7c4591f31a8772b78;hpb=006a229e166b5656fd9ba320e2b36d33c7e945a8;p=policy%2Fparent.git diff --git a/integration/src/release_scripts/generateCommit.sh b/integration/src/release_scripts/generateCommit.sh index 8c21c308..29e600a2 100755 --- a/integration/src/release_scripts/generateCommit.sh +++ b/integration/src/release_scripts/generateCommit.sh @@ -22,7 +22,7 @@ set -e -SCRIPT_NAME=`basename $0` +SCRIPT_NAME=$(basename "$0") repo_location="./" usage() @@ -47,13 +47,6 @@ usage() exit 255; } -update_parent=false -update_common=false -update_models=false -update_drools_pdp=false -update_snapshot=false -update_docker=false - while getopts "hl:r:i:e:m:" opt do case $opt in @@ -129,7 +122,7 @@ then exit 1 fi -git -C $repo_location/$specified_repo status | grep '^Your branch is up to date' > /dev/null 2>&1 +git -C "$repo_location/$specified_repo" status | grep '^Your branch is up to date' > /dev/null 2>&1 return_code=$? if [ $return_code -eq 0 ] @@ -137,30 +130,32 @@ then echo "generating commit '$commit_header' . . ." commit_msg_temp_file=$(mktemp) - echo "$commit_header" > $commit_msg_temp_file - echo "" >> $commit_msg_temp_file - echo "$commit_message" >> $commit_msg_temp_file - echo "" >> $commit_msg_temp_file - echo "*** This commit is generated by a PF release script ***" >> $commit_msg_temp_file - echo "" >> $commit_msg_temp_file - echo "Issue-ID: $issue_id" >> $commit_msg_temp_file - - git -C $repo_location/$specified_repo add . - git -C $repo_location/$specified_repo commit -s -F "$commit_msg_temp_file" - rm $commit_msg_temp_file + { + echo "$commit_header" + echo "" + echo "$commit_message" + echo "" + echo "*** This commit is generated by a PF release script ***" + echo "" + echo "Issue-ID: $issue_id" + } > "$commit_msg_temp_file" + + git -C "$repo_location/$specified_repo" add . + git -C "$repo_location/$specified_repo" commit -s -F "$commit_msg_temp_file" + rm "$commit_msg_temp_file" echo "commit '$commit_header' generated" else echo "updating commit '$commit_header' . . ." - git -C $repo_location/$specified_repo add . - git -C $repo_location/$specified_repo commit -as --amend --no-edit + git -C "$repo_location/$specified_repo" add . + git -C "$repo_location/$specified_repo" commit -as --amend --no-edit echo "commit '$commit_header' updated" fi echo "sending commit '$commit_header' to gerrit . . ." -git -C $repo_location/$specified_repo review +git -C "$repo_location/$specified_repo" review echo "commit '$commit_header' sent to gerrit . . ."