Commit 22c9a5a0 authored by uudyh's avatar uudyh
Browse files

Add CI config for mirror branch

parent 06736cad
Pipeline #177434 failed with stage
in 9 minutes and 15 seconds
......@@ -69,3 +69,23 @@ gruppen:
- ./flammenwehrfer.sh
tags:
- alive
# mirror master branch to unprotected mirror branch to allow members with Developer role to trigger CI runs
# (copied from https://forum.gitlab.com/t/is-it-possible-to-commit-artifacts-into-the-git/22218/7)
mirror:
stage: run
only:
- master
before_script:
- 'which ssh-agent || ( apt-get update -qy && apt-get install openssh-client -qqy )'
- eval `ssh-agent -s`
- echo "$SSH_PRIVATE_KEY_MIRROR" | tr -d '\r' | ssh-add - > /dev/null # add ssh key
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PUBLIC_KEY_MIRROR" >> ~/.ssh/id_rsa.pub
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- git remote rm origin && git remote add origin git@gitlab.com:$CI_PROJECT_PATH.git
- git fetch origin master
- git push origin refs/remotes/origin/master:refs/heads/mirror
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment