From: Alfredo Deza Date: Mon, 17 Nov 2014 21:43:24 +0000 (-0500) Subject: create a ceph-build PR job X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e237920ea416c2ad53df4bbf966fcb1c862a94d4;p=ceph-build.git create a ceph-build PR job Signed-off-by: Alfredo Deza --- diff --git a/ceph-build-pull-requests/build/build b/ceph-build-pull-requests/build/build new file mode 100644 index 00000000..214a7b9a --- /dev/null +++ b/ceph-build-pull-requests/build/build @@ -0,0 +1,31 @@ +#!/bin/bash + +set -ex + +# Create the virtualenv +virtualenv venv +. venv/bin/activate + +# Define and ensure the PIP cache +PIP_SDIST_INDEX="$HOME/.cache/pip" +mkdir -p $PIP_SDIST_INDEX + +# Install the package by trying with the cache first, otherwise doing a download only, and then +# trying to install from the cache again. +if ! venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index jenkins-job-builder; then + venv/bin/pip install --download-directory="$PIP_SDIST_INDEX" jenkins-job-builder + venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index jenkins-job-builder +fi + + +# Test every definition if available in the current repository and update the jobs +# if they do define one (they should always define their definitions) +for dir in `find . -maxdepth 1 -path ./.git -prune -o -type d -print`; do + definitions_dir="$dir/config/definitions" + if [ -d "$definitions_dir" ]; then + echo "found definitions directory: $definitions_dir" + + # Test the definitions + venv/bin/jenkins-jobs test $definitions_dir -o /tmp/output + fi +done diff --git a/ceph-build-pull-requests/config/definitions/ceph-build-pull-requests.yml b/ceph-build-pull-requests/config/definitions/ceph-build-pull-requests.yml new file mode 100644 index 00000000..40fad551 --- /dev/null +++ b/ceph-build-pull-requests/config/definitions/ceph-build-pull-requests.yml @@ -0,0 +1,59 @@ +- job: + name: ceph-build-pull-requests + node: gitbuilder-cdep-deb-cloud-precise-amd64-basic + project-type: freestyle + defaults: global + disabled: false + display-name: 'ceph-build: Pull Requests' + concurrent: false + quiet-period: 5 + block-downstream: false + block-upstream: false + retry-count: 3 + properties: + - github: + url: https://github.com/ceph/ceph-build + logrotate: + daysToKeep: 15 + numToKeep: 30 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + + parameters: + - string: + name: sha1 + description: "A pull request ID, like 'origin/pr/72/head'" + + triggers: + - pollscm: "*/1 * * * *" + - github-pull-request: + cron: '* * * * *' + admin-list: + - alfredodeza + - ktdreyer + org-list: + - ceph + trigger-phrase: '' + only-trigger-phrase: false + github-hooks: true + permit-all: false + auto-close-on-fail: false + + scm: + - git: + url: https://github.com/ceph/ceph-build.git + branches: + - ${sha1} + refspec: +refs/pull/*:refs/remotes/origin/pr/* + browser: githubweb + browser-url: https://github.com/ceph/ceph-build + timeout: 20 + skip-tag: true + wipe-workspace: false + + builders: + - shell: + !include-raw ../../build/build + + publishers: + - github-notifier