Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
IPDSnelting
mjtest-tests
Commits
22c9a5a0
Commit
22c9a5a0
authored
Nov 18, 2021
by
uudyh
Browse files
Add CI config for mirror branch
parent
06736cad
Pipeline
#177434
failed with stage
in 9 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
22c9a5a0
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment