Skip to content

Commit 1e67da8

Browse files
baltzelltongtongcao
authored andcommitted
sync git repos, github->jlab, in ci (#943)
1 parent 1efb21d commit 1e67da8

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

.gitlab-ci.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ workflow:
55
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
66
auto_cancel:
77
on_new_commit: interruptible
8+
- if: $CI_PIPELINE_SOURCE == "schedule"
89
- if: $CI_COMMIT_BRANCH == "main"
910
auto_cancel:
1011
on_new_commit: conservative
@@ -20,15 +21,35 @@ default:
2021
- export PATH=$CLARA_HOME/plugins/clas12/bin:$PATH
2122
- export PATH=$CLARA_HOME/bin:$PATH
2223
- export PATH=$COATJAVA/bin:$PATH
23-
- echo $PATH
2424

2525
stages:
26+
- mirror
2627
- build
2728
- test
2829
- deploy
2930

31+
mirror:
32+
stage: mirror
33+
rules:
34+
- if: $CI_PIPELINE_SOURCE == "schedule"
35+
script:
36+
- git config --global --add safe.directory $CI_PROJECT_DIR
37+
- git config --global user.email "ci-bot@code.jlab.org"
38+
- git config --global user.name "GitLab CI"
39+
- git checkout development
40+
- git config pull.rebase true
41+
- git remote get-url origin
42+
- git remote set-url origin https://github.com/jeffersonlab/coatjava
43+
- git pull
44+
- git remote set-url origin https://gitlab-ci-token:${CI_JOB_TOKEN}@code.jlab.org/hallb/clas12/coatjava/coatjava.git
45+
# - git remote set-url origin git@code.jlab.org:hallb/clas12/coatjava/coatjava
46+
- git push
47+
3048
build:
3149
stage: build
50+
needs:
51+
- job: mirror
52+
optional: true
3253
script:
3354
- ./build-coatjava.sh --clara -T$JL_RUNNER_AVAIL_CPU --quiet --no-progress
3455
- tar -czf coatjava.tar.gz coatjava

0 commit comments

Comments
 (0)