From ab66bb53aa7ee17794339c4423a7410a3c2376d9 Mon Sep 17 00:00:00 2001 From: vtexier <vit@free.fr> Date: Sat, 6 Jul 2019 12:18:43 +0200 Subject: [PATCH] [CI] Fix .push_to_github to remove all files in repo Fix gitlab merge-requests branch removal --- .gitlab-ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93658a0c..2ce93dc0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,17 +14,19 @@ image: registry.duniter.org/docker/python3/duniterpy-builder:0.0.4 tags: - github after_script: - # remove last clone + # remove all files in current repo - rm -rf ./* - - rm -rf .git - # do a mirror clone + - rm -rf .git* + # do a mirror clone in current repo - git clone --mirror $CI_REPOSITORY_URL . + # do config for github push - git remote add github $GITHUB_URL_AND_KEY - git config --global user.email "contact@duniter.org" - git config --global user.name "Duniter" - # Job would fail if we don't remove refs about pull requests - - bash -c "cat packed-refs | grep -v 'refs/pull' > packed-refs-new; echo 'Removed pull refs.'" + # remove refs about merge requests + - bash -c "cat packed-refs | grep -v 'refs/merge-requests' > packed-refs-new; echo 'Removed merge-requests refs.'" - mv packed-refs-new packed-refs + # github push - bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?" .pyenv: -- GitLab