1
0

Implementato buildfile yml.

This commit is contained in:
Emiliano Vavassori 2022-03-30 01:36:27 +02:00
parent b21d14324a
commit 42be51b82e
2 changed files with 108 additions and 13 deletions

65
fresh.yml Normal file
View 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

View File

@ -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