Commit 3d069954 authored by Markus Frosch's avatar Markus Frosch

upload: Add repo and architecture parameters

parent 50bde0b5
Pipeline #3237 passed with stage
in 18 seconds
......@@ -81,17 +81,22 @@ def aptly_url(url):
parser = argparse.ArgumentParser(description='Uploading build results to an Aptly server')
parser.add_argument('--server', help='APTLY API service to talk to (e.g. http://127.0.0.1:8080/api)',
default=os.environ.get('APTLY_SERVER'))
default=os.environ.get('APTLY_SERVER'), metavar='APTLY_SERVER')
parser.add_argument('--username', help='APTLY API username',
default=os.environ.get('APTLY_USERNAME'))
default=os.environ.get('APTLY_USERNAME'), metavar='APTLY_USERNAME')
parser.add_argument('--password', help='APTLY API password',
default=os.environ.get('APTLY_PASSWORD'))
default=os.environ.get('APTLY_PASSWORD'), metavar='APTLY_PASSWORD')
parser.add_argument('--result', metavar='path',
default='build/', help='Build result to upload')
parser.add_argument('--target', metavar='target', required=True,
help='Repository to install the package to (e.g. stack/dev/epel or stack/dev/ubuntu)')
help='Repository to install the package to (e.g. stack/dev/epel or stack/dev/ubuntu)')
parser.add_argument('--release', metavar='release', required=True,
help='Version of the repository to install to (e.g. 7 or icinga-xenial)')
help='Version of the repository to install to (e.g. 7 or icinga-xenial)')
parser.add_argument('--repo', metavar='repo',
help='Specific repository name in aptly')
parser.add_argument('--architectures', metavar='list',
help=('Specify list of architectures to publish the repo with,'
'separated by comma (e.g. amd64,i386 or armhf)'))
parser.add_argument('--insecure', action='store_true', help='Disable SSL verification')
args = parser.parse_args()
......@@ -133,6 +138,11 @@ upload_meta = {
'checksums': checksums,
}
if args.repo:
upload_meta['repo'] = args.repo
if args.architectures:
upload_meta['architectures'] = re.split(r'\s*,\s*', args.architectures)
# uploading files
upload_url = aptly_url('/files/' + upload_name)
print "Uploading %d files to %s" % (len(files), upload_name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment