-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
77 lines (72 loc) · 1.66 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
77 lines (72 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
variables:
WORK: "/tmp"
LMOD_REDIRECT: "yes"
MODULES_DIR: "/util/opt/modulefiles"
stages:
- test
- deploy
- sync-to-github
test-modules:
stage: test
image: unlhcc/crane-build-el6
except:
- master
tags:
- docker
before_script:
- ln -s $CI_PROJECT_DIR $MODULES_DIR
- source /util/opt/lmod/lmod/init/profile
script:
- module av > /dev/null
- module spider > /dev/null
test-paths:
stage: test
image: unlhcc/crane-build-el6
except:
- master
tags:
- crane-test
script:
- scripts/test_changed_modules.sh
deploy:
stage: deploy
environment:
name: crane_production
url: https://crane.unl.edu
image: unlhcc/crane-build-el6
only:
- master
tags:
- crane
before_script:
- eval $(ssh-agent -s) > /dev/null
- mkdir -p ~/.ssh
- chown 700 ~/.ssh
- echo $SSH_KNOWN_HOSTS > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode)
script:
- cd $MODULES_DIR
- git checkout master
- git fetch
- git checkout $CI_COMMIT_SHA
sync-to-github:
stage: sync-to-github
image: unlhcc/crane-build-el6
tags:
- docker
allow_failure: yes
only:
- master
script:
- eval $(ssh-agent -s) > /dev/null
- mkdir -p ~/.ssh
- chown 700 ~/.ssh
- echo $GITHUB_SSH_KNOWN_HOSTS > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- ssh-add <(echo "$GITHUB_SSH_DEPLOY_PKEY" | base64 --decode)
- git config user.name "HCC Gitlab CI"
- git config user.email "hcc-support@unl.edu"
- git checkout master
- git remote add github git@github.com:unlhcc/crane-modules.git
- git push github +master