Commit con funzionalità di firma complete.
This commit is contained in:
parent
2c60de03cb
commit
544d805b50
2 changed files with 89 additions and 36 deletions
|
@ -2,6 +2,7 @@
|
|||
# encoding: utf-8
|
||||
|
||||
import click
|
||||
import yaml
|
||||
import loaih
|
||||
|
||||
@click.command()
|
||||
|
@ -12,7 +13,7 @@ import loaih
|
|||
@click.option('-o/-O', '--offline-help/--no-offline-help', 'offline', default = False, help="Include or not the offline help for the chosen languages. Default: no offline help")
|
||||
@click.option('-p/-P', '--portable/--no-portable', 'portable', default = False, help="Create a portable version of the AppImage or not. Default: no portable")
|
||||
@click.option('-r', '--repo-path', 'repo_path', default = '/srv/http/appimage.sys42.eu', type=str, help="Path to the final storage of the AppImage. Default: /srv/http/appimage.sys42.eu")
|
||||
@click.option('-s/-S', '--sign/--no-sign', 'sign', default=False, help="Whether to sign the build. Default: no-sign")
|
||||
@click.option('-s/-S', '--sign/--no-sign', 'sign', default=False, help="Wether to sign the build. Default: no-sign")
|
||||
@click.option('-u/-U', '--updatable/--no-updatable', 'updatable', default = True, help="Create an updatable version of the AppImage or not. Default: updatable")
|
||||
@click.argument('query')
|
||||
def build(arch, language, offline, portable, updatable, download_path, repo_path, check, sign, query):
|
||||
|
@ -24,23 +25,60 @@ def build(arch, language, offline, portable, updatable, download_path, repo_path
|
|||
else:
|
||||
arches = [ arch.lower() ]
|
||||
|
||||
obj = loaih.Build(query, arches)
|
||||
if query.endswith('.yml') or query.endswith('.yaml'):
|
||||
# This is a buildfile. So we have to load the file and pass the build options ourselves.
|
||||
config = {}
|
||||
with open(query, 'r') as file:
|
||||
config = yaml.safe_load(file)
|
||||
|
||||
obj.language = language
|
||||
obj.offline_help = offline
|
||||
obj.portable = portable
|
||||
obj.updatable = updatable
|
||||
# With the config file, we ignore all the command line options and set
|
||||
# generic default.
|
||||
for build in config['builds']:
|
||||
# Loop a run for each build.
|
||||
obj = loaih.Build(build['query'], arches)
|
||||
|
||||
obj.language = build['language']
|
||||
obj.offline_help = build['offline_help']
|
||||
obj.portable = build['portable']
|
||||
obj.updatable = True
|
||||
|
||||
if 'sign' in config['data'] and config['data']['sign']:
|
||||
obj.sign = True
|
||||
|
||||
if 'force' in config['data'] and config['data']['force']:
|
||||
obj.storage_path = config['data']['repo']
|
||||
obj.version_strings()
|
||||
else:
|
||||
obj.check(config['data']['repo'])
|
||||
|
||||
obj.download(config['data']['download'])
|
||||
obj.build()
|
||||
obj.checksums()
|
||||
obj.publish()
|
||||
del obj
|
||||
|
||||
if check:
|
||||
obj.check(repo_path)
|
||||
else:
|
||||
obj.storage_path = repo_path
|
||||
obj = loaih.Build(query, arches)
|
||||
|
||||
obj.download(download_path)
|
||||
obj.build()
|
||||
obj.checksums()
|
||||
obj.publish()
|
||||
del obj
|
||||
obj.language = language
|
||||
obj.offline_help = offline
|
||||
obj.portable = portable
|
||||
obj.updatable = updatable
|
||||
|
||||
if sign:
|
||||
obj.sign = True
|
||||
|
||||
if check:
|
||||
obj.check(repo_path)
|
||||
else:
|
||||
obj.storage_path = repo_path
|
||||
obj.version_strings()
|
||||
|
||||
obj.download(download_path)
|
||||
obj.build()
|
||||
obj.checksums()
|
||||
obj.publish()
|
||||
del obj
|
||||
|
||||
if __name__ == '__main__':
|
||||
build()
|
||||
|
|
Reference in a new issue