]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
add ceph-docs job
authorKen Dreyer <kdreyer@redhat.com>
Tue, 27 Oct 2015 20:49:21 +0000 (14:49 -0600)
committerKen Dreyer <kdreyer@redhat.com>
Tue, 27 Oct 2015 20:49:21 +0000 (14:49 -0600)
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 [new file with mode: 0644]
ansible/slave.yml
ansible/slave.yml.j2
ceph-docs/build/build [new file with mode: 0644]
ceph-docs/config/definitions/ceph-docs.yml [new file with mode: 0644]

diff --git a/ansible/files/ssh/hostkeys/docs.ceph.com.pub b/ansible/files/ssh/hostkeys/docs.ceph.com.pub
new file mode 100644 (file)
index 0000000..7038657
--- /dev/null
@@ -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
index bb1b640fc92b62aa80f2c9484fc818143b8e820f..f23a69705991ad4ed823a0103fedec9c8bb3ac96 100644 (file)
         - 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 }}"
index 8dd38c3b1e552baa0bdda582e7e784265144f827..4abd2bb9a5e8c6645b6a3365de740e9b48508cf9 100644 (file)
         - libtool
         - autotools-dev
         - automake
+        # ceph-docs job:
+        - doxygen
+        - ditaa
+        - ant
       when: ansible_pkg_mgr  == "apt"
 
     - name: install six, latest one
       # 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 (file)
index 0000000..a740d4a
--- /dev/null
@@ -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 (file)
index 0000000..d1ae327
--- /dev/null
@@ -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