--- /dev/null
+#!/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
--- /dev/null
+- 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