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