Add console output to push-upstream job 27/227/1
authoreconwar <conor.ward@est.tech>
Mon, 7 Jan 2019 14:50:03 +0000 (14:50 +0000)
committereconwar <conor.ward@est.tech>
Mon, 7 Jan 2019 14:50:03 +0000 (14:50 +0000)
Change-Id: I9b57e9e72e99de685d48a3f632e64b13400894a0
Signed-off-by: econwar <conor.ward@est.tech>
jjb/global/push-upstream-jobs.sh

index 7c66bdd023d9a07effd74f0775fe610e1c69c43f..3eedac2cb1329c42697df990e8b0399b09d6ed80 100755 (executable)
@@ -1,4 +1,4 @@
-#! /bin/bash
+#!/bin/bash
 
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2019 The Nordix Foundation. All rights reserved.
 
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2019 The Nordix Foundation. All rights reserved.
 # - Author name in Nordix Gerrit equals LFID i.e. need to run "git config --global user.name <LFID>"
 # - infra public key on build server needs to be added to your users SSH Public Keys in ONAP Gerrit
 #
 # - Author name in Nordix Gerrit equals LFID i.e. need to run "git config --global user.name <LFID>"
 # - infra public key on build server needs to be added to your users SSH Public Keys in ONAP Gerrit
 #
+set -o errexit
+set -o nounset
+set -o pipefail
 
 cd $WORKSPACE
 
 cd $WORKSPACE
-
+echo "Retrieving information from commit to push towards ONAP"
 project=$(git config --local remote.origin.url | awk -F "29418/" '{print $2}')
 message=$(git show -s --pretty=%B | grep -vi 'Signed-off-by')
 username=$(git show -s --pretty=%an)
 project=$(git config --local remote.origin.url | awk -F "29418/" '{print $2}')
 message=$(git show -s --pretty=%B | grep -vi 'Signed-off-by')
 username=$(git show -s --pretty=%an)
@@ -38,9 +41,11 @@ then
     exit 1
 fi
 
     exit 1
 fi
 
+echo "Setting user name and email"
 git config user.email $(git show -s --pretty=%ae)
 git config user.name $username
 
 git config user.email $(git show -s --pretty=%ae)
 git config user.name $username
 
+echo "Checking out branch on master with new changes"
 git reset HEAD~1
 git checkout -b delivery_branch origin/master
 
 git reset HEAD~1
 git checkout -b delivery_branch origin/master
 
@@ -48,9 +53,10 @@ echo '[remote "upstream"]' >> $WORKSPACE/.git/config
 echo "  url = ssh://$username@gerrit.onap.org:29418/$project.git" >> $WORKSPACE/.git/config
 echo "  fetch = +refs/heads/*:refs/remotes/upstream/*" >> $WORKSPACE/.git/config
 
 echo "  url = ssh://$username@gerrit.onap.org:29418/$project.git" >> $WORKSPACE/.git/config
 echo "  fetch = +refs/heads/*:refs/remotes/upstream/*" >> $WORKSPACE/.git/config
 
+echo "Committing changes and pushing upstream"
 git commit -as -m "$message"
 git commit -as -m "$message"
-
 git push upstream HEAD:refs/for/master
 git push upstream HEAD:refs/for/master
+
 retVal=$?
 if [[ $retVal -eq 0 ]]
 then
 retVal=$?
 if [[ $retVal -eq 0 ]]
 then