X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fopnfvdocs%2Fopnfvdocs.yml;h=de48aafb7445c9ac449c02f7acfb98a98e734ba9;hb=f98556c6d6f201d14ec3f3484cbdcd27e22fd56f;hp=da9f13cf408e6785f3d071197bab4ae76b7b814d;hpb=90384095dba59ec8efcb0a576bc3522b66020cb2;p=releng.git diff --git a/jjb/opnfvdocs/opnfvdocs.yml b/jjb/opnfvdocs/opnfvdocs.yml index da9f13cf4..de48aafb7 100644 --- a/jjb/opnfvdocs/opnfvdocs.yml +++ b/jjb/opnfvdocs/opnfvdocs.yml @@ -1,92 +1,48 @@ +######################## +# Job configuration for opnfvdocs +######################## - project: + name: opnfvdocs + + project: '{name}' + jobs: + - 'opnfvdocs-verify-{stream}' + - 'opnfvdocs-merge-{stream}' - 'opnfvdocs-daily-{stream}' - - 'opnfvdocs-merge' - - 'opnfvdocs-verify' - # stream: branch with - in place of / (eg. stable-helium) - # branch: branch (eg. stable/helium) stream: - master: - branch: 'master' + branch: '{stream}' gs-pathname: '' - - stable-arno: - branch: 'stable/arno' - gs-pathname: '/arno' + - brahmaputra: + branch: 'stable/{stream}' + gs-pathname: '/{stream}' - project: 'opnfvdocs' +######################## +# job templates +######################## - job-template: - name: 'opnfvdocs-daily-{stream}' - - node: gce-opnfv-docker-1 - - # Job template for daily builders - # - # Required Variables: - # stream: branch with - in place of / (eg. stable) - # branch: branch (eg. stable) - - project-type: freestyle - - logrotate: - daysToKeep: '{build-days-to-keep}' - numToKeep: '{build-num-to-keep}' - artifactDaysToKeep: '{build-artifact-days-to-keep}' - artifactNumToKeep: '{build-artifact-num-to-keep}' + name: 'opnfvdocs-verify-{stream}' parameters: - project-parameter: - project: '{project}' - - opnfvdocs-parameter: - gs-pathname: '{gs-pathname}' - - scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' + project: $GERRIT_PROJECT + - gerrit-parameter: branch: '{branch}' + - string: + name: GIT_CLONE_BASE + default: ssh://gerrit.opnfv.org:29418 + description: "Used for overriding the GIT URL coming from parameters macro." - wrappers: - - ssh-agent-credentials: - user: '{ssh-credentials}' - - triggers: - - 'opnfvdocs-{stream}' - - builders: - - shell: - !include-raw docu-build.sh - -- job-template: - name: 'opnfvdocs-verify' - - node: gce-opnfv-docker-1 - - project-type: freestyle - - logrotate: - daysToKeep: 30 - numToKeep: 10 - artifactDaysToKeep: -1 - artifactNumToKeep: -1 - - parameters: - - project-parameter: - project: '{project}' - - gerrit-parameter: - branch: 'master' scm: - gerrit-trigger-scm: credentials-id: '{ssh-credentials}' refspec: '$GERRIT_REFSPEC' choosing-strategy: 'gerrit' - wrappers: - - ssh-agent-credentials: - user: '{ssh-credentials}' - triggers: - gerrit: trigger-on: @@ -100,48 +56,43 @@ - comment-added-contains-event: comment-contains-value: 'reverify' projects: - - project-compare-type: 'ANT' - project-pattern: 'opnfvdocs' + - project-compare-type: 'REG_EXP' + project-pattern: '{project}' branches: - branch-compare-type: 'ANT' - branch-pattern: '**/master' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: ANT + pattern: 'docs/**' builders: - - shell: - !include-raw docu-build.sh + - clone-opnfv-repos + - build-html-and-pdf-docs-output + - upload-under-review-docs-to-opnfv-artifacts + - report-docs-build-result-to-gerrit - job-template: - name: 'opnfvdocs-merge' - - node: gce-opnfv-docker-1 - - # builder-merge job to run JJB update - # - # This job's purpose is to update all the JJB - - project-type: freestyle - - logrotate: - daysToKeep: 30 - numToKeep: 40 - artifactDaysToKeep: -1 - artifactNumToKeep: 5 + name: 'opnfvdocs-merge-{stream}' parameters: - project-parameter: - project: '{project}' + project: $GERRIT_PROJECT - gerrit-parameter: - branch: 'master' + branch: '{branch}' + - string: + name: GIT_CLONE_BASE + default: ssh://gerrit.opnfv.org:29418 + description: "Used for overriding the GIT URL coming from parameters macro." + - string: + name: GS_URL + default: '$GS_BASE{gs-pathname}' + description: "Directory where the build artifact will be located upon the completion of the build." scm: - gerrit-trigger-scm: credentials-id: '{ssh-credentials}' - refspec: '' - choosing-strategy: 'default' - - wrappers: - - ssh-agent-credentials: - user: '{ssh-credentials}' + refspec: '$GERRIT_REFSPEC' + choosing-strategy: 'gerrit' triggers: - gerrit: @@ -150,36 +101,81 @@ - comment-added-contains-event: comment-contains-value: 'remerge' projects: - - project-compare-type: 'ANT' - project-pattern: 'opnfvdocs' + - project-compare-type: 'REG_EXP' + project-pattern: '{project}' branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/master' + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: ANT + pattern: 'docs/**' builders: - - shell: - !include-raw docu-build.sh + - clone-opnfv-repos + - build-html-and-pdf-docs-output +# - upload-generated-docs-to-opnfv-artifacts + - report-docs-build-result-to-gerrit + - remove-old-docs-from-opnfv-artifacts + +- job-template: + name: 'opnfvdocs-daily-{stream}' -######################## -# parameter macros -######################## -- parameter: - name: opnfvdocs-parameter parameters: + - project-parameter: + project: '{project}' + - string: + name: GS_URL + default: '$GS_BASE{gs-pathname}' + description: "Directory where the build artifact will be located upon the completion of the build." + - string: + name: GIT_CLONE_BASE + default: ssh://gerrit.opnfv.org:29418 + description: "Used for overriding the GIT URL coming from parameters macro." - string: - name: GS_PATHNAME - default: '{gs-pathname}' - description: "Version directory where the opnfv documents will be stored in gs repository" + name: GERRIT_BRANCH + default: '{branch}' + description: 'Specify the branch in this way in order to be able to use clone-opnfv-repos builder.' -######################## -# trigger macros -######################## -- trigger: - name: 'opnfvdocs-master' - triggers: - - pollscm: "H 9 * * *" + scm: + - git-scm: + credentials-id: '{ssh-credentials}' + refspec: '' + branch: '{branch}' -- trigger: - name: 'opnfvdocs-stable-arno' triggers: - - pollscm: "H 21 * * *" + - timed: '0 H/6 * * *' + + builders: + - clone-opnfv-repos + - build-html-and-pdf-docs-output +# - upload-generated-docs-to-opnfv-artifacts + +- builder: + name: clone-opnfv-repos + builders: + - shell: | + #!/bin/bash + set -o errexit + set -o nounset + set -o pipefail + + # clone releng repo to get repo list + cd $WORKSPACE + echo "Cloning releng repo" + git clone $GIT_CLONE_BASE/releng --branch master --depth 1 --quiet + + # clone rest of the repos and checkout the branch + echo "Cloning repos of participating OPNFV Projects and checking out $GERRIT_BRANCH" + echo + echo "--------------------------------------------------------" + for repo in $(grep -v '^#' $WORKSPACE/releng/jjb/opnfvdocs/project.cfg | sort); do + cd $WORKSPACE/docs + echo " $repo" + git clone $GIT_CLONE_BASE/$repo --branch $GERRIT_BRANCH --depth 1 --quiet + done + echo "--------------------------------------------------------" + echo + echo "Done" + + # remove releng clone in order not to cause issues for rest of the builders + /bin/rm -rf $WORKSPACE/releng