summaryrefslogtreecommitdiffstats
path: root/deployment
diff options
context:
space:
mode:
authorClementTsang <cjhtsang@uwaterloo.ca>2020-08-22 23:32:28 -0400
committerClementTsang <cjhtsang@uwaterloo.ca>2020-08-22 23:32:28 -0400
commit5e0ab22645dc8d0828a3e758acda87c03ed4104d (patch)
tree0d37fcb498a5ada500ff06519c75cab96f161b9e /deployment
parent397a7e846726ee0dca4047d3033567274d563e98 (diff)
ci: fix some bugs...
Diffstat (limited to 'deployment')
-rw-r--r--deployment/packager.py2
-rw-r--r--deployment/windows/choco/choco_packager.py12
2 files changed, 9 insertions, 5 deletions
diff --git a/deployment/packager.py b/deployment/packager.py
index ec167675..ef49a84f 100644
--- a/deployment/packager.py
+++ b/deployment/packager.py
@@ -29,7 +29,7 @@ with open(deployment_file_path, "rb") as deployment_file:
print('Unsupported hash format "%s". Please use SHA512, SHA256, or SHA1.', hash_type)
exit(1)
- print("Generated hash: ", deployment_hash)
+ print("Generated hash: %s" % str(deployment_hash))
with open(template_file_path, "r") as template_file:
template = Template(template_file.read())
diff --git a/deployment/windows/choco/choco_packager.py b/deployment/windows/choco/choco_packager.py
index 0d4431a0..f791cf2d 100644
--- a/deployment/windows/choco/choco_packager.py
+++ b/deployment/windows/choco/choco_packager.py
@@ -10,11 +10,15 @@ args = sys.argv
deployment_file_path_32 = args[1]
deployment_file_path_64 = args[2]
version = args[3]
+nuspec_template = args[4]
+ps1_template = args[5]
print("Generating Chocolatey package for:")
print(" 32-bit: %s", deployment_file_path_32)
print(" 64-bit: %s", deployment_file_path_64)
print(" VERSION: %s" % version)
+print(" NUSPEC TEMPLATE: %s" % nuspec_template)
+print(" PS1 TEMPLATE: %s" % ps1_template)
with open(deployment_file_path_32, "rb") as deployment_file_32, open(
deployment_file_path_64, "rb"
@@ -22,10 +26,10 @@ with open(deployment_file_path_32, "rb") as deployment_file_32, open(
hash_32 = hashlib.sha1(deployment_file_32.read()).hexdigest()
hash_64 = hashlib.sha1(deployment_file_64.read()).hexdigest()
- print("Generated 32 hash: ", hash_32)
- print("Generated 64 hash: ", hash_64)
+ print("Generated 32 hash: %s" % str(hash_32))
+ print("Generated 64 hash: %s" % str(hash_64))
- with open("./bottom.nuspec.template", "r") as template_file:
+ with open(nuspec_template, "r") as template_file:
template = Template(template_file.read())
substitute = template.safe_substitute(version=version)
print("\n================== Generated nuspec file ==================\n")
@@ -36,7 +40,7 @@ with open(deployment_file_path_32, "rb") as deployment_file_32, open(
generated_file.write(substitute)
os.makedirs("tools")
- with open("./chocolateyinstall.ps1.template", "r") as template_file:
+ with open(ps1_template, "r") as template_file:
template = Template(template_file.read())
substitute = template.safe_substitute(version=version, hash_32=hash_32, hash_64=hash_64)
print("\n================== Generated chocolateyinstall file ==================\n")