]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-volume-ansible-prs: create job template(s) 820/head
authorAlfredo Deza <adeza@redhat.com>
Tue, 8 Aug 2017 17:25:33 +0000 (13:25 -0400)
committerAlfredo Deza <adeza@redhat.com>
Tue, 8 Aug 2017 17:47:01 +0000 (13:47 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-volume-ansible-prs/build/build [new file with mode: 0644]
ceph-volume-ansible-prs/build/teardown [new file with mode: 0644]
ceph-volume-ansible-prs/config/definitions/ceph-volume-pr.yml [new file with mode: 0644]

diff --git a/ceph-volume-ansible-prs/build/build b/ceph-volume-ansible-prs/build/build
new file mode 100644 (file)
index 0000000..2f80410
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -ex
+
+# the following two methods exist in scripts/build_utils.sh
+pkgs=( "tox" )
+install_python_packages "pkgs[@]"
+
+# trims leading slashes
+BRANCH=`branch_slash_filter ${GIT_BRANCH}`
+SHA=$GIT_COMMIT
+
+
+cd src/ceph-volume/tests/functional
+CEPH_DEV_BRANCH=$BRANCH CEPH_DEV_SHA1=$SHA tox -vre $DISTRO-$SCENARIO
diff --git a/ceph-volume-ansible-prs/build/teardown b/ceph-volume-ansible-prs/build/teardown
new file mode 100644 (file)
index 0000000..44c8db4
--- /dev/null
@@ -0,0 +1,21 @@
+#!/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/src/ceph-volume/tests/functional
+
+scenarios=$(find . | grep Vagrantfile | xargs dirname)
+
+for scenario in $scenarios; do
+    cd $scenario
+    vagrant destroy -f
+    cd -
+done
+
+# Sometimes, networks may linger around, so we must ensure they are killed:
+networks=`sudo virsh net-list --all | grep active | egrep -v "(default|libvirt)" | cut -d ' ' -f 2`
+for network in $networks; do
+    sudo virsh net-destroy $network || true
+    sudo virsh net-undefine $network || true
+done
+
diff --git a/ceph-volume-ansible-prs/config/definitions/ceph-volume-pr.yml b/ceph-volume-ansible-prs/config/definitions/ceph-volume-pr.yml
new file mode 100644 (file)
index 0000000..eebcda0
--- /dev/null
@@ -0,0 +1,82 @@
+- project:
+    name: ceph-volume-ansible-prs
+    distro:
+      - xenial
+      - centos7
+    scenario:
+      - create
+      - prepare_activate
+
+    jobs:
+      - 'ceph-volume-prs-{distro}-{scenario}'
+
+
+- job-template:
+    name: 'ceph-volume-prs-{distro}-{scenario}'
+    display-name: 'ceph-volume: Pull Request [{distro}-{scenario}]'
+    node: vagrant&&libvirt
+    concurrent: true
+    project-type: freestyle
+    defaults: global
+    quiet-period: 5
+    block-downstream: false
+    block-upstream: false
+    properties:
+      - github:
+          url: https://github.com/ceph/ceph
+    discard-old-builds: true
+    logrotate:
+      daysToKeep: 30
+
+    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
+          only-trigger-phrase: true
+          trigger-phrase: 'jenkins test ceph-volume {distro}-{scenario}'
+          github-hooks: true
+          permit-all: true
+          auto-close-on-fail: false
+          status-context: "ceph-volume testing {distro}-{scenario}"
+          started-status: "ceph-volume running {distro}-{scenario}"
+          success-status: "ceph-volume {distro}-{scenario} OK"
+          failure-status: "ceph-volume {distro}-{scenario} failed"
+
+    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}
+            DISTRO={distro}
+      - shell:
+          !include-raw-escape:
+            - ../../../scripts/build_utils.sh
+            - ../../build/build
+
+    publishers:
+      - raw:
+          xml: |
+            <org.jenkinsci.plugins.ghprb.extensions.build.GhprbCancelBuildsOnUpdate>
+              <overrideGlobal>false</overrideGlobal>
+            </org.jenkinsci.plugins.ghprb.extensions.build.GhprbCancelBuildsOnUpdate>
+      - postbuildscript:
+          script-only-if-succeeded: False
+          script-only-if-failed: True
+          builders:
+            - shell: !include-raw ../../build/teardown