Skip to content

Commit 8d50032

Browse files
authored
Merge pull request #352 from trz42/fix_artefact_use
fix handling of artefact name
2 parents 9c6a4ac + c203048 commit 8d50032

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

tasks/deploy.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,14 @@ def append_artefact_to_upload_log(artefact, job_dir):
236236
upload_log.write(f"{job_plus_artefact}\n")
237237

238238

239-
def upload_artefact(job_dir, payload, timestamp, repo_name, pr_number, pr_comment_id):
239+
def upload_artefact(job_dir, artefact, timestamp, repo_name, pr_number, pr_comment_id):
240240
"""
241241
Upload artefact to an S3 bucket.
242242
243243
Args:
244244
job_dir (string): path to the job directory
245-
payload (string): can be any name describing the payload, e.g., for
246-
EESSI it could have the format eessi-VERSION-COMPONENT-OS-ARCH
245+
artefact (string): can be any filename that contains the payload, e.g., for
246+
EESSI it could have the format eessi-VERSION-COMPONENT-OS-ARCH-TIMESTAMP.tar.zstd
247247
timestamp (int): timestamp of the artefact
248248
repo_name (string): repository of the pull request
249249
pr_number (int): number of the pull request
@@ -254,7 +254,6 @@ def upload_artefact(job_dir, payload, timestamp, repo_name, pr_number, pr_commen
254254
"""
255255
funcname = sys._getframe().f_code.co_name
256256

257-
artefact = f"{payload}-{timestamp}.tar.gz"
258257
abs_path = os.path.join(job_dir, artefact)
259258
log(f"{funcname}(): uploading '{abs_path}'")
260259

@@ -581,9 +580,9 @@ def determine_artefacts_to_deploy(successes, upload_policy):
581580
f"{indent_fname}has been uploaded through '{uploaded}'")
582581

583582
if deploy:
584-
to_be_deployed[payload] = {"job_dir": job["job_dir"],
585-
"pr_comment_id": job["pr_comment_id"],
586-
"timestamp": timestamp}
583+
to_be_deployed[artefact] = {"job_dir": job["job_dir"],
584+
"pr_comment_id": job["pr_comment_id"],
585+
"timestamp": timestamp}
587586

588587
return to_be_deployed
589588

@@ -650,8 +649,8 @@ def deploy_built_artefacts(pr, event_info):
650649
# 4) call function to deploy a single artefact per software subdir
651650
repo_name = pr.base.repo.full_name
652651

653-
for payload, job in to_be_deployed.items():
652+
for artefact, job in to_be_deployed.items():
654653
job_dir = job['job_dir']
655654
timestamp = job['timestamp']
656655
pr_comment_id = job['pr_comment_id']
657-
upload_artefact(job_dir, payload, timestamp, repo_name, pr.number, pr_comment_id)
656+
upload_artefact(job_dir, artefact, timestamp, repo_name, pr.number, pr_comment_id)

0 commit comments

Comments
 (0)