|
| 1 | +import click, os, shutil |
| 2 | +from . import cli, echo_error, get_config,utils |
| 3 | + |
| 4 | + |
| 5 | +@cli.command(context_settings={"ignore_unknown_options": True}) |
| 6 | +@click.argument("name", default='develop') |
| 7 | +@click.argument("additional_args", nargs=-1) |
| 8 | +def release(name, additional_args): |
| 9 | + """create a release build""" |
| 10 | + |
| 11 | + utils.echo_info("building started...") |
| 12 | + projectConfig = get_config() |
| 13 | + |
| 14 | + if name not in projectConfig: |
| 15 | + echo_error(f"{name} is not a valid config name.") |
| 16 | + return |
| 17 | + |
| 18 | + conf = projectConfig["default"].copy() |
| 19 | + conf.update(projectConfig[name]) |
| 20 | + |
| 21 | + #get pyodide 0.19. Enforce pyodide |
| 22 | + if not conf.get("pyodide"): |
| 23 | + pyodide_version = "v0.19.0" |
| 24 | + else: |
| 25 | + pyodide_version = conf.get("pyodide") |
| 26 | + |
| 27 | + os.system(f'get-pyodide -t {conf["distribution_folder"]}/pyodide -v {pyodide_version}') |
| 28 | + |
| 29 | + #build all flare apps |
| 30 | + if conf.get("flare"): |
| 31 | + if "debug" in additional_args: |
| 32 | + flare_build_type = "debug" |
| 33 | + else: |
| 34 | + flare_build_type = "release" |
| 35 | + |
| 36 | + for name,flare in conf["flare"].items(): |
| 37 | + os.system(f'viur flare {flare_build_type} {name}') |
| 38 | + |
| 39 | + #build all other apps and assets |
| 40 | + os.system('viur npm') |
| 41 | + utils.echo_info("building finished!") |
| 42 | + |
| 43 | + |
| 44 | + |
0 commit comments