Implementato buildfile yml.
This commit is contained in:
parent
b21d14324a
commit
42be51b82e
65
fresh.yml
Normal file
65
fresh.yml
Normal file
@ -0,0 +1,65 @@
|
||||
---
|
||||
data:
|
||||
storage: /srv/http/appimage.sys42.eu
|
||||
download: /var/tmp/downloads
|
||||
|
||||
builds:
|
||||
- query: fresh
|
||||
language: basic
|
||||
offline_help: no
|
||||
portable: no
|
||||
|
||||
- query: fresh
|
||||
language: basic
|
||||
offline_help: yes
|
||||
portable: no
|
||||
|
||||
- query: fresh
|
||||
language: basic
|
||||
offline_help: no
|
||||
portable: yes
|
||||
|
||||
- query: fresh
|
||||
language: basic
|
||||
offline_help: yes
|
||||
portable: yes
|
||||
|
||||
- query: fresh
|
||||
language: standard
|
||||
offline_help: no
|
||||
portable: no
|
||||
|
||||
- query: fresh
|
||||
language: standard
|
||||
offline_help: yes
|
||||
portable: no
|
||||
|
||||
- query: fresh
|
||||
language: standard
|
||||
offline_help: no
|
||||
portable: yes
|
||||
|
||||
- query: fresh
|
||||
language: standard
|
||||
offline_help: yes
|
||||
portable: yes
|
||||
|
||||
- query: fresh
|
||||
language: full
|
||||
offline_help: no
|
||||
portable: no
|
||||
|
||||
- query: fresh
|
||||
language: full
|
||||
offline_help: yes
|
||||
portable: no
|
||||
|
||||
- query: fresh
|
||||
language: full
|
||||
offline_help: no
|
||||
portable: yes
|
||||
|
||||
- query: fresh
|
||||
language: full
|
||||
offline_help: yes
|
||||
portable: yes
|
@ -2,6 +2,7 @@
|
||||
# encoding: utf-8
|
||||
|
||||
import click
|
||||
import yaml
|
||||
import loaih
|
||||
|
||||
@click.command()
|
||||
@ -22,6 +23,35 @@ def build(arch, language, offline, portable, updatable, download, storage, check
|
||||
else:
|
||||
arches = [ arch.lower().decode('utf-8') ]
|
||||
|
||||
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)
|
||||
|
||||
# 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'], [u'x86', u'x86_64'])
|
||||
|
||||
obj.language = build['language']
|
||||
obj.offline_help = build['offline_help']
|
||||
obj.portable = build['portable']
|
||||
obj.updatable = True
|
||||
|
||||
if check:
|
||||
obj.check(config['data']['storage'])
|
||||
else:
|
||||
obj.storage_path = config['data']['storage']
|
||||
|
||||
obj.download(config['data']['download'])
|
||||
obj.build()
|
||||
obj.checksums()
|
||||
obj.publish()
|
||||
del obj
|
||||
|
||||
else:
|
||||
obj = loaih.Build(query, arches)
|
||||
|
||||
obj.language = language
|
||||
|
Reference in New Issue
Block a user