From: Alfredo Deza Date: Tue, 22 Nov 2016 21:41:30 +0000 (-0500) Subject: ceph-ansible-prs: create a template for all jobs X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5672db8941f010ae47d76a885cfcd5560d0b1a6e;p=ceph-build.git ceph-ansible-prs: create a template for all jobs Signed-off-by: Alfredo Deza --- diff --git a/ceph-ansible-prs/build/build b/ceph-ansible-prs/build/build new file mode 100644 index 00000000..45f6bed4 --- /dev/null +++ b/ceph-ansible-prs/build/build @@ -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 index 00000000..71026e6b --- /dev/null +++ b/ceph-ansible-prs/build/teardown @@ -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 index 00000000..f6a5d179 --- /dev/null +++ b/ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml @@ -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