blob: e2fadaa8b6b9900e58e4202b6cd7f368f54a951a [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 Williams9a021d72018-05-25 16:59:25 -07009 other-docs-repos-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 Williams9a021d72018-05-25 16:59:25 -070017 other-docs-repos-regexp: '.*'
Kailash Khalasica590552018-05-24 15:09:42 -070018 branch-regexp: '{modern-branches-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -070019
Zack Williamsbf4cfe52018-05-14 16:29:57 -070020- job-template:
Zack Williamsc27ca2d2018-04-11 13:16:45 -070021 id: verify-documentation
Zack Williams7468c362018-04-06 09:52:30 -070022 name: "verify-documentation"
23
24 triggers:
Zack Williams0e594a32018-05-15 19:30:38 -070025 - gerrit:
26 server-name: '{gerrit-server-name}'
Zack Williamsa1d1fc62018-05-15 10:51:31 -070027 dependency-jobs: '{dependency-jobs}'
Zack Williams0e594a32018-05-15 19:30:38 -070028 silent-start: true
29 trigger-on:
30 - patchset-created-event:
31 exclude-drafts: true
32 exclude-trivial-rebase: false
33 exclude-no-code-change: true
34 - draft-published-event
35 - comment-added-contains-event:
36 comment-contains-value: '(?i)^.*recheck$'
37 projects:
38 - project-compare-type: PLAIN
39 project-pattern: 'docs'
40 branches:
41 - branch-compare-type: REG_EXP
42 branch-pattern: '{branch-regexp}'
43 file-paths:
44 - compare-type: REG_EXP
45 pattern: '{all-files-regexp}'
46 - project-compare-type: REG_EXP
47 project-pattern: '{other-docs-repos-regexp}'
48 branches:
49 - branch-compare-type: REG_EXP
50 branch-pattern: '{branch-regexp}'
51 file-paths:
52 - compare-type: REG_EXP
53 pattern: '{doc-files-regexp}'
Kailash Khalasi21dc6192018-05-31 08:44:13 -070054 - compare-type: REG_EXP
55 pattern: '.*\.md'
Zack Williams7468c362018-04-06 09:52:30 -070056
57 properties:
58 - cord-infra-properties:
59 build-days-to-keep: '{build-days-to-keep}'
60 artifact-num-to-keep: '{artifact-num-to-keep}'
61
62 wrappers:
63 - lf-infra-wrappers:
64 build-timeout: '{build-timeout}'
65 jenkins-ssh-credential: '{jenkins-ssh-credential}'
66
67 scm:
68 - cord-infra-gerrit-repo-scm:
Zack Williamsc27ca2d2018-04-11 13:16:45 -070069 manifest-url: '{gerrit-server-url}/{cord-repo-manifest}'
Zack Williams7468c362018-04-06 09:52:30 -070070 branch: '$GERRIT_BRANCH'
71 destination-dir: 'cord'
72
73 node: '{build-node}'
74 project-type: freestyle
75 concurrent: false
76
77 builders:
78 - cord-infra-gerrit-repo-patch:
Zack Williamsc27ca2d2018-04-11 13:16:45 -070079 destination-dir: 'cord'
Zack Williams7468c362018-04-06 09:52:30 -070080 project: '$GERRIT_PROJECT'
81 change-number: '$GERRIT_CHANGE_NUMBER'
82 patchset-number: '$GERRIT_PATCHSET_NUMBER'
83 - shell: |
Zack Williamsbf4cfe52018-05-14 16:29:57 -070084 cd cord/docs
Zack Williams7468c362018-04-06 09:52:30 -070085 make test
86
Zack Williams7468c362018-04-06 09:52:30 -070087- job-template:
Kailash Khalasica590552018-05-24 15:09:42 -070088 id: publish-documentation
89 name: 'publish-documentation'
90
91 triggers:
Zack Williams9a021d72018-05-25 16:59:25 -070092 - gerrit:
93 server-name: '{gerrit-server-name}'
Kailash Khalasica590552018-05-24 15:09:42 -070094 dependency-jobs: '{dependency-jobs}'
Zack Williams9a021d72018-05-25 16:59:25 -070095 silent-start: true
96 trigger-on:
97 - change-merged-event
98 projects:
99 - project-compare-type: PLAIN
100 project-pattern: 'docs'
101 branches:
102 - branch-compare-type: REG_EXP
103 branch-pattern: '{branch-regexp}'
104 file-paths:
105 - compare-type: REG_EXP
106 pattern: '{all-files-regexp}'
107 - project-compare-type: REG_EXP
108 project-pattern: '{other-docs-repos-regexp}'
109 branches:
110 - branch-compare-type: REG_EXP
111 branch-pattern: '{branch-regexp}'
112 file-paths:
113 - compare-type: REG_EXP
114 pattern: '{doc-files-regexp}'
Zack Williams642e5f72018-06-05 13:24:13 -0700115 - compare-type: REG_EXP
116 pattern: '.*\.md'
Kailash Khalasica590552018-05-24 15:09:42 -0700117
118 properties:
119 - cord-infra-properties:
120 build-days-to-keep: '{build-days-to-keep}'
121 artifact-num-to-keep: '{artifact-num-to-keep}'
122
123 wrappers:
124 - lf-infra-wrappers:
125 build-timeout: '{build-timeout}'
126 jenkins-ssh-credential: '{jenkins-ssh-credential}'
127
128 scm:
129 - cord-infra-gerrit-repo-scm:
130 manifest-url: '{gerrit-server-url}/{cord-repo-manifest}'
131 branch: '$GERRIT_BRANCH'
132 destination-dir: 'cord'
133
134 node: '{build-node}'
135 project-type: freestyle
136 concurrent: false
137
138 builders:
139 - shell: |
Zack Williams642e5f72018-06-05 13:24:13 -0700140 #!/usr/bin/env bash
141
142 # Set up the ssh host keys for the docs host
143 mkdir -p ~/.ssh
144 echo '{docs-ssh-host-key}' >> ~/.ssh/known_hosts
145
Zack Williams7ac4efa2018-06-29 16:33:08 -0700146 # build gitbook docs
147 cd $WORKSPACE/cord/docs
Kailash Khalasica590552018-05-24 15:09:42 -0700148 make build
Zack Williams2cad0322018-06-05 14:01:45 -0700149 rsync -rvzh --delete _book/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH
Zack Williams7ac4efa2018-06-29 16:33:08 -0700150
151 # build swagger docs
152 cd $WORKSPACE/cord/orchestration/xos/docs
153 make swagger_docs
154 rsync -rvzh --delete swagger/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH/swagger
Zack Williams642e5f72018-06-05 13:24:13 -0700155