From faa5f7ca5fcfb80fe2e8e418d1db3608800066b1 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Tue, 27 Oct 2015 14:49:21 -0600 Subject: [PATCH] add ceph-docs job This job publishes ceph's in-tree documentation to the docs.ceph.com web server. Gitbuilder previously performed this function, so we can retire the gitbuilder host (gitbuilder-doc.front.sepia.ceph.com) that did this, once we're satisfied that this job is running smoothly. TODO: Replace "newdocs.ceph.com" with "docs.ceph.com" in the rsync commands and SSH host key. This can be done once we change the "docs.ceph.com" A record in DNS to point to the the newdocs.ceph.com web server. --- ansible/files/ssh/hostkeys/docs.ceph.com.pub | 3 ++ ansible/slave.yml | 11 +++++ ansible/slave.yml.j2 | 11 +++++ ceph-docs/build/build | 24 +++++++++++ ceph-docs/config/definitions/ceph-docs.yml | 43 ++++++++++++++++++++ 5 files changed, 92 insertions(+) create mode 100644 ansible/files/ssh/hostkeys/docs.ceph.com.pub create mode 100644 ceph-docs/build/build create mode 100644 ceph-docs/config/definitions/ceph-docs.yml diff --git a/ansible/files/ssh/hostkeys/docs.ceph.com.pub b/ansible/files/ssh/hostkeys/docs.ceph.com.pub new file mode 100644 index 00000000..70386576 --- /dev/null +++ b/ansible/files/ssh/hostkeys/docs.ceph.com.pub @@ -0,0 +1,3 @@ +docs.ceph.com,newdocs.ceph.com,173.236.253.149 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBDXvH756ZpNtOTJrg9Exypn5Yb3ABDTqhBvUOOtj7wxzBbXtOYwrvtmls6wMfuHgAOIxjvNIjADkpRYRAuf+TVA= +docs.ceph.com,newdocs.ceph.com,173.236.253.149 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCpJb8vcpiCchL+gRfc749x7/xyo4Gr4VltXFwvK361zlFlfUgpULD1aBpLpAth060QzNBczJymuM6JLCW8d4t0nsKVDKL0dcOySvhZ86tnVKANwDt0S75q0Pd80ClesOZsn+awQ1Rq0eT4dMhLql9PWgSggLOTL+kT8NBFovEIvAiol0uv+L4pVWeJh7FhdMokAHGf7UrbZG/EbjCOvveQmSVLnCUnqxm71y8wQQxGOcLZYdzl2hvIHlI5mJPotx8Pl5QzEs34hF9rltiQ0LJp8gLlFL3ydPW7NK88HxZEgSIwx53v1wJqB6bsf/qxrXOy+Cg4i/i4RjT9ij38Ez8L +docs.ceph.com,newdocs.ceph.com,173.236.253.149 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFay6H/uhGZ9Z4n18vV87OgNp1sIQTuJ4TLMmqPe6Ulk diff --git a/ansible/slave.yml b/ansible/slave.yml index bb1b640f..f23a6970 100644 --- a/ansible/slave.yml +++ b/ansible/slave.yml @@ -60,12 +60,23 @@ - python-dev - python-pip - python-virtualenv + # ceph-docs job: + - doxygen + - ditaa + - ant when: ansible_pkg_mgr == "apt" - name: install python-jenkins sudo: true pip: name=python-jenkins + - name: add docs.ceph.com host key + sudo: true + known_hosts: path='/etc/ssh/ssh_known_hosts' + name='docs.ceph.com' + # docs.ceph.com.pub is the output of `ssh-keyscan docs.ceph.com` + key="{{ lookup('file', 'ssh/hostkeys/docs.ceph.com.pub') }}" + - name: register the new slave to jenkins master jenkins-node: username: "{{ api_user }}" diff --git a/ansible/slave.yml.j2 b/ansible/slave.yml.j2 index 8dd38c3b..4abd2bb9 100644 --- a/ansible/slave.yml.j2 +++ b/ansible/slave.yml.j2 @@ -89,6 +89,10 @@ - libtool - autotools-dev - automake + # ceph-docs job: + - doxygen + - ditaa + - ant when: ansible_pkg_mgr == "apt" - name: install six, latest one @@ -100,6 +104,13 @@ # https://bugs.launchpad.net/python-jenkins/+bug/1500898 pip: name=python-jenkins version=0.4.7 + - name: add docs.ceph.com host key + sudo: true + known_hosts: path='/etc/ssh/ssh_known_hosts' + name='docs.ceph.com' + # docs.ceph.com.pub is the output of `ssh-keyscan docs.ceph.com` + key="{{ lookup('file', 'ssh/hostkeys/docs.ceph.com.pub') }}" + - name: register the new slave to jenkins master jenkins-node: username: "{{ api_user }}" diff --git a/ceph-docs/build/build b/ceph-docs/build/build new file mode 100644 index 00000000..a740d4af --- /dev/null +++ b/ceph-docs/build/build @@ -0,0 +1,24 @@ +#!/bin/bash + +set -ex + +./admin/build-doc + +REV="$(git rev-parse HEAD)" +OUTDIR="docs.raw/sha1/$REV" +mkdir -p $OUTDIR + +cp -a build-doc/output/html/* $OUTDIR + +# Log this $OUTDIR's sha1 +printf '%s\n' "$REV" >"$OUTDIR/sha1" + +# Symlink the branch name +BRANCH=${GIT_BRANCH#*/} +mkdir -p docs.raw/ref/ +ln -s ../sha1/$REV "docs.raw/ref/$BRANCH" + +# Publish this sha1's contents first: +rsync -a -v docs.raw/sha1/$REV jenkins-publish@newdocs.ceph.com:/var/docs.raw/sha1/ +# Now point the ref symlink at the newly-uploaded sha1. +rsync -a -v docs.raw/ref/$BRANCH jenkins-publish@newdocs.ceph.com:/var/docs.raw/ref/ diff --git a/ceph-docs/config/definitions/ceph-docs.yml b/ceph-docs/config/definitions/ceph-docs.yml new file mode 100644 index 00000000..d1ae327d --- /dev/null +++ b/ceph-docs/config/definitions/ceph-docs.yml @@ -0,0 +1,43 @@ +- job: + name: ceph-docs + node: trusty + project-type: freestyle + defaults: global + concurrent: false + quiet-period: 5 + block-downstream: false + block-upstream: false + properties: + - github: + url: https://github.com/ceph/ceph + discard-old-builds: true + logrotate: + daysToKeep: 1 + numToKeep: 10 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + + triggers: + - pollscm: "H * * * *" + + scm: + - git: + url: https://github.com/ceph/ceph.git + 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 + + wrappers: + - ssh-agent-credentials: + users: + # "jenkins-publish" SSH key, needed for rsync to docs.ceph.com: + - 'fa9ca012-6731-4c7d-be74-eda748e36ee8' + + builders: + - shell: + !include-raw ../../build/build -- 2.39.5