From c6302d87f3eb02aa67cfecf56c28b839ca4aeb26 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Wed, 20 May 2020 15:50:28 -0400 Subject: [PATCH] Add ceph-website job Signed-off-by: David Galloway --- ceph-website/build/build | 27 +++++++++ .../config/definitions/ceph-website.yml | 58 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 ceph-website/build/build create mode 100644 ceph-website/config/definitions/ceph-website.yml diff --git a/ceph-website/build/build b/ceph-website/build/build new file mode 100644 index 00000000..4cbab0c5 --- /dev/null +++ b/ceph-website/build/build @@ -0,0 +1,27 @@ +#!/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/ diff --git a/ceph-website/config/definitions/ceph-website.yml b/ceph-website/config/definitions/ceph-website.yml new file mode 100644 index 00000000..0b977d0b --- /dev/null +++ b/ceph-website/config/definitions/ceph-website.yml @@ -0,0 +1,58 @@ +- 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 -- 2.47.3