Skip to content

Commit

Permalink
Ensure compute packages also trigger compute repo update (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock authored Dec 12, 2023
1 parent d15b402 commit 31b939e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def release_packages(packages, host, path, pkey, force):
ssh.close()
return uploads

def update_repo(host, release, dist, arch, pkey):
def update_repo(host, release, dist, arch, release_type, pkey):
_pkey = paramiko.RSAKey.from_private_key_file(pkey)
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
Expand All @@ -57,7 +57,7 @@ def update_repo(host, release, dist, arch, pkey):
repo_update_dest = '/var/lib/oodpkg/repo-update.sh'
logger.info("SFTP %s -> oodpkg@%s:%s", repo_update_src, host, repo_update_dest)
sftp.put(repo_update_src, repo_update_dest)
repo_update_cmd = "/bin/bash %s -r %s -d %s -a %s" % (repo_update_dest, release, dist, arch)
repo_update_cmd = "/bin/bash %s -r %s -d %s -a %s -t %s" % (repo_update_dest, release, dist, arch, release_type)
logger.info("Executing via SSH oodpkg@%s '%s'", host, repo_update_cmd)
stdin, stdout, stderr = ssh.exec_command(repo_update_cmd)
out = stdout.read()
Expand Down Expand Up @@ -94,6 +94,11 @@ def main():
else:
build_release = ''

if args.config_section == 'compute':
release_type = 'compute'
else:
release_type = 'web'

if args.debug:
log_level = logging.DEBUG
else:
Expand Down Expand Up @@ -134,7 +139,7 @@ def main():
debs.append(p)
debs_released = release_packages(debs, host, pool_path, args.pkey, args.force)
if debs_released and update:
update_repo(host, release, deb, arch, args.pkey)
update_repo(host, release, deb, arch, release_type, args.pkey)
else:
rpm_path = config.get(args.config_section, 'rpm_path').replace('DIST', dist).replace('ARCH', arch).replace('RELEASE', build_release)
srpm_path = config.get(args.config_section, 'srpm_path').replace('DIST', dist).replace('RELEASE', build_release)
Expand All @@ -152,9 +157,9 @@ def main():
rpms_released = release_packages(rpms, host, rpm_path, args.pkey, args.force)
srpms_released = release_packages(srpms, host, srpm_path, args.pkey, args.force)
if rpms_released and update:
update_repo(host, release, dist, arch, args.pkey)
update_repo(host, release, dist, arch, release_type, args.pkey)
if srpms_released and update:
update_repo(host, release, dist, arch, args.pkey)
update_repo(host, release, dist, arch, release_type, args.pkey)

if __name__ == '__main__':
main()

0 comments on commit 31b939e

Please sign in to comment.