-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy path.gitlab-ci.yml
107 lines (100 loc) · 2.26 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
variables:
GIT_STRATEGY: clone
stages:
- check raw html
- build pdf
- build html
- deploy
fail_if_contain_raw_html:
stage: check raw html
image: sjtuhpc/texlive-sphinx:focal
tags:
- docker
script:
- ack '.*raw.*html' docs && false || true
build_briefmanual_pdf:
stage: build pdf
image: sjtuhpc/texlive-sphinx:focal
tags:
- docker
before_script:
- mkdir -p .build_cache
script:
- make -C tex main.pdf
artifacts:
paths:
- tex/main.pdf
cache:
key: ${CI_JOB_NAME}
paths:
- .build_cache
build_cover:
stage: build pdf
image: sjtuhpc/texlive-sphinx:focal
tags:
- docker
before_script:
- mkdir -p .build_cache
script:
- make -C tex cover.pdf
artifacts:
paths:
- tex/cover.pdf
cache:
key: ${CI_JOB_NAME}
paths:
- .build_cache
build_latex_pdf:
stage: build pdf
image: sjtuhpc/texlive-sphinx:focal
tags:
- docker
needs:
- job: build_cover
artifacts: true
before_script:
- mkdir -p .build_cache
script:
- make -C docs clean latexpdf
- pdftk A=tex/cover.pdf B=docs/_build/latex/sphinx.pdf cat A1 B2-end output docs/_build/latex/merge.pdf
- gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=docs/_build/latex/pi_small.pdf docs/_build/latex/merge.pdf
- mv docs/_build/latex/pi_small.pdf docs/_build/latex/pi.pdf
artifacts:
paths:
- docs/_build/latex/pi.pdf
cache:
key: ${CI_JOB_NAME}
paths:
- .build_cache
build_html_pages:
stage: build html
image: sjtuhpc/texlive-sphinx:focal
tags:
- docker
needs:
- job: build_latex_pdf
artifacts: true
- job: build_briefmanual_pdf
artifacts: true
before_script:
- mkdir -p .build_cache
script:
- mkdir docs/_static || true
- cp docs/_build/latex/pi.pdf docs/_static/hpcmanual.pdf
- cp tex/main.pdf docs/_static/hpcbriefmanual.pdf
- make -C docs clean html
artifacts:
paths:
- docs/_build/html
cache:
key: ${CI_JOB_NAME}
paths:
- .build_cache
deploy_html_to_hpc:
stage: deploy
tags:
- shell.web.hpc.sjtu.edu.cn
only:
- master
script:
- rsync -avr --progress --delete docs/_build/html/ /var/lib/www/docs.hpc.sjtu.edu.cn/