gitlab-github-mirror/.gitlab-ci.yml

19 lines
496 B
YAML
Raw Normal View History

2018-03-09 17:07:58 +01:00
#before_script:
# - ssh-keyscan -t rsa,dsa,ecdsa github.com > /etc/ssh/ssh_known_hosts
2018-03-10 11:34:52 +01:00
stages:
- mirror
2018-03-09 17:05:19 +01:00
variables:
2018-03-10 12:03:25 +01:00
MIRROR_REPOSITORY: "git@github.com:h44z/gitlab-github-mirror.git"
2018-03-10 11:34:52 +01:00
mirror-github:
stage: mirror
cache: {}
script:
2018-03-10 11:35:47 +01:00
# Do a mirror clone of the repository
2018-03-10 11:34:52 +01:00
- git clone --mirror $CI_REPOSITORY_URL
# Mirror push it to the destination
- cd $CI_PROJECT_NAME.git
- git push --mirror $MIRROR_REPOSITORY
2018-03-10 11:35:47 +01:00
# Cleanup
2018-03-10 11:37:03 +01:00
- cd ..; rm -rf $CI_PROJECT_NAME.git