aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-02-19 16:44:06 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-02-19 16:44:06 -0800
commita1dff05cd4d88ba3fd2b3b87e1b1f5aea1075327 (patch)
tree95ab0f8524864891471d5f80c4b9c69ee9a5e326
parenta1caeff390f0500c90e7b7ff1a9050778c714c67 (diff)
downloadcryptography-a1dff05cd4d88ba3fd2b3b87e1b1f5aea1075327.tar.gz
cryptography-a1dff05cd4d88ba3fd2b3b87e1b1f5aea1075327.tar.bz2
cryptography-a1dff05cd4d88ba3fd2b3b87e1b1f5aea1075327.zip
Wait for the wheel job to finish building the windows wheels. Refs #506
-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()