Moved to extra script to sync github repo.
This commit is contained in:
parent
9cbd5de78c
commit
733ca5e005
2 changed files with 17 additions and 6 deletions
|
@ -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
|
||||
|
|
16
script/build/sync_repo.sh
Executable file
16
script/build/sync_repo.sh
Executable file
|
@ -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
|
Loading…
Reference in a new issue