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 | bf4cfe5 | 2018-05-14 16:29:57 -0700 | [diff] [blame] | 20 | - job-template: |
Zack Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 21 | id: verify-documentation |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 22 | name: "verify-documentation" |
| 23 | |
| 24 | triggers: |
Zack Williams | 0e594a3 | 2018-05-15 19:30:38 -0700 | [diff] [blame] | 25 | - gerrit: |
| 26 | server-name: '{gerrit-server-name}' |
Zack Williams | a1d1fc6 | 2018-05-15 10:51:31 -0700 | [diff] [blame] | 27 | dependency-jobs: '{dependency-jobs}' |
Zack Williams | 0e594a3 | 2018-05-15 19:30:38 -0700 | [diff] [blame] | 28 | 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 Khalasi | 21dc619 | 2018-05-31 08:44:13 -0700 | [diff] [blame] | 54 | - compare-type: REG_EXP |
| 55 | pattern: '.*\.md' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 56 | |
| 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 Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 69 | manifest-url: '{gerrit-server-url}/{cord-repo-manifest}' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 70 | 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 Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 79 | destination-dir: 'cord' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 80 | project: '$GERRIT_PROJECT' |
| 81 | change-number: '$GERRIT_CHANGE_NUMBER' |
| 82 | patchset-number: '$GERRIT_PATCHSET_NUMBER' |
| 83 | - shell: | |
Zack Williams | bf4cfe5 | 2018-05-14 16:29:57 -0700 | [diff] [blame] | 84 | cd cord/docs |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 85 | make test |
| 86 | |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 87 | - job-template: |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 88 | id: publish-documentation |
| 89 | name: 'publish-documentation' |
| 90 | |
| 91 | triggers: |
Zack Williams | 9a021d7 | 2018-05-25 16:59:25 -0700 | [diff] [blame] | 92 | - gerrit: |
| 93 | server-name: '{gerrit-server-name}' |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 94 | dependency-jobs: '{dependency-jobs}' |
Zack Williams | 9a021d7 | 2018-05-25 16:59:25 -0700 | [diff] [blame] | 95 | 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 Williams | 642e5f7 | 2018-06-05 13:24:13 -0700 | [diff] [blame] | 115 | - compare-type: REG_EXP |
| 116 | pattern: '.*\.md' |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 117 | |
| 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 Williams | 642e5f7 | 2018-06-05 13:24:13 -0700 | [diff] [blame] | 140 | #!/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 | |
| 146 | # build the docs |
Kailash Khalasi | ca59055 | 2018-05-24 15:09:42 -0700 | [diff] [blame] | 147 | cd cord/docs |
| 148 | make build |
Zack Williams | 642e5f7 | 2018-06-05 13:24:13 -0700 | [diff] [blame] | 149 | |
| 150 | # copy swagger REST API docs first, then exclude deleting them when copying rest of guide |
Zack Williams | 2cad032 | 2018-06-05 14:01:45 -0700 | [diff] [blame^] | 151 | rsync -rvzh --delete _book/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH |
| 152 | rsync -rvzh --delete xos/swagger/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH/swagger |
Zack Williams | 642e5f7 | 2018-06-05 13:24:13 -0700 | [diff] [blame] | 153 | |