Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 1 | --- |
| 2 | # CORD documentation verification and publish tasks |
| 3 | |
| 4 | - project: |
| 5 | name: verify-docs |
| 6 | |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 7 | jobs: |
| 8 | - 'verify-documentation': |
Zack Williams | ab85b98 | 2020-01-08 11:49:37 -0700 | [diff] [blame] | 9 | other-docs-repos-regexp: '{cord-guide-projects-regexp}' |
Zack Williams | bf4cfe5 | 2018-05-14 16:29:57 -0700 | [diff] [blame] | 10 | branch-regexp: '{modern-branches-regexp}' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 11 | |
| 12 | - project: |
| 13 | name: publish-docs |
| 14 | |
| 15 | jobs: |
| 16 | - 'publish-documentation': |
Zack Williams | ab85b98 | 2020-01-08 11:49:37 -0700 | [diff] [blame] | 17 | other-docs-repos-regexp: '{cord-guide-projects-regexp}' |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 18 | branch-regexp: '{modern-branches-regexp}' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 19 | |
Zack Williams | 5364d1f | 2018-12-19 16:00:03 -0700 | [diff] [blame] | 20 | - project: |
| 21 | name: publish-xos-docs |
| 22 | |
| 23 | jobs: |
| 24 | - 'publish-xos-documentation': |
| 25 | branch-regexp: '{modern-branches-regexp}' |
| 26 | |
Zack Williams | bf4cfe5 | 2018-05-14 16:29:57 -0700 | [diff] [blame] | 27 | - job-template: |
Zack Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 28 | id: verify-documentation |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 29 | name: "verify-documentation" |
| 30 | |
| 31 | triggers: |
Zack Williams | 0e594a3 | 2018-05-15 19:30:38 -0700 | [diff] [blame] | 32 | - gerrit: |
| 33 | server-name: '{gerrit-server-name}' |
Zack Williams | a1d1fc6 | 2018-05-15 10:51:31 -0700 | [diff] [blame] | 34 | dependency-jobs: '{dependency-jobs}' |
Zack Williams | 0e594a3 | 2018-05-15 19:30:38 -0700 | [diff] [blame] | 35 | 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 Khalasi | 21dc619 | 2018-05-31 08:44:13 -0700 | [diff] [blame] | 61 | - compare-type: REG_EXP |
| 62 | pattern: '.*\.md' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 63 | |
| 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 Williams | e779dc0 | 2018-12-13 09:31:49 -0700 | [diff] [blame] | 71 | build-timeout: '20' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 72 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 73 | |
| 74 | scm: |
| 75 | - cord-infra-gerrit-repo-scm: |
Zack Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 76 | manifest-url: '{gerrit-server-url}/{cord-repo-manifest}' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 77 | branch: '$GERRIT_BRANCH' |
| 78 | destination-dir: 'cord' |
| 79 | |
Zack Williams | e779dc0 | 2018-12-13 09:31:49 -0700 | [diff] [blame] | 80 | node: 'ubuntu16.04-basebuild-1c-2g' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 81 | project-type: freestyle |
| 82 | concurrent: false |
| 83 | |
| 84 | builders: |
| 85 | - cord-infra-gerrit-repo-patch: |
Zack Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 86 | destination-dir: 'cord' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 87 | project: '$GERRIT_PROJECT' |
| 88 | change-number: '$GERRIT_CHANGE_NUMBER' |
| 89 | patchset-number: '$GERRIT_PATCHSET_NUMBER' |
| 90 | - shell: | |
Zack Williams | 2d7b350 | 2018-07-03 16:52:39 -0700 | [diff] [blame] | 91 | #!/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 Williams | dd15e12 | 2019-07-16 16:31:39 -0700 | [diff] [blame] | 101 | cp -r "$PROJECT_PATH" "docs/repos/$GERRIT_PROJECT" |
Zack Williams | 2d7b350 | 2018-07-03 16:52:39 -0700 | [diff] [blame] | 102 | |
Zack Williams | a0d36e3 | 2018-12-19 07:43:09 -0700 | [diff] [blame] | 103 | # build docs, don't touch checkout under test, capture test result |
Zack Williams | 2d7b350 | 2018-07-03 16:52:39 -0700 | [diff] [blame] | 104 | cd docs |
| 105 | SKIP_CHECKOUT="$GERRIT_PROJECT" make test |
Zack Williams | a0d36e3 | 2018-12-19 07:43:09 -0700 | [diff] [blame] | 106 | test_result=$? |
| 107 | |
| 108 | # cleanup |
| 109 | make clean |
| 110 | |
| 111 | exit $test_result |
Zack Williams | 2d7b350 | 2018-07-03 16:52:39 -0700 | [diff] [blame] | 112 | |
Kailash | e09f33d | 2019-02-20 10:58:25 -0800 | [diff] [blame] | 113 | publishers: |
| 114 | - email: |
| 115 | recipients: 'teo@opennetworking.org,smbaker@opennetworking.org,andy@opennetworking.org,zdw@opennetworking.org' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 116 | |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 117 | - job-template: |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 118 | id: publish-documentation |
| 119 | name: 'publish-documentation' |
| 120 | |
| 121 | triggers: |
Zack Williams | 9a021d7 | 2018-05-25 16:59:25 -0700 | [diff] [blame] | 122 | - gerrit: |
| 123 | server-name: '{gerrit-server-name}' |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 124 | dependency-jobs: '{dependency-jobs}' |
Zack Williams | 9a021d7 | 2018-05-25 16:59:25 -0700 | [diff] [blame] | 125 | 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 Williams | 642e5f7 | 2018-06-05 13:24:13 -0700 | [diff] [blame] | 145 | - compare-type: REG_EXP |
| 146 | pattern: '.*\.md' |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 147 | |
| 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 Williams | e779dc0 | 2018-12-13 09:31:49 -0700 | [diff] [blame] | 155 | build-timeout: '20' |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 156 | 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 Williams | e779dc0 | 2018-12-13 09:31:49 -0700 | [diff] [blame] | 164 | node: 'ubuntu16.04-basebuild-1c-2g' |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 165 | project-type: freestyle |
| 166 | concurrent: false |
| 167 | |
| 168 | builders: |
| 169 | - shell: | |
Zack Williams | 642e5f7 | 2018-06-05 13:24:13 -0700 | [diff] [blame] | 170 | #!/usr/bin/env bash |
Zack Williams | 9d661a4 | 2018-10-01 15:43:21 -0700 | [diff] [blame] | 171 | set -e -o pipefail |
Zack Williams | 642e5f7 | 2018-06-05 13:24:13 -0700 | [diff] [blame] | 172 | |
| 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 Williams | 7ac4efa | 2018-06-29 16:33:08 -0700 | [diff] [blame] | 177 | # build gitbook docs |
| 178 | cd $WORKSPACE/cord/docs |
Zack Williams | 2d7b350 | 2018-07-03 16:52:39 -0700 | [diff] [blame] | 179 | |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 180 | make build |
Zack Williams | 2cad032 | 2018-06-05 14:01:45 -0700 | [diff] [blame] | 181 | rsync -rvzh --delete _book/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH |
Zack Williams | 7ac4efa | 2018-06-29 16:33:08 -0700 | [diff] [blame] | 182 | |
| 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 Williams | 642e5f7 | 2018-06-05 13:24:13 -0700 | [diff] [blame] | 187 | |
Kailash | e09f33d | 2019-02-20 10:58:25 -0800 | [diff] [blame] | 188 | publishers: |
| 189 | - email: |
| 190 | recipients: 'teo@opennetworking.org,smbaker@opennetworking.org,andy@opennetworking.org,zdw@opennetworking.org' |
Zack Williams | 5364d1f | 2018-12-19 16:00:03 -0700 | [diff] [blame] | 191 | |
| 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 | |
Kailash | e09f33d | 2019-02-20 10:58:25 -0800 | [diff] [blame] | 250 | publishers: |
| 251 | - email: |
| 252 | recipients: 'teo@opennetworking.org,smbaker@opennetworking.org,andy@opennetworking.org,zdw@opennetworking.org' |