Create jjb for datafile rebase jobs
This change converts existing datafile-rebase job [1] to jjb.
The actual rebase job is put in global templates which can be
used by any other ONAP project we have in same way as datafile
uses it.
[1] https://jenkins.nordix.org/view/ONAP/job/dcaegen2-collectors-datafile-rebase-master/
Change-Id: I9784500b9ff22d2ef8d8d63bcc7b90a900401fcf
Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
diff --git a/jjb/global/rebase-jobs.sh b/jjb/global/rebase-jobs.sh
new file mode 100755
index 0000000..b451f5f
--- /dev/null
+++ b/jjb/global/rebase-jobs.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+set -o errexit
+set -o nounset
+set -o pipefail
+
+cd $WORKSPACE
+git checkout $UPSTREAM_BRANCH -q
+git pull -q
+echo "Commit is"
+echo "-------------------------------------------"
+git show -s
+echo "-------------------------------------------"
+echo "Adding new remote for sync"
+git remote add nordix $NORDIX_REMOTE
+echo "-------------------------------------------"
+git remote -v
+echo "-------------------------------------------"
+echo "Pushing changes to Nordix BRANCH"
+git push nordix $BRANCH