From: Alfredo Deza Date: Tue, 8 Aug 2017 17:25:33 +0000 (-0400) Subject: ceph-volume-ansible-prs: create job template(s) X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=de3e8144b93a244b1c07eb803b7dc8c569881d01;p=ceph-build.git ceph-volume-ansible-prs: create job template(s) Signed-off-by: Alfredo Deza --- diff --git a/ceph-volume-ansible-prs/build/build b/ceph-volume-ansible-prs/build/build new file mode 100644 index 00000000..2f80410c --- /dev/null +++ b/ceph-volume-ansible-prs/build/build @@ -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 index 00000000..44c8db49 --- /dev/null +++ b/ceph-volume-ansible-prs/build/teardown @@ -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 index 00000000..eebcda02 --- /dev/null +++ b/ceph-volume-ansible-prs/config/definitions/ceph-volume-pr.yml @@ -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: | + + false + + - postbuildscript: + script-only-if-succeeded: False + script-only-if-failed: True + builders: + - shell: !include-raw ../../build/teardown