]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-ansible-prs: create a template for all jobs 561/head
authorAlfredo Deza <adeza@redhat.com>
Tue, 22 Nov 2016 21:41:30 +0000 (16:41 -0500)
committerAlfredo Deza <adeza@redhat.com>
Tue, 22 Nov 2016 22:49:49 +0000 (17:49 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-ansible-prs/build/build [new file with mode: 0644]
ceph-ansible-prs/build/teardown [new file with mode: 0644]
ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml [new file with mode: 0644]

diff --git a/ceph-ansible-prs/build/build b/ceph-ansible-prs/build/build
new file mode 100644 (file)
index 0000000..45f6bed
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# the following two methods exist in scripts/build_utils.sh
+pkgs=( "tox" )
+install_python_packages "pkgs[@]"
+
+# XXX this might not be needed
+source $VENV/activate
+
+
+# the $SCENARIO var is injected by the job template. It maps
+# to an actual, defined, tox environment
+$VENV/tox -rv -e=$SCENARIO -- --provider=libvirt
diff --git a/ceph-ansible-prs/build/teardown b/ceph-ansible-prs/build/teardown
new file mode 100644 (file)
index 0000000..71026e6
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+# There has to be a better way to do this than this script which just looks
+# for every Vagrantfile in scenarios and then just destroys whatever is left.
+
+cd $WORKSPACE/tests
+
+scenarios=$(find . | grep Vagrantfile | xargs dirname)
+
+for scenario in $scenarios; do
+    cd $scenario
+    vagrant destroy -f
+    cd -
+done
diff --git a/ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml b/ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml
new file mode 100644 (file)
index 0000000..f6a5d17
--- /dev/null
@@ -0,0 +1,74 @@
+- project:
+    name: ceph-ansible-prs
+    scenario:
+      - ansible2.2-centos7-cluster
+      - ansible2.2-xenial-cluster
+    jobs:
+        - 'ceph-ansible-prs-{scenario}'
+
+
+- job-template:
+    name: 'ceph-ansible-prs-{scenario}'
+    node: vagrant&&ceph-ansible
+    concurrent: true
+    defaults: global
+    display-name: 'ceph-ansible: Pull Requests [{scenario}]'
+    quiet-period: 5
+    block-downstream: false
+    block-upstream: false
+    retry-count: 3
+    properties:
+      - github:
+          url: https://github.com/ceph/ceph-ansible
+    logrotate:
+      daysToKeep: 15
+      numToKeep: 30
+      artifactDaysToKeep: -1
+      artifactNumToKeep: -1
+
+    parameters:
+      - string:
+          name: sha1
+          description: "A pull request ID, like 'origin/pr/72/head'"
+
+    triggers:
+      - github-pull-request:
+          allow-whitelist-orgs-as-admins: true
+          org-list:
+            - ceph
+          trigger-phrase: 'jenkins test {scenario}'
+          only-trigger-phrase: false
+          github-hooks: true
+          permit-all: true
+          auto-close-on-fail: false
+          status-context: "Testing: {scenario}"
+          started-status: "Running: {scenario}"
+          success-status: "OK - {scenario}"
+          failure-status: "FAIL - {scenario}"
+
+    scm:
+      - git:
+          url: https://github.com/ceph/ceph-ansible.git
+          branches:
+            - ${{sha1}}
+          refspec: +refs/pull/*:refs/remotes/origin/pr/*
+          browser: auto
+          timeout: 20
+          skip-tag: true
+          wipe-workspace: false
+
+    builders:
+      - inject:
+          properties-content: |
+            SCENARIO={scenario}
+      - shell:
+          !include-raw-escape:
+            - ../../../scripts/build_utils.sh
+            - ../../build/build
+
+    publishers:
+      - postbuildscript:
+          script-only-if-succeeded: False
+          script-only-if-failed: True
+          builders:
+            - shell: !include-raw ../../build/teardown