From 8a40cce8fbddfc2504f61e1f378c5a8a780272dd Mon Sep 17 00:00:00 2001 From: stianst Date: Thu, 21 Feb 2019 09:09:08 +0100 Subject: [PATCH] Update sync script --- sync.sh | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/sync.sh b/sync.sh index 069b9a0c79..f236ea34ef 100755 --- a/sync.sh +++ b/sync.sh @@ -1,8 +1,29 @@ #!/bin/bash +BRANCHES="upstream/master prod/3.4.x prod/4.8.x" + +echo "-----------------------------------------------------------------" + +echo "Fetching remotes" +echo "" + git fetch upstream git fetch gitlab git fetch prod -git push gitlab upstream/master:master -git push gitlab prod/rhsso-7.2.x:rhsso-7.2.x +echo "-----------------------------------------------------------------" + +for i in $BRANCHES; do + TARGET_BRANCH=`echo $i | cut -d '/' -f 2` + + echo "Syncing $i to gitlab/$TARGET_BRANCH" + echo "" + + git branch | grep " tmp-$TARGET_BRANCH$" &>/dev/null && git branch -D tmp-$TARGET_BRANCH + git checkout $i -b tmp-$TARGET_BRANCH + git push gitlab tmp-$TARGET_BRANCH:$TARGET_BRANCH + git checkout master + git branch -D tmp-$TARGET_BRANCH + + echo "-----------------------------------------------------------------" +done