-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
61 lines (57 loc) · 1.2 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
variables:
DOC_SERVER: doc
DOC_CENTER: /home/xl_ci/doc_center/nuclei_document
DOC_NAME: nuclei_tools
IMAGE: rego.corp.nucleisys.com/software/docbuilder
IMAGE_TAG: latest
default:
tags:
- env::docker
- net::outside
- host::whml1
image: $IMAGE:$IMAGE_TAG
stages:
- build
- deploy
## Job for build document
build_doc:
stage: build
interruptible: true
retry: 1
only:
refs:
- master
- merge_requests
artifacts:
name: "${DOC_NAME}-${CI_COMMIT_SHA::8}"
paths:
- build/html
expire_in: 2 day
before_script:
- pip3 install -U -r requirements.txt
#- npm i wavedrom-cli
script:
- make clean
- make pdf
## Job for deploy document to internal server
deploy_doc:
stage: deploy
interruptible: true
#when: manual
needs:
- job: build_doc
retry: 1
only:
refs:
- master
script:
- ssh $DOC_SERVER "rm -rf $DOC_CENTER/$DOC_NAME/*"
- ssh $DOC_SERVER "mkdir -p $DOC_CENTER/$DOC_NAME/"
- cd build
- scp -r html $DOC_SERVER:$DOC_CENTER/$DOC_NAME
- echo "see generated html here http://doc/nuclei_document/$DOC_NAME/html/index.html"
dependencies:
- build_doc
tags:
- env::native
- host::xls01