OPENDEV: Add new projects, update rebase.sh job
[infra/cicd.git] / jjb / opendev / rebase-jobs.sh
index b223f90ddd4d0020834dedcb9cba6118a2bd1cb3..90b84c22cb815e220882960c0aeaa067c05a67be 100755 (executable)
@@ -4,6 +4,11 @@ set -o nounset
 set -o pipefail
 
 cd $WORKSPACE
+# Make sure the Nordix is set from Jenkins Job configuration
+# parameter: NORDIX_REMOTE and not from previous job execution
+if git remote | grep nordix > /dev/null ; then
+    git remote rm nordix
+fi
 # When the GERRIT_BRANCH is not set the rebase job wasn't triggered by merge
 # but it's executed as part of timer. In this case we will make sure that all
 # branches from remote are synced with Nordix Gerrit.
@@ -33,8 +38,3 @@ done
 echo "-- Pushing changes to Nordix Gerrit --"
 git push nordix --all -v
 echo "--------------------------------------------------------------------"
-# Make sure the Nordix is set from Jenkins Job configuration
-# parameter: NORDIX_REMOTE in next job run
-if git remote | grep nordix > /dev/null ; then
-    git remote rm nordix
-fi