From b277ac580625b9393c27f1c173c341c2a1a1b6a9 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Wed, 16 Aug 2017 08:56:52 -0400 Subject: [PATCH] ceph-pr-render-docs: create a new job to render html docs from PRs This is needed because doc builds will now be enforced on all Ceph PRs but unlike this 'render' job, those will just build, not publish the HTML anywhere Signed-off-by: Alfredo Deza --- ceph-pr-render-docs/build/build | 31 ++++++++++++ .../definitions/ceph-pr-render-docs.yml | 48 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 ceph-pr-render-docs/build/build create mode 100644 ceph-pr-render-docs/config/definitions/ceph-pr-render-docs.yml diff --git a/ceph-pr-render-docs/build/build b/ceph-pr-render-docs/build/build new file mode 100644 index 00000000..f6762f0e --- /dev/null +++ b/ceph-pr-render-docs/build/build @@ -0,0 +1,31 @@ +#!/bin/bash + +set -ex + +# This job is meant to be triggered from a Github Pull Request, only when the +# job is executed in that way a few "special" variables become available. So +# this build script tries to use those first but then it will try to figure it +# out using Git directly so that if triggered manually it can attempt to +# actually work. +PR_ID=$ghprbPullId + +# fallback to just using 'manual' if that ID is not available, for manually +# triggered builds +if [ -z "$ghprbPullId" ]; then + PR_ID="manual" +fi + + +./admin/build-doc + +# publish docs to http://docs.ceph.com/ceph-prs/$PR_ID/ +mkdir -p "/var/ceph-prs/$PR_ID" +rsync -auv --delete build-doc/output/html/* "/var/ceph-prs/$PR_ID/" + +set +e +set +x +echo +echo "Docs available to preview at:" +echo +echo " http://docs.ceph.com/ceph-prs/$PR_ID/" +echo diff --git a/ceph-pr-render-docs/config/definitions/ceph-pr-render-docs.yml b/ceph-pr-render-docs/config/definitions/ceph-pr-render-docs.yml new file mode 100644 index 00000000..4bc13247 --- /dev/null +++ b/ceph-pr-render-docs/config/definitions/ceph-pr-render-docs.yml @@ -0,0 +1,48 @@ +- job: + name: ceph-pr-render-docs + display-name: 'ceph: Pull Requests Render Docs' + node: docs + project-type: freestyle + defaults: global + quiet-period: 5 + block-downstream: false + block-upstream: false + properties: + - github: + url: https://github.com/ceph/ceph + discard-old-builds: true + logrotate: + daysToKeep: 14 + + triggers: + - github-pull-request: + allow-whitelist-orgs-as-admins: true + org-list: + - ceph + cancel-builds-on-update: true + # this job is only triggered by explicitly asking for it + only-trigger-phrase: true + trigger-phrase: 'jenkins render docs.*' + github-hooks: true + permit-all: true + auto-close-on-fail: false + status-context: "Docs: render build" + started-status: "Docs: building to render" + success-status: "OK - docs rendered" + failure-status: "Docs: render failed with errors" + success-comment: "Doc render available at http://docs.ceph.com/ceph-prs/${ghprbPullId}/" + + scm: + - git: + url: https://github.com/ceph/ceph + browser: auto + branches: + - ${sha1} + refspec: +refs/pull/*:refs/remotes/origin/pr/* + skip-tag: true + timeout: 20 + wipe-workspace: true + + builders: + - shell: + !include-raw ../../build/build -- 2.39.5