Skip to content
Snippets Groups Projects
Commit d3582566 authored by Millicent Billette's avatar Millicent Billette
Browse files

CI: auto mirror

parent a469b547
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,38 @@ build: ...@@ -19,6 +19,38 @@ build:
- main - main
- tags - tags
.mirror_template: &mirror # https://mdleom.com/blog/2020/04/21/gitlab-github-mirror/
allow_failure: true
variables:
GIT_MIRROR_HOST: dum.my
GIT_MIRROR_TARGET: git@dum.my:grp/repos.git
GIT_STRATEGY: clone
stage: build
image: node:alpine
script:
- 'which ssh-agent || (apk update && apk add openssh-client git)'
- eval $(ssh-agent -s)
- echo "$GIT_MIRROR_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $GIT_MIRROR_HOST 2>&1 | grep -vE '^#' > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- git remote add mirrorTarget $GIT_MIRROR_TARGET
- git push mirrorTarget --all
- git push mirrorTarget --tags
mirror-framagit:
<<: *mirror
variables:
GIT_MIRROR_HOST: framagit.org
GIT_MIRROR_TARGET: git@framagit.org:g1/g1lib.js.git
mirror-git.duniter.org:
<<: *mirror
variables:
GIT_MIRROR_HOST: git.duniter.org
GIT_MIRROR_TARGET: git@git.duniter.org:libs/g1lib.js.git
pages: pages:
stage: test stage: test
image: node:latest image: node:latest
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment