]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-pr-docs: assume running on the docs node
authorAlfredo Deza <adeza@redhat.com>
Fri, 11 Aug 2017 12:33:07 +0000 (08:33 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 11 Aug 2017 18:00:08 +0000 (14:00 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-pr-docs/build/build

index 3e8a67766b9e6d166199872b5e0c09fb72884540..f6762f0e4a408dbef095a4f65d448e0b90eac234 100644 (file)
@@ -2,16 +2,30 @@
 
 set -ex
 
-# make sure any shaman list file is removed. At some point if all nodes
-# are clean this will not be needed.
-sudo rm -f /etc/apt/sources.list.d/shaman*
+# 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
 
-# Ceph doc build deps, Ubuntu only because ditaa is not packaged for CentOS
-sudo apt-get update
-sudo apt-get install -y gcc python-dev python-pip python-virtualenv libxml2-dev libxslt-dev doxygen graphviz ant ditaa
-sudo apt-get install -y python-sphinx
 
 ./admin/build-doc
 
-# XXX to be removed after it is all working, here for debug only
-ls -l build-doc/output/html/
+# 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