]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
create a new ceph-pr commit check
authorAlfredo Deza <adeza@redhat.com>
Tue, 22 Dec 2015 20:10:55 +0000 (15:10 -0500)
committerAlfredo Deza <adeza@redhat.com>
Wed, 23 Dec 2015 14:20:20 +0000 (09:20 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-pr-commits/build/build [new file with mode: 0644]
ceph-pr-commits/config/definitions/ceph-pr-commits.yml [new file with mode: 0644]

diff --git a/ceph-pr-commits/build/build b/ceph-pr-commits/build/build
new file mode 100644 (file)
index 0000000..a4d9aec
--- /dev/null
@@ -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 (file)
index 0000000..5b962c9
--- /dev/null
@@ -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