]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Add ceph-website job 1574/head
authorDavid Galloway <dgallowa@redhat.com>
Wed, 20 May 2020 19:50:28 +0000 (15:50 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 20 May 2020 22:38:10 +0000 (18:38 -0400)
Signed-off-by: David Galloway <dgallowa@redhat.com>
ceph-website/build/build [new file with mode: 0644]
ceph-website/config/definitions/ceph-website.yml [new file with mode: 0644]

diff --git a/ceph-website/build/build b/ceph-website/build/build
new file mode 100644 (file)
index 0000000..4cbab0c
--- /dev/null
@@ -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 (file)
index 0000000..0b977d0
--- /dev/null
@@ -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