Update .gitlab-ci.yml

This commit is contained in:
Christoph Haas 2018-03-10 11:37:03 +01:00
parent 5801005870
commit 5da24f053a

View File

@ -5,44 +5,15 @@ stages:
variables: variables:
MIRROR_REPOSITORY: "git@github.com:h44z/atestproject.git" MIRROR_REPOSITORY: "git@github.com:h44z/atestproject.git"
MIRROR_BRANCH: "master"
mirror-github: mirror-github:
stage: mirror stage: mirror
cache: {} cache: {}
script: script:
# run ssh-agent
#- eval $(ssh-agent -s)
# add appropriate private key to the agent store
#- ssh-add <(echo "$MIRROR_KEY")
# set known hosts list
# WARNING: use only in docker container, if you use it with shell you will
# overwrite your user's ssh config
#- mkdir -p ~/.ssh
#- cp deploy/known_hosts ~/.ssh/known_hosts
# Do a mirror clone of the repository # Do a mirror clone of the repository
- git clone --mirror $CI_REPOSITORY_URL - git clone --mirror $CI_REPOSITORY_URL
# Mirror push it to the destination # Mirror push it to the destination
- cd $CI_PROJECT_NAME.git - cd $CI_PROJECT_NAME.git
- git push --mirror $MIRROR_REPOSITORY - git push --mirror $MIRROR_REPOSITORY
# Cleanup # Cleanup
- cd ..; rm -rf $CI_PROJECT_NAME.git - cd ..; rm -rf $CI_PROJECT_NAME.git
#mirror-master:
# stage: deploy
# only:
# - master
# script:
# - git remote add --mirror=push github $UPSTREAM_REPOSITORY || true
# - git push --quiet github
# - git fetch upstream
# - git push --progress upstream HEAD:$UPSTREAM_BRANCH
#mirror-tags:
# stage: deploy
# only:
# - tags
# script:
# - git remote add upstream $UPSTREAM_REPOSITORY || true
# - git fetch upstream
# - git push --progress --tags upstream