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 | 9a021d7 | 2018-05-25 16:59:25 -0700 | [diff] [blame] | 9 | other-docs-repos-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 | 9a021d7 | 2018-05-25 16:59:25 -0700 | [diff] [blame] | 17 | other-docs-repos-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) |
| 101 | cp -r "$PROJECT_PATH" "docs/repos/$(basename $PROJECT_PATH)" |
| 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 | |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 113 | |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 114 | - job-template: |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 115 | id: publish-documentation |
| 116 | name: 'publish-documentation' |
| 117 | |
| 118 | triggers: |
Zack Williams | 9a021d7 | 2018-05-25 16:59:25 -0700 | [diff] [blame] | 119 | - gerrit: |
| 120 | server-name: '{gerrit-server-name}' |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 121 | dependency-jobs: '{dependency-jobs}' |
Zack Williams | 9a021d7 | 2018-05-25 16:59:25 -0700 | [diff] [blame] | 122 | silent-start: true |
| 123 | trigger-on: |
| 124 | - change-merged-event |
| 125 | projects: |
| 126 | - project-compare-type: PLAIN |
| 127 | project-pattern: 'docs' |
| 128 | branches: |
| 129 | - branch-compare-type: REG_EXP |
| 130 | branch-pattern: '{branch-regexp}' |
| 131 | file-paths: |
| 132 | - compare-type: REG_EXP |
| 133 | pattern: '{all-files-regexp}' |
| 134 | - project-compare-type: REG_EXP |
| 135 | project-pattern: '{other-docs-repos-regexp}' |
| 136 | branches: |
| 137 | - branch-compare-type: REG_EXP |
| 138 | branch-pattern: '{branch-regexp}' |
| 139 | file-paths: |
| 140 | - compare-type: REG_EXP |
| 141 | pattern: '{doc-files-regexp}' |
Zack Williams | 642e5f7 | 2018-06-05 13:24:13 -0700 | [diff] [blame] | 142 | - compare-type: REG_EXP |
| 143 | pattern: '.*\.md' |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 144 | |
| 145 | properties: |
| 146 | - cord-infra-properties: |
| 147 | build-days-to-keep: '{build-days-to-keep}' |
| 148 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 149 | |
| 150 | wrappers: |
| 151 | - lf-infra-wrappers: |
Zack Williams | e779dc0 | 2018-12-13 09:31:49 -0700 | [diff] [blame] | 152 | build-timeout: '20' |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 153 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 154 | |
| 155 | scm: |
| 156 | - cord-infra-gerrit-repo-scm: |
| 157 | manifest-url: '{gerrit-server-url}/{cord-repo-manifest}' |
| 158 | branch: '$GERRIT_BRANCH' |
| 159 | destination-dir: 'cord' |
| 160 | |
Zack Williams | e779dc0 | 2018-12-13 09:31:49 -0700 | [diff] [blame] | 161 | node: 'ubuntu16.04-basebuild-1c-2g' |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 162 | project-type: freestyle |
| 163 | concurrent: false |
| 164 | |
| 165 | builders: |
| 166 | - shell: | |
Zack Williams | 642e5f7 | 2018-06-05 13:24:13 -0700 | [diff] [blame] | 167 | #!/usr/bin/env bash |
Zack Williams | 9d661a4 | 2018-10-01 15:43:21 -0700 | [diff] [blame] | 168 | set -e -o pipefail |
Zack Williams | 642e5f7 | 2018-06-05 13:24:13 -0700 | [diff] [blame] | 169 | |
| 170 | # Set up the ssh host keys for the docs host |
| 171 | mkdir -p ~/.ssh |
| 172 | echo '{docs-ssh-host-key}' >> ~/.ssh/known_hosts |
| 173 | |
Zack Williams | 7ac4efa | 2018-06-29 16:33:08 -0700 | [diff] [blame] | 174 | # build gitbook docs |
| 175 | cd $WORKSPACE/cord/docs |
Zack Williams | 2d7b350 | 2018-07-03 16:52:39 -0700 | [diff] [blame] | 176 | |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 177 | make build |
Zack Williams | 2cad032 | 2018-06-05 14:01:45 -0700 | [diff] [blame] | 178 | rsync -rvzh --delete _book/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH |
Zack Williams | 7ac4efa | 2018-06-29 16:33:08 -0700 | [diff] [blame] | 179 | |
| 180 | # build swagger docs |
| 181 | cd $WORKSPACE/cord/orchestration/xos/docs |
| 182 | make swagger_docs |
| 183 | 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] | 184 | |
Zack Williams | 5364d1f | 2018-12-19 16:00:03 -0700 | [diff] [blame^] | 185 | |
| 186 | - job-template: |
| 187 | id: publish-xos-documentation |
| 188 | name: 'publish-xos-documentation' |
| 189 | |
| 190 | triggers: |
| 191 | - gerrit: |
| 192 | server-name: '{gerrit-server-name}' |
| 193 | dependency-jobs: '{dependency-jobs}' |
| 194 | silent-start: true |
| 195 | trigger-on: |
| 196 | - change-merged-event |
| 197 | projects: |
| 198 | - project-compare-type: PLAIN |
| 199 | project-pattern: 'xos' |
| 200 | branches: |
| 201 | - branch-compare-type: REG_EXP |
| 202 | branch-pattern: '{branch-regexp}' |
| 203 | file-paths: |
| 204 | - compare-type: REG_EXP |
| 205 | pattern: '{doc-files-regexp}' |
| 206 | - compare-type: REG_EXP |
| 207 | pattern: '.*\.md' |
| 208 | |
| 209 | properties: |
| 210 | - cord-infra-properties: |
| 211 | build-days-to-keep: '{build-days-to-keep}' |
| 212 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 213 | |
| 214 | wrappers: |
| 215 | - lf-infra-wrappers: |
| 216 | build-timeout: '20' |
| 217 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 218 | |
| 219 | scm: |
| 220 | - cord-infra-gerrit-repo-scm: |
| 221 | manifest-url: '{gerrit-server-url}/xos-manifest.git' |
| 222 | branch: '$GERRIT_BRANCH' |
| 223 | destination-dir: 'cord' |
| 224 | |
| 225 | node: 'ubuntu16.04-basebuild-1c-2g' |
| 226 | project-type: freestyle |
| 227 | concurrent: false |
| 228 | |
| 229 | builders: |
| 230 | - shell: | |
| 231 | #!/usr/bin/env bash |
| 232 | set -e -o pipefail |
| 233 | |
| 234 | # Set up the ssh host keys for the docs host |
| 235 | mkdir -p ~/.ssh |
| 236 | echo '{docs-ssh-host-key}' >> ~/.ssh/known_hosts |
| 237 | |
| 238 | # build gitbook docs |
| 239 | cd $WORKSPACE/cord/xos-core/docs |
| 240 | |
| 241 | make build |
| 242 | rsync -rvzh --delete _book/ guide.opencord.org:/var/www/xos-guide |
| 243 | |