]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-pr-render-docs: create a new job to render html docs from PRs
authorAlfredo Deza <adeza@redhat.com>
Wed, 16 Aug 2017 12:56:52 +0000 (08:56 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 16 Aug 2017 13:05:54 +0000 (09:05 -0400)
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 <adeza@redhat.com>
ceph-pr-render-docs/build/build [new file with mode: 0644]
ceph-pr-render-docs/config/definitions/ceph-pr-render-docs.yml [new file with mode: 0644]

diff --git a/ceph-pr-render-docs/build/build b/ceph-pr-render-docs/build/build
new file mode 100644 (file)
index 0000000..f6762f0
--- /dev/null
@@ -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 (file)
index 0000000..4bc1324
--- /dev/null
@@ -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