--- /dev/null
+#!/bin/bash
+set -ex
+
+## TODO: Check if only the src/ dir changed and `exit 0` if only the ceph.io.git README or something else inconsequential changed.
+env
+
+BRANCH=`branch_slash_filter ${GIT_BRANCH}`
+
+# Don't think this is even necessary
+#git checkout ${BRANCH}
+
+npm install
+
+npm run build
+
+if [ ! -d /opt/www/${BRANCH} ]; then
+ mkdir -p /opt/www/${BRANCH}
+fi
+
+rsync -av --delete-after dist/* /opt/www/${BRANCH}/
+
+# This just makes the last `echo` line not repeat
+{ set +x; } 2>/dev/null
+
+echo "Success! This site is available at https://${BRANCH}.ceph.io."
+
+## TODO: Prune deleted branches from /opt/www/
--- /dev/null
+- job:
+ name: ceph-website
+ description: This job builds branches from github.com/ceph/ceph.io and updates the website accordingly.
+ node: www
+ project-type: freestyle
+ defaults: global
+ quiet-period: 5
+ block-downstream: false
+ block-upstream: false
+ properties:
+ - build-discarder:
+ days-to-keep: 1
+ num-to-keep: 10
+ artifact-days-to-keep: -1
+ artifact-num-to-keep: -1
+ - github:
+ url: https://github.com/ceph/ceph.io
+
+ parameters:
+ - string:
+ name: sha1
+ description: "A pull request ID or branch, like 'origin/pr/72/head' or wip-blogpost1"
+
+ triggers:
+ - github
+ - github-pull-request:
+ org-list:
+ - ceph
+ cancel-builds-on-update: true
+ trigger-phrase: 'jenkins test.*|jenkins retest.*'
+ only-trigger-phrase: false
+ github-hooks: true
+ permit-all: false
+ auto-close-on-fail: false
+ status-context: "Compiling site"
+ started-status: "Compiling site"
+ success-status: "Site compiled successfully!"
+ failure-status: "Site compilation failed"
+# This is kinda noisy if there's lots of force pushes
+# success-comment: "Site built successfully! https://${GIT_BRANCH}.ceph.io"
+
+ scm:
+ - git:
+ url: https://github.com/ceph/ceph.io
+ browser: auto
+ # The default is to build and publish every branch.
+ # Uncomment this for testing:
+ #branches:
+ # - 'origin/master'
+ skip-tag: true
+ timeout: 20
+ wipe-workspace: true
+
+ builders:
+ - shell:
+ !include-raw:
+ - ../../../scripts/build_utils.sh
+ - ../../build/build