Now to rewrite the test framework and good to go !
This commit is contained in:
@@ -13,3 +13,6 @@ class Base:
|
||||
await script.umounts()
|
||||
await script.umount()
|
||||
proc = await script.exec('buildah', 'rm', script.ctr, raises=False)
|
||||
|
||||
def __repr__(self):
|
||||
return f'Base({self.base})'
|
||||
|
||||
@@ -18,7 +18,7 @@ CI_VARS = (
|
||||
class Commit:
|
||||
def __init__(self, repo, tags=None, format=None, push=None, registry=None):
|
||||
self.repo = repo
|
||||
self.registry = registry
|
||||
self.registry = registry or 'localhost'
|
||||
self.push = push or os.getenv('CI')
|
||||
|
||||
# figure out registry host
|
||||
@@ -81,19 +81,5 @@ class Commit:
|
||||
await script.exec('podman', 'push', f'{self.repo}:{tag}')
|
||||
await script.umount()
|
||||
|
||||
async def run(self, script):
|
||||
await script.exec(
|
||||
'podman', 'run', '-d',
|
||||
'--name', script.container.name,
|
||||
':'.join((self.repo, self.tags[0])),
|
||||
)
|
||||
|
||||
async def up(self, script):
|
||||
name = '-'.join([script.pod.name, script.container.name])
|
||||
try:
|
||||
await script.exec('podman', 'inspect', name)
|
||||
except WrongResult:
|
||||
await script.exec(
|
||||
'podman', 'run', '-d', '--name', name,
|
||||
':'.join((self.repo, self.tags[0])),
|
||||
)
|
||||
def __repr__(self):
|
||||
return f'Commit({self.registry}/{self.repo}:{self.tags})'
|
||||
|
||||
@@ -10,6 +10,9 @@ class DumbInit:
|
||||
def __init__(self, cmd):
|
||||
self.cmd = cmd
|
||||
|
||||
def post_build(self, script):
|
||||
async def post_build(self, script):
|
||||
cmd = '--cmd "dumb-init bash -euxc \'%s\'"' % self.cmd
|
||||
script.config(cmd)
|
||||
await script.config(cmd)
|
||||
|
||||
def __repr__(self):
|
||||
return f'DumbInit({self.cmd})'
|
||||
|
||||
@@ -150,3 +150,6 @@ class Packages:
|
||||
cache_lists = os.path.join(cachedir, 'lists')
|
||||
await script.mount(cache_lists, f'/var/lib/apt/lists')
|
||||
return cachedir
|
||||
|
||||
def __repr__(self):
|
||||
return f'Packages({self.packages})'
|
||||
|
||||
Reference in New Issue
Block a user