Browse Source

Moved to extra script to sync github repo.

Martin Edenhofer 8 years ago
parent
commit
733ca5e005
2 changed files with 17 additions and 6 deletions
  1. 1 6
      .gitlab-ci.yml
  2. 16 0
      script/build/sync_repo.sh

+ 1 - 6
.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

+ 16 - 0
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