Make RTD docs job build correct branch
[releng/builder.git] / jjb / docs / docs-post-rtd.sh
diff --git a/jjb/docs/docs-post-rtd.sh b/jjb/docs/docs-post-rtd.sh
new file mode 100644 (file)
index 0000000..3725377
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+if [ $GERRIT_BRANCH == "master" ]; then
+    RTD_BUILD_VERSION=latest
+else
+    RTD_BUILD_VERSION=${GERRIT_BRANCH/\//-}
+fi
+curl -X POST --data "version_slug=$RTD_BUILD_VERSION" https://readthedocs.org/build/{rtdproject}