blob: 91676b0ba0dfc303c95186f17a1b7b9b07c99c63 [file] [log] [blame]
Zack Williams7468c362018-04-06 09:52:30 -07001---
2# CORD documentation verification and publish tasks
3
4- project:
5 name: verify-docs
6
Zack Williams7468c362018-04-06 09:52:30 -07007 jobs:
8 - 'verify-documentation':
Zack Williamsab85b982020-01-08 11:49:37 -07009 other-docs-repos-regexp: '{cord-guide-projects-regexp}'
Zack Williamsbf4cfe52018-05-14 16:29:57 -070010 branch-regexp: '{modern-branches-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -070011
12- project:
13 name: publish-docs
14
15 jobs:
16 - 'publish-documentation':
Zack Williamsab85b982020-01-08 11:49:37 -070017 other-docs-repos-regexp: '{cord-guide-projects-regexp}'
Kailash Khalasica590552018-05-24 15:09:42 -070018 branch-regexp: '{modern-branches-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -070019
Zack Williams5364d1f2018-12-19 16:00:03 -070020- project:
21 name: publish-xos-docs
22
23 jobs:
24 - 'publish-xos-documentation':
25 branch-regexp: '{modern-branches-regexp}'
26
Zack Williamsbf4cfe52018-05-14 16:29:57 -070027- job-template:
Zack Williamsc27ca2d2018-04-11 13:16:45 -070028 id: verify-documentation
Zack Williams7468c362018-04-06 09:52:30 -070029 name: "verify-documentation"
30
31 triggers:
Zack Williams0e594a32018-05-15 19:30:38 -070032 - gerrit:
33 server-name: '{gerrit-server-name}'
Zack Williamsa1d1fc62018-05-15 10:51:31 -070034 dependency-jobs: '{dependency-jobs}'
Zack Williams0e594a32018-05-15 19:30:38 -070035 silent-start: true
36 trigger-on:
37 - patchset-created-event:
38 exclude-drafts: true
39 exclude-trivial-rebase: false
40 exclude-no-code-change: true
41 - draft-published-event
42 - comment-added-contains-event:
43 comment-contains-value: '(?i)^.*recheck$'
44 projects:
45 - project-compare-type: PLAIN
46 project-pattern: 'docs'
47 branches:
48 - branch-compare-type: REG_EXP
49 branch-pattern: '{branch-regexp}'
50 file-paths:
51 - compare-type: REG_EXP
52 pattern: '{all-files-regexp}'
53 - project-compare-type: REG_EXP
54 project-pattern: '{other-docs-repos-regexp}'
55 branches:
56 - branch-compare-type: REG_EXP
57 branch-pattern: '{branch-regexp}'
58 file-paths:
59 - compare-type: REG_EXP
60 pattern: '{doc-files-regexp}'
Kailash Khalasi21dc6192018-05-31 08:44:13 -070061 - compare-type: REG_EXP
62 pattern: '.*\.md'
Zack Williams7468c362018-04-06 09:52:30 -070063
64 properties:
65 - cord-infra-properties:
66 build-days-to-keep: '{build-days-to-keep}'
67 artifact-num-to-keep: '{artifact-num-to-keep}'
68
69 wrappers:
70 - lf-infra-wrappers:
Zack Williamse779dc02018-12-13 09:31:49 -070071 build-timeout: '20'
Zack Williams7468c362018-04-06 09:52:30 -070072 jenkins-ssh-credential: '{jenkins-ssh-credential}'
73
74 scm:
75 - cord-infra-gerrit-repo-scm:
Zack Williamsc27ca2d2018-04-11 13:16:45 -070076 manifest-url: '{gerrit-server-url}/{cord-repo-manifest}'
Zack Williams7468c362018-04-06 09:52:30 -070077 branch: '$GERRIT_BRANCH'
78 destination-dir: 'cord'
79
Zack Williamse779dc02018-12-13 09:31:49 -070080 node: 'ubuntu16.04-basebuild-1c-2g'
Zack Williams7468c362018-04-06 09:52:30 -070081 project-type: freestyle
82 concurrent: false
83
84 builders:
85 - cord-infra-gerrit-repo-patch:
Zack Williamsc27ca2d2018-04-11 13:16:45 -070086 destination-dir: 'cord'
Zack Williams7468c362018-04-06 09:52:30 -070087 project: '$GERRIT_PROJECT'
88 change-number: '$GERRIT_CHANGE_NUMBER'
89 patchset-number: '$GERRIT_PATCHSET_NUMBER'
90 - shell: |
Zack Williams2d7b3502018-07-03 16:52:39 -070091 #!/usr/bin/env bash
92
93 # checkout is under cord
94 cd cord
95
96 # make repos checkout directory
97 mkdir -p docs/repos
98
99 # Find path to the repo, copy into docs
100 PROJECT_PATH=$(xmllint --xpath "string(//project[@name=\"$GERRIT_PROJECT\"]/@path)" .repo/manifest.xml)
Zack Williamsdd15e122019-07-16 16:31:39 -0700101 cp -r "$PROJECT_PATH" "docs/repos/$GERRIT_PROJECT"
Zack Williams2d7b3502018-07-03 16:52:39 -0700102
Zack Williamsa0d36e32018-12-19 07:43:09 -0700103 # build docs, don't touch checkout under test, capture test result
Zack Williams2d7b3502018-07-03 16:52:39 -0700104 cd docs
105 SKIP_CHECKOUT="$GERRIT_PROJECT" make test
Zack Williamsa0d36e32018-12-19 07:43:09 -0700106 test_result=$?
107
108 # cleanup
109 make clean
110
111 exit $test_result
Zack Williams2d7b3502018-07-03 16:52:39 -0700112
Kailashe09f33d2019-02-20 10:58:25 -0800113 publishers:
114 - email:
115 recipients: 'teo@opennetworking.org,smbaker@opennetworking.org,andy@opennetworking.org,zdw@opennetworking.org'
Zack Williams7468c362018-04-06 09:52:30 -0700116
Zack Williams7468c362018-04-06 09:52:30 -0700117- job-template:
Kailash Khalasica590552018-05-24 15:09:42 -0700118 id: publish-documentation
119 name: 'publish-documentation'
120
121 triggers:
Zack Williams9a021d72018-05-25 16:59:25 -0700122 - gerrit:
123 server-name: '{gerrit-server-name}'
Kailash Khalasica590552018-05-24 15:09:42 -0700124 dependency-jobs: '{dependency-jobs}'
Zack Williams9a021d72018-05-25 16:59:25 -0700125 silent-start: true
126 trigger-on:
127 - change-merged-event
128 projects:
129 - project-compare-type: PLAIN
130 project-pattern: 'docs'
131 branches:
132 - branch-compare-type: REG_EXP
133 branch-pattern: '{branch-regexp}'
134 file-paths:
135 - compare-type: REG_EXP
136 pattern: '{all-files-regexp}'
137 - project-compare-type: REG_EXP
138 project-pattern: '{other-docs-repos-regexp}'
139 branches:
140 - branch-compare-type: REG_EXP
141 branch-pattern: '{branch-regexp}'
142 file-paths:
143 - compare-type: REG_EXP
144 pattern: '{doc-files-regexp}'
Zack Williams642e5f72018-06-05 13:24:13 -0700145 - compare-type: REG_EXP
146 pattern: '.*\.md'
Kailash Khalasica590552018-05-24 15:09:42 -0700147
148 properties:
149 - cord-infra-properties:
150 build-days-to-keep: '{build-days-to-keep}'
151 artifact-num-to-keep: '{artifact-num-to-keep}'
152
153 wrappers:
154 - lf-infra-wrappers:
Zack Williamse779dc02018-12-13 09:31:49 -0700155 build-timeout: '20'
Kailash Khalasica590552018-05-24 15:09:42 -0700156 jenkins-ssh-credential: '{jenkins-ssh-credential}'
157
158 scm:
159 - cord-infra-gerrit-repo-scm:
160 manifest-url: '{gerrit-server-url}/{cord-repo-manifest}'
161 branch: '$GERRIT_BRANCH'
162 destination-dir: 'cord'
163
Zack Williamse779dc02018-12-13 09:31:49 -0700164 node: 'ubuntu16.04-basebuild-1c-2g'
Kailash Khalasica590552018-05-24 15:09:42 -0700165 project-type: freestyle
166 concurrent: false
167
168 builders:
169 - shell: |
Zack Williams642e5f72018-06-05 13:24:13 -0700170 #!/usr/bin/env bash
Zack Williams9d661a42018-10-01 15:43:21 -0700171 set -e -o pipefail
Zack Williams642e5f72018-06-05 13:24:13 -0700172
173 # Set up the ssh host keys for the docs host
174 mkdir -p ~/.ssh
175 echo '{docs-ssh-host-key}' >> ~/.ssh/known_hosts
176
Zack Williams7ac4efa2018-06-29 16:33:08 -0700177 # build gitbook docs
178 cd $WORKSPACE/cord/docs
Zack Williams2d7b3502018-07-03 16:52:39 -0700179
Kailash Khalasica590552018-05-24 15:09:42 -0700180 make build
Zack Williams2cad0322018-06-05 14:01:45 -0700181 rsync -rvzh --delete _book/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH
Zack Williams7ac4efa2018-06-29 16:33:08 -0700182
183 # build swagger docs
184 cd $WORKSPACE/cord/orchestration/xos/docs
185 make swagger_docs
186 rsync -rvzh --delete swagger/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH/swagger
Zack Williams642e5f72018-06-05 13:24:13 -0700187
Kailashe09f33d2019-02-20 10:58:25 -0800188 publishers:
189 - email:
190 recipients: 'teo@opennetworking.org,smbaker@opennetworking.org,andy@opennetworking.org,zdw@opennetworking.org'
Zack Williams5364d1f2018-12-19 16:00:03 -0700191
192- job-template:
193 id: publish-xos-documentation
194 name: 'publish-xos-documentation'
195
196 triggers:
197 - gerrit:
198 server-name: '{gerrit-server-name}'
199 dependency-jobs: '{dependency-jobs}'
200 silent-start: true
201 trigger-on:
202 - change-merged-event
203 projects:
204 - project-compare-type: PLAIN
205 project-pattern: 'xos'
206 branches:
207 - branch-compare-type: REG_EXP
208 branch-pattern: '{branch-regexp}'
209 file-paths:
210 - compare-type: REG_EXP
211 pattern: '{doc-files-regexp}'
212 - compare-type: REG_EXP
213 pattern: '.*\.md'
214
215 properties:
216 - cord-infra-properties:
217 build-days-to-keep: '{build-days-to-keep}'
218 artifact-num-to-keep: '{artifact-num-to-keep}'
219
220 wrappers:
221 - lf-infra-wrappers:
222 build-timeout: '20'
223 jenkins-ssh-credential: '{jenkins-ssh-credential}'
224
225 scm:
226 - cord-infra-gerrit-repo-scm:
227 manifest-url: '{gerrit-server-url}/xos-manifest.git'
228 branch: '$GERRIT_BRANCH'
229 destination-dir: 'cord'
230
231 node: 'ubuntu16.04-basebuild-1c-2g'
232 project-type: freestyle
233 concurrent: false
234
235 builders:
236 - shell: |
237 #!/usr/bin/env bash
238 set -e -o pipefail
239
240 # Set up the ssh host keys for the docs host
241 mkdir -p ~/.ssh
242 echo '{docs-ssh-host-key}' >> ~/.ssh/known_hosts
243
244 # build gitbook docs
245 cd $WORKSPACE/cord/xos-core/docs
246
247 make build
248 rsync -rvzh --delete _book/ guide.opencord.org:/var/www/xos-guide
249
Kailashe09f33d2019-02-20 10:58:25 -0800250 publishers:
251 - email:
252 recipients: 'teo@opennetworking.org,smbaker@opennetworking.org,andy@opennetworking.org,zdw@opennetworking.org'