Skip to content
Snippets Groups Projects
Commit 1fe751b5 authored by Vincent Texier's avatar Vincent Texier
Browse files

[fix] fix .push-to-github bug in .gitlab-ci.yml

parent c737fbec
Branches
Tags
No related merge requests found
...@@ -8,22 +8,24 @@ variables: ...@@ -8,22 +8,24 @@ variables:
image: registry.duniter.org/docker/python3/duniterpy-builder:0.0.7 image: registry.duniter.org/docker/python3/duniterpy-builder:0.0.7
# SUB-TASKS
.push_to_github: .push_to_github:
stage: github-sync
variables:
GIT_STRATEGY: none
tags: tags:
- github - github
script: after_script:
# remove all files in current repo
- rm -rf ./* - rm -rf ./*
- rm -rf .git - rm -rf .git*
# do a mirror clone in current repo
- git clone --mirror $CI_REPOSITORY_URL . - git clone --mirror $CI_REPOSITORY_URL .
# do config for github push
- git remote add github $GITHUB_URL_AND_KEY - git remote add github $GITHUB_URL_AND_KEY
- git config --global user.email "contact@duniter.org" - git config --global user.email "contact@duniter.org"
- git config --global user.name "Duniter" - git config --global user.name "Duniter"
# Job would fail if we don't remove refs about pull requests # remove refs about merge requests
- bash -c "cat packed-refs | grep -v 'refs/pull' > packed-refs-new; echo 'Removed pull refs.'" - bash -c "cat packed-refs | grep -v 'refs/merge-requests' > packed-refs-new; echo 'Removed merge-requests refs.'"
- mv packed-refs-new packed-refs - mv packed-refs-new packed-refs
# github push
- bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?" - bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?"
.env: .env:
...@@ -49,6 +51,7 @@ image: registry.duniter.org/docker/python3/duniterpy-builder:0.0.7 ...@@ -49,6 +51,7 @@ image: registry.duniter.org/docker/python3/duniterpy-builder:0.0.7
- setup.py - setup.py
- tests/**/*.py - tests/**/*.py
# TASKS
build: build:
extends: extends:
- .env - .env
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment