From: Alfredo Deza Date: Tue, 22 Dec 2015 20:10:55 +0000 (-0500) Subject: create a new ceph-pr commit check X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2d7baf985cd20fe2b4c4f10c3590e93487891a6a;p=ceph-build.git create a new ceph-pr commit check Signed-off-by: Alfredo Deza --- diff --git a/ceph-pr-commits/build/build b/ceph-pr-commits/build/build new file mode 100644 index 00000000..a4d9aecd --- /dev/null +++ b/ceph-pr-commits/build/build @@ -0,0 +1,27 @@ +#!/usr/bin/env python +from subprocess import Popen, PIPE +import os + +target_branch = os.getenv('ghprbTargetBranch', 'master') +source_branch = os.getenv('ghprbSourceBranch', 'HEAD') + +command = ['git', 'log', '%s..%s' % (target_branch, source_branch)] + + +process = Popen( + command, + stdout=PIPE, + stderr=PIPE, + close_fds=True +) + +returncode = process.wait() + +stdout = process.stdout.read() +stderr = process.stderr.read() + +# git log output goes to stdout so process that + +for chunk in stdout.split('commit '): # we are interested in every commit chunk + if not 'Signed-off-by:' in chunk: + raise SystemExit('A commit is missing "Signed-off-by"') diff --git a/ceph-pr-commits/config/definitions/ceph-pr-commits.yml b/ceph-pr-commits/config/definitions/ceph-pr-commits.yml new file mode 100644 index 00000000..5b962c92 --- /dev/null +++ b/ceph-pr-commits/config/definitions/ceph-pr-commits.yml @@ -0,0 +1,68 @@ +- job: + name: ceph-pr-commits + project-type: freestyle + defaults: global + display-name: 'ceph: Pull Request commits' + quiet-period: 5 + block-downstream: false + block-upstream: false + retry-count: 3 + properties: + - github: + url: https://github.com/ceph/ceph/ + 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: + admin-list: + - alfredodeza + - ktdreyer + - andrewschoen + - dmick + org-list: + - ceph + white-list: + - jcsp + - gregsfortytwo + - GregMeno + - dzafman + - dillaman + - dachary + - liewegas + - idryomov + - vasukulkarni + 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.git + branches: + - ${sha1} + refspec: +refs/pull/*:refs/remotes/origin/pr/* + browser: auto + timeout: 20 + skip-tag: true + wipe-workspace: true + + builders: + - shell: + !include-raw: ../../build/build + # NOTE: no publishing yet as we want to prevent errors in the + # new checks. Once this is robust enough we should uncomment + # to fully enable notifications. Maybe consider a comment on the + # Pull Request vs. a simple notification? + #publishers: + # - github-notifier