]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-volume-pr: adds functionality to trigger tox testing manually
authorAndrew Schoen <aschoen@redhat.com>
Tue, 6 Mar 2018 18:17:20 +0000 (12:17 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 6 Mar 2018 18:17:20 +0000 (12:17 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
ceph-volume-pr/build/build
ceph-volume-pr/build/teardown [new file with mode: 0644]
ceph-volume-pr/config/definitions/ceph-volume-pr.yml

index a80c15359778b91371b3d1ae3519235591701d62..bd9bfdc9560fe869dd4a96e7b6cefbd1af44dc5b 100644 (file)
@@ -1,12 +1,21 @@
 #!/bin/bash
 set -ex
 
+# set up variables needed for
+# githubstatus to report back to the github PR
+# if this project was started manually
+github_status_setup
+
 # the following two methods exist in scripts/build_utils.sh
-pkgs=( "tox" )
+pkgs=( "tox" "github-status>0.0.3")
 install_python_packages "pkgs[@]"
 
 cd src/ceph-volume
 
+GITHUB_STATUS_STATE="pending" $VENV/github-status create
+
 # ceph-volume has a 3.6 environ but most machines don't have it,
 # so until then, we do them piecemeal
 $VENV/tox -v -e py27,py35,flake8
+
+GITHUB_STATUS_STATE="success" $VENV/github-status create
diff --git a/ceph-volume-pr/build/teardown b/ceph-volume-pr/build/teardown
new file mode 100644 (file)
index 0000000..057f0e9
--- /dev/null
@@ -0,0 +1,9 @@
+#!/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.
+
+# the following two methods exist in scripts/build_utils.sh
+pkgs=( "github-status>0.0.3" )
+install_python_packages "pkgs[@]"
+
+GITHUB_STATUS_STATE="failure" $VENV/github-status create
index 54684e550852937d22c121d564053d76f1b140f1..b1a4449c772d16c2e6b647f8833e2e9ba943c552 100644 (file)
     logrotate:
       daysToKeep: 14
 
+    parameters:
+      - string:
+          name: sha1
+          description: "A pull request ID, like 'origin/pr/72/head'"
+
+      # this is injected by the ghprb plugin, and is fully optional but may help in manually triggering
+      # a job that can end up updating a PR
+      - string:
+          name: ghprbSourceBranch
+          description: "When manually triggered, and the remote PR isn't a branch in the ceph.git repo This can be specified to determine the actual branch."
+      - string:
+          name: GITHUB_SHA
+          description: "The tip (last commit) in the PR, a sha1 like 7d787849556788961155534039886aedfcdb2a88 (if set, will report status to Github)"
+
     triggers:
       - github-pull-request:
           cancel-builds-on-update: true
           wipe-workspace: true
 
     builders:
+      - inject:
+          properties-content: |
+            GITHUB_REPOSITORY="ceph/ceph"
+            GITHUB_STATUS_CONTEXT="ceph-volume tox tests"
+            GITHUB_STATUS_STARTED="running"
+            GITHUB_STATUS_SUCCESS="OK"
+            GITHUB_STATUS_FAILURE="failed"
+            GITHUB_STATUS_ERROR="completed with errors"
       - shell:
           !include-raw:
             - ../../../scripts/build_utils.sh
             - ../../build/build
+
+    wrappers:
+      - inject-passwords:
+          global: true
+          mask-password-params: true
+
+    publishers:
+      - postbuildscript:
+          script-only-if-succeeded: False
+          script-only-if-failed: True
+          builders:
+            - shell:
+                !include-raw-escape:
+                  - ../../../scripts/build_utils.sh
+                  - ../../build/teardown