43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
stages:
|
|
- mirror
|
|
- build
|
|
- publish
|
|
|
|
|
|
|
|
mirror-psi:
|
|
stage: mirror
|
|
tags:
|
|
- docker-shared
|
|
script:
|
|
- SOURCE_REPOSITORY=https://$PSI_PROJECT_GIT_USRNAME:$PSI_PROJECT_GIT_TOKEN@gitlab.psi.ch/jungfraujoch/nextgendcu.git
|
|
- DESTINATION_REPOSITORY=https://$MIV_PROJECT_GIT_USRNAME:$MIV_PROJECT_GIT_TOKEN@gitlab.maxiv.lu.se/jungfraujoch/nextgendcu.git
|
|
- GIT_USER_NAME=git
|
|
- GIT_USER_EMAIL=git@maxiv.lu.se
|
|
- rm -rf _mirror_repo_tmp
|
|
- git clone --mirror $SOURCE_REPOSITORY _mirror_repo_tmp
|
|
- cd _mirror_repo_tmp
|
|
- git config --local user.name "${GIT_USER_NAME}"
|
|
- git config --local user.email "${GIT_USER_EMAIL}"
|
|
- git remote remove origin
|
|
- git remote add origin $DESTINATION_REPOSITORY
|
|
- git push --prune --all
|
|
- git push --prune --tags
|
|
after_script:
|
|
- rm -rf _mirror_repo_tmp
|
|
rules:
|
|
- if: '$CI_PIPELINE_SOURCE != "schedule" && $CI_PIPELINE_SOURCE != "trigger"'
|
|
when: never
|
|
- if: '$MODE != "sync"'
|
|
when: never
|
|
- when: always
|
|
|
|
|
|
include:
|
|
- project: 'kits-maxiv/cfg-maxiv-gitlabci'
|
|
file: '/Docker.gitlab-ci.yml'
|
|
|
|
variables:
|
|
DOCKER_REGISTRY: "harbor.maxiv.lu.se/daq"
|
|
GIT_SUBMODULE_STRATEGY: recursive
|