-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deb_autopkg: add building just all base images
Adding a new command repo-build-baseimage <cf> that builds all (missing) base images for the targets used in given repo config. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
- Loading branch information
Showing
5 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
# Copyright (C) Enrico Weigelt, metux IT consult <info@metux.net> | ||
|
||
from metux.util.task import Task | ||
from .target_rootfs import alloc as target_rootfs_alloc | ||
from .dckbp_clone import alloc as dckbp_clone_alloc | ||
|
||
""" Task: clone all package git repos""" | ||
class BaseimageAllTask(Task): | ||
|
||
def get_subtasks(self): | ||
conf = self.param['conf'] | ||
tasks = [ dckbp_clone_alloc(conf) ] | ||
|
||
for t in conf.get_targets(): | ||
tasks.append(target_rootfs_alloc(conf, t)) | ||
|
||
return tasks | ||
|
||
def alloc(conf): | ||
return conf.cached_task_alloc('baseimage-all', BaseimageAllTask, { 'conf': conf }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
# Copyright (C) Enrico Weigelt, metux IT consult <info@metux.net> | ||
|
||
from metux.util.task import Task | ||
from os import environ | ||
from copy import copy | ||
from subprocess import call | ||
|
||
"""build for apt (docker-buildpackage)""" | ||
class TargetBaseimageTask(Task): | ||
|
||
"""[private]""" | ||
def __init__(self, param): | ||
Task.__init__(self, param) | ||
self.target = param['target'] | ||
self.conf = param['conf'] | ||
|
||
def do_run(self): | ||
tgt = self.target | ||
|
||
env = copy(environ) | ||
|
||
self.log_info('building rootfs for target "%s"' % tgt['name']) | ||
|
||
if (call([self.conf.get_dckbp_cmd(), | ||
'--create-baseimage', | ||
'--target', | ||
self.target['dck-buildpackage::target']], | ||
env=env) != 0): | ||
self.fail("rootfs build failed: "+tgt['name']) | ||
|
||
return True | ||
|
||
def alloc(conf, target): | ||
return conf.cached_task_alloc('target-baseimage:'+target['name'], TargetBaseimageTask, { 'target': target }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env python3 | ||
import sys, deb_autopkg | ||
from deb_autopkg import cmd | ||
sys.exit(cmd.tool_repo_build_rootfs(sys.argv)) |