aboutsummaryrefslogtreecommitdiffstats
path: root/tasks.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-02-19 20:13:03 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-02-19 20:13:03 -0600
commit5fa42e6d4f645070262107b25bae28055f055856 (patch)
tree95ab0f8524864891471d5f80c4b9c69ee9a5e326 /tasks.py
parenta1caeff390f0500c90e7b7ff1a9050778c714c67 (diff)
parenta1dff05cd4d88ba3fd2b3b87e1b1f5aea1075327 (diff)
downloadcryptography-5fa42e6d4f645070262107b25bae28055f055856.tar.gz
cryptography-5fa42e6d4f645070262107b25bae28055f055856.tar.bz2
cryptography-5fa42e6d4f645070262107b25bae28055f055856.zip
Merge pull request #645 from alex/windows-wheels
Wait for the wheel job to finish building the windows wheels. Refs #506
Diffstat (limited to 'tasks.py')
-rw-r--r--tasks.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/tasks.py b/tasks.py
index 5fa86986..8f398aad 100644
--- a/tasks.py
+++ b/tasks.py
@@ -13,13 +13,28 @@
from __future__ import absolute_import, division, print_function
import getpass
+import time
import invoke
import requests
-JENKINS_ROOT = "http://jenkins.cryptography.io"
+JENKINS_URL = "http://jenkins.cryptography.io/job/cryptography-wheel-builder"
+
+
+def wait_for_build_completed():
+ while True:
+ response = requests.get(
+ "{0}/lastBuild/api/json/".format(JENKINS_URL),
+ headers={
+ "Accept": "application/json",
+ }
+ )
+ response.raise_for_status()
+ if not response.json()["building"]:
+ break
+ time.sleep(0.1)
@invoke.task
@@ -35,10 +50,11 @@ def release(version):
token = getpass.getpass("Input the Jenkins token")
response = requests.post(
- "{0}/job/cryptography-wheel-builder/build".format(JENKINS_ROOT),
+ "{0}/build".format(JENKINS_URL),
params={
"token": token,
"cause": "Building wheels for {0}".format(version)
}
)
response.raise_for_status()
+ wait_for_build_completed()