Skip to content

Commit

Permalink
config: add BASE_CONTAINER option
Browse files Browse the repository at this point in the history
Downstream project may use different images or container registries.

Signed-off-by: Paul Spooren <mail@aparcar.org>
  • Loading branch information
aparcar committed Feb 21, 2024
1 parent 6f634f8 commit 1ec8354
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions asu/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def api_v1_build_post():
req["branch_data"] = current_app.config["BRANCHES"][req["branch"]]
req["repository_allow_list"] = current_app.config["REPOSITORY_ALLOW_LIST"]
req["request_hash"] = request_hash
req["base_container"] = current_app.config["BASE_CONTAINER"]

job = get_queue().enqueue(
build,
Expand Down
1 change: 1 addition & 0 deletions asu/asu.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def create_app(test_config: dict = None) -> Flask:
BRANCHES_FILE=getenv("BRANCHES_FILE"),
MAX_CUSTOM_ROOTFS_SIZE_MB=100,
REPOSITORY_ALLOW_LIST=[],
BASE_CONTAINER="ghcr.io/openwrt/imagebuilder",
)

if not test_config:
Expand Down
3 changes: 1 addition & 2 deletions asu/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ def build(req: dict, job=None):
f"Container version: {container_version_tag} (requested {req['version']})"
)

BASE_CONTAINER = "ghcr.io/openwrt/imagebuilder"
image = (
f"{BASE_CONTAINER}:{req['target'].replace('/', '-')}-{container_version_tag}"
f"{req['base_container']}:{req['target'].replace('/', '-')}-{container_version_tag}"
)

log.info(f"Pulling {image}...")
Expand Down
3 changes: 3 additions & 0 deletions misc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@
# token used to trigger an update of targets
# if an empty string is set, the update happens periodically
UPDATE_TOKEN=""

# base container for the imagebuilder
# BASE_CONTAINER = "ghcr.io/openwrt/imagebuilder"

0 comments on commit 1ec8354

Please sign in to comment.