Skip to content

Commit

Permalink
Merge pull request ome#316 from jburel/jenkins
Browse files Browse the repository at this point in the history
handle variable
  • Loading branch information
jburel authored Feb 22, 2022
2 parents 14b4ae3 + 445b873 commit 3e8e536
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def get_blitz_location():
url_key = "versions.omero-blitz-url"

# detect if in Jenkins or not
if "JENKINS_URL" in os.environ:
if "ZIP_FILE" in os.environ:
config_blitz_url = os.environ.get("ZIP_FILE")
elif "JENKINS_URL" in os.environ:
config_blitz_url = os.environ.get("JENKINS_URL")
config_blitz_url += "job/OMERO-build-build/lastSuccessfulBuild/"
config_blitz_url += "artifact/omero-blitz/build/distributions/"
Expand All @@ -82,17 +84,20 @@ def get_blitz_location():

# replace VERSION in the final url and return
config_blitz_url = config_blitz_url.replace(
"VERSION", config_blitz_version)
"VERSION", config_blitz_version)
return config_blitz_url


def download_blitz_target():
loc = get_blitz_location()
print("Downloading %s ..." % loc, file=sys.stderr)
resp = urlopen(loc)
content = resp.read()
content = BytesIO(content)
zipfile = ZipFile(content)
if "ZIP_FILE" in os.environ:
zipfile = ZipFile(loc)
else:
print("Downloading %s ..." % loc, file=sys.stderr)
resp = urlopen(loc)
content = resp.read()
content = BytesIO(content)
zipfile = ZipFile(content)
zipfile.extractall("target")


Expand Down

0 comments on commit 3e8e536

Please sign in to comment.