Added Gitlab CI script specific for MAX IV

Signed-off-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit is contained in:
2023-12-04 22:03:16 +01:00
parent 905c26ba88
commit e8e90ff623
+27
View File
@@ -0,0 +1,27 @@
stages:
- mirror
mirror-psi:
stage: mirror
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