in tools/build-release.py [0:0]
def call_helm(staging_dir, base_path, version, email_address):
cmd = shutil.which("helm")
if not cmd:
print("helm not found on the path, not creating package")
return
release_helm_path = os.path.join(base_path, "helm-charts/yunikorn")
command = [cmd, 'package']
if email_address:
secring = os.path.expanduser('~/.gnupg/secring.gpg')
if os.path.isfile(secring):
print("Packaging helm chart, signed with: %s" % email_address)
command.extend(['--sign', '--key', email_address, '--keyring', secring])
else:
print("Packing helm chart (unsigned)\nFile with pre gpg2 keys not found, expecting: %s" % secring)
email_address = None
else:
print("Packaging helm chart (unsigned)")
command.extend([release_helm_path, '--destination', staging_dir])
retcode = subprocess.call(command)
if retcode:
fail("helm chart creation failed")
if not email_address:
helm_package = "yunikorn-" + version + ".tgz"
helm_pack_path = os.path.join(staging_dir, helm_package)
h = hashlib.sha256()
# read the file and generate the sha
with open(helm_pack_path, 'rb') as file:
while True:
data = file.read(65536)
if not data:
break
h.update(data)
print("Helm package digest: %s %s\n" % (h.hexdigest(), helm_package))