From dbee13315e451038e72e3bc65bc13a9d3d092e0b Mon Sep 17 00:00:00 2001
From: annegentle <anne@openstack.org>
Date: Wed, 31 Oct 2012 10:39:25 -0500
Subject: [PATCH] Starting patch to get api-quick-start building with
 zuul/yaml.

Task list is at https://etherpad.openstack.org/api-site-structure.

Patchset updates the ftp copy in the publishing portion of the
api-quick-start build.

Patchset addresses comments, also indicates
doc-publisher-site: api.openstack.org

Patchset adds build for the api reference page.

Rebase against master.

Fixes the list of jobs and changes the name of the old api-site job
to ensure no duplication and clarity of which job is which.

Fixes errant tab.

Change-Id: Ifbefa75ba9bf63ca36e53dfda668fa9831203c06
Reviewed-on: https://review.openstack.org/15111
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
---
 .gitignore                                    |  1 +
 .../jenkins_job_builder/config/api-jobs.yaml  | 82 +++++++++++++++++++
 .../jenkins_job_builder/config/projects.yaml  |  9 ++
 .../openstack_project/files/zuul/layout.yaml  | 10 +++
 4 files changed, 102 insertions(+)

diff --git a/.gitignore b/.gitignore
index 1315119761..d5608f4c71 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.DS_Store
 *.swp
 *~
 *.pyc
diff --git a/modules/openstack_project/files/jenkins_job_builder/config/api-jobs.yaml b/modules/openstack_project/files/jenkins_job_builder/config/api-jobs.yaml
index a3241454a3..5f05e942c5 100644
--- a/modules/openstack_project/files/jenkins_job_builder/config/api-jobs.yaml
+++ b/modules/openstack_project/files/jenkins_job_builder/config/api-jobs.yaml
@@ -3,6 +3,88 @@
     jobs:
       - gate-{name}-merge
 
+# in zuul/layout.yaml specified to only run against master branch.
+# this copies static files from www
+- job:
+    name: openstack-api-site
+    concurrent: false
+    node: precise
+
+    triggers:
+      - zuul-post
+
+    builders:
+      - gerrit-git-prep
+
+    publishers:
+      - ftp:
+          site: api.openstack.org
+          source: 'www/**'
+          target: ''
+          remove-prefix: 'www/'
+          excludes: ''
+      - console-log-post
+
+# this replaces the old openstack-api-site job in Jenkins
+- job:
+    name: openstack-api-ref
+    project-type: maven
+    concurrent: false
+    node: precise
+
+    triggers:
+      - zuul-post
+
+    prebuilders:
+      - gerrit-git-prep
+
+    maven:
+      root-module:
+        group-id: org.openstack.docs
+        artifact-id: openstack-guide
+      root-pom: api-ref/pom.xml
+      goals: 'clean generate-sources'
+
+    publishers:
+      - console-log-post
+      - ftp:
+          site: api.openstack.org
+          source: 'api-ref/target/docbkx/html/api-ref/**'
+          target: ''
+          remove-prefix: 'api-ref/target/docbkx/html/api-ref/'
+          excludes: '**/*.xml,**/null*'
+          remote-directory: ''
+
+# this replaces the old openstack-api-quick-start job
+- job:
+    name: openstack-api-quick-start
+    project-type: maven
+    concurrent: false
+    node: precise
+
+    triggers:
+      - zuul-post
+
+    prebuilders:
+      - gerrit-git-prep
+
+    maven:
+      root-module:
+        group-id: org.openstack.docs
+        artifact-id: openstack-guide
+      root-pom: api-quick-start/pom.xml
+      goals: 'clean generate-sources'
+
+    publishers:
+      - console-log-post
+      - ftp:
+          site: api.openstack.org
+          source: 'doc/target/docbkx/webhelp/api-quick-start-onepager/**'
+          target: ''
+          remove-prefix: 'doc/target/docbkx/webhelp/api-quick-start-onepager/'
+          excludes: '**/*.xml,**/null*'
+          remote-directory: 'api/quick-start'
+
 # this replaces the old openstack-netconn-api-doc job
 - job:
     name: network-api-v10
diff --git a/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml b/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml
index fd721587ac..a5c52b5e12 100644
--- a/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml
+++ b/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml
@@ -1,3 +1,12 @@
+- project:
+    name: api-site
+    github-org: openstack
+    node: precise
+    doc-publisher-site: api.openstack.org
+
+    jobs:
+      - gate-{name}-merge
+
 - project:
     name: ceilometer
     github-org: stackforge
diff --git a/modules/openstack_project/files/zuul/layout.yaml b/modules/openstack_project/files/zuul/layout.yaml
index e7544db3ac..b1cc8d8dc0 100644
--- a/modules/openstack_project/files/zuul/layout.yaml
+++ b/modules/openstack_project/files/zuul/layout.yaml
@@ -753,6 +753,16 @@ projects:
       - openstack-install-deploy-guide-apt-fedora
       - openstack-install-deploy-guide-ubuntu
 
+  - name: openstack/api-site
+    check:
+      - gate-api-site-merge
+    gate:
+      - gate-api-site-merge
+    post:
+      - openstack-api-quick-start
+      - openstack-api-site
+      - openstack-api-ref
+
   - name: openstack/compute-api
     check:
       - gate-compute-api-merge