From 1b1ed1b1fad3115c384a9543853416aa3882aa74 Mon Sep 17 00:00:00 2001 From: Scott Wittenburg Date: Sat, 12 Aug 2023 09:52:46 -0600 Subject: ci: continue to support SPACK_SIGNING_KEY (#39170) --- lib/spack/spack/cmd/ci.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/spack/spack/cmd/ci.py b/lib/spack/spack/cmd/ci.py index e55ca3fa8d..97a6a603c2 100644 --- a/lib/spack/spack/cmd/ci.py +++ b/lib/spack/spack/cmd/ci.py @@ -289,6 +289,10 @@ def ci_rebuild(args): rebuild_everything = os.environ.get("SPACK_REBUILD_EVERYTHING") require_signing = os.environ.get("SPACK_REQUIRE_SIGNING") + # If signing key was provided via "SPACK_SIGNING_KEY", then try to import it. + if signing_key: + spack_ci.import_signing_key(signing_key) + # Fail early if signing is required but we don't have a signing key sign_binaries = require_signing is not None and require_signing.lower() == "true" if sign_binaries and not spack_ci.can_sign_binaries(): @@ -418,11 +422,6 @@ def ci_rebuild(args): dst_file = os.path.join(repro_dir, file_name) shutil.copyfile(src_file, dst_file) - # If signing key was provided via "SPACK_SIGNING_KEY", then try to - # import it. - if signing_key: - spack_ci.import_signing_key(signing_key) - # Write this job's spec json into the reproduction directory, and it will # also be used in the generated "spack install" command to install the spec tty.debug("job concrete spec path: {0}".format(job_spec_json_path)) @@ -679,7 +678,7 @@ def ci_rebuild(args): input_spec=job_spec, buildcache_mirror_url=buildcache_mirror_url, pipeline_mirror_url=pipeline_mirror_url, - sign_binaries=sign_binaries, + sign_binaries=spack_ci.can_sign_binaries(), ): msg = tty.msg if result.success else tty.warn msg( -- cgit v1.2.3-60-g2f50