-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
93 lines (86 loc) · 2.4 KB
/
.gitlab-ci.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
stages:
- checkout
- test
- docs
- deploy
variables:
user_name: fun3d
build_machine: k4
build_directory: /hpnobackup2/fun3d/component-ci
project_repo: git@gitlab.larc.nasa.gov:kejacob1/pbs4py.git
project_name: pbs4py
build_tag: pbs4py-$CI_PIPELINE_ID
project_dir: ${build_directory}/pbs4py-$CI_PIPELINE_ID/${project_name}
checkout_branch:
only:
refs:
- main
- merge_requests
stage: checkout
variables:
branch_name: $CI_COMMIT_REF_NAME
checkout_sha: $CI_COMMIT_SHA
tags:
- gitlab_runner
script:
- echo $PWD
- hostname
- whoami
- "ssh -o LogLevel=error ${user_name}@${build_machine} \"cd ${build_directory} && mkdir -p ${build_tag}
&& cd ${build_tag} && git clone ${project_repo} ${project_name} \" "
- "ssh -o LogLevel=error ${user_name}@${build_machine} \"cd ${project_dir}
&& git checkout ${branch_name} && git checkout ${checkout_sha} \" "
unit_tests:
stage: test
only:
- merge_requests
tags:
- gitlab_runner
script:
- "ssh -o LogLevel=error ${user_name}@${build_machine} \"cd ${project_dir}
&& module load Python_3.7.1 && setenv PYTHONPATH `pwd`:$PYTHONPATH && pytest -vs \" "
test_doc_build:
stage: docs
only:
- merge_requests
tags:
- gitlab_runner
script:
- "ssh -o LogLevel=error ${user_name}@${build_machine} \"cd ${project_dir}
&& module load Python_3.7.1 && setenv PYTHONPATH `pwd`:$PYTHONPATH
&& setenv PATH /u/fun3d/.local/bin:$PATH && cd docs
&& make html SPHINXOPTS='-W --keep-going'
&& cd build && tar zcvf pbs4py_html.tgz html \" "
build_docs:
stage: docs
only:
refs:
- main
tags:
- gitlab_runner
script:
- "ssh -o LogLevel=error ${user_name}@${build_machine} \"cd ${project_dir}
&& module load Python_3.7.1 && setenv PYTHONPATH `pwd`:$PYTHONPATH
&& setenv PATH /u/fun3d/.local/bin:$PATH && cd docs && make html
&& cd build && tar zcvf pbs4py_html.tgz html \" "
after_script:
- "scp -q ${user_name}@${build_machine}:${project_dir}/docs/build/pbs4py_html.tgz . || true"
artifacts:
paths:
- pbs4py_html.tgz
expire_in: 1 week
pages:
stage: deploy
only:
refs:
- main
tags:
- gitlab_runner
script:
- rm -rf public
- tar xzvf pbs4py_html.tgz
- mv html public
artifacts:
paths:
- public
expire_in: 1 week