update owner-sync-pkgdb to support the docker namespace

update the script to sync from pkgdb to koji and enable it via a cronjob

Signed-off-by: Dennis Gilmore <ausil@fedoraproject.org>
This commit is contained in:
Dennis Gilmore 2016-11-02 22:32:55 +00:00
parent cd7007a091
commit 64e456c769
2 changed files with 20 additions and 7 deletions

View file

@ -188,6 +188,14 @@
cron_file=update-koji-owner-fedora
when: inventory_hostname.startswith('bodhi-backend03') and env == "production"
tags:
- name: sync packages from pkgdb2 to koji fedor (docker)
cron: name="owner-sync-fedora" minute="7,17,27,37,47,57" user="root"
job="/usr/local/bin/owner-sync-pkgdb f24-docker;/usr/local/bin/owner-sync-pkgdb f25-docker;/usr/local/bin/owner-sync-pkgdb f26-docker"
cron_file=update-koji-owner-fedora-docker
when: inventory_hostname.startswith('bodhi-backend03') and env == "production"
tags:
- bodhi
- bodhi
#
# cron job that syncs updates to master mirror

View file

@ -80,12 +80,17 @@ if __name__ == '__main__':
print "ERROR: no tag specified!\n"
usage()
if tag.startswith('epel'):
version = tag.split('epel')[1]
elif tag.startswith('f'):
version = tag.split('f')[1]
if 'docker' in tag:
namespace='docker'
version = tag.split('-')[0].split('f')[1]
else:
version = tag.split('-')[1][:-1]
namespace='rpms'
if tag.startswith('epel'):
version = tag.split('epel')[1]
elif tag.startswith('f'):
version = tag.split('f')[1]
else:
version = tag.split('-')[1][:-1]
data = requests.get(urljoin(BASEURL, 'api/collections'), verify=VERIFY).json()
branch_names = set()
@ -109,7 +114,7 @@ if __name__ == '__main__':
if version == rawhide:
reponame = 'master'
else:
reponame = tag
reponame = tag.split('-')[0]
{% if env == 'staging' %}
arches = ["primary"]
{% else %}
@ -120,7 +125,7 @@ if __name__ == '__main__':
sys.exit(1)
data = requests.get(urljoin(BASEURL, 'api/vcs?format=json'), verify=VERIFY).json()
acls = data['rpms']
acls = data[namespace]
pkgs = {}
for pkg_name in acls:
try: