From 733ca5e00500115f87a4e1fe1605f3dfab1e0362 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 21 Aug 2016 21:33:09 +0200 Subject: [PATCH] Moved to extra script to sync github repo. --- .gitlab-ci.yml | 7 +------ script/build/sync_repo.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100755 script/build/sync_repo.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 821c5966f..31dd9a050 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,12 +38,7 @@ pre:github: tags: - deploy script: - - git checkout $CI_BUILD_REF_NAME - - git pull --rebase origin $CI_BUILD_REF_NAME - - git filter-branch --force --index-filter --prune-empty --tag-name-filter cat -- $CI_BUILD_REF_NAME - - if git remote | grep github > /dev/null; then git remote rm github; fi - - git remote add github git@github.com:martini/zammad-test.git - - git push github $CI_BUILD_REF_NAME + - script/build/sync_repo.sh git@github.com:martini/zammad.git test:unit:mysql: stage: test diff --git a/script/build/sync_repo.sh b/script/build/sync_repo.sh new file mode 100755 index 000000000..273458f10 --- /dev/null +++ b/script/build/sync_repo.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -ex + +GITHUB_DEST=$1 + +if echo $CI_BUILD_REF_NAME | grep private; then + echo 'sync no private branches' + exit 0 +fi + +git checkout $CI_BUILD_REF_NAME +git pull --rebase origin $CI_BUILD_REF_NAME +if git remote | grep github > /dev/null; then git remote rm github; fi +git remote add github $GITHUB_DEST +git push github $CI_BUILD_REF_NAME