29
.gitlab-ci.yml
Normal file
29
.gitlab-ci.yml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
stages:
|
||||||
|
- sync
|
||||||
|
|
||||||
|
|
||||||
|
.git_push_mirror:
|
||||||
|
image: alpine:latest
|
||||||
|
stage: sync
|
||||||
|
before_script:
|
||||||
|
- apk update
|
||||||
|
- apk add git
|
||||||
|
script:
|
||||||
|
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/$CI_PROJECT_PATH --mirror $CI_PROJECT_NAME
|
||||||
|
- cd $CI_PROJECT_NAME
|
||||||
|
- git remote add destination $GIT_SYNC_URL
|
||||||
|
- echo "https://gitlab.com/ $CI_PROJECT_PATH / $CI_PROJECT_NAME .git"
|
||||||
|
- git push destination --mirror
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 day
|
||||||
|
rules:
|
||||||
|
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||||
|
- if: '$CI_COMMIT_BRANCH == "development"'
|
||||||
|
when: always
|
||||||
|
|
||||||
|
|
||||||
|
Github (Push --mirror):
|
||||||
|
variables:
|
||||||
|
GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/execution_environment.git"
|
||||||
|
extends:
|
||||||
|
- .git_push_mirror
|
Reference in New Issue
Block a user