ci: Allow DISTROS="debian*32" variable, and KEEP=1

issue510
David Wilson 6 years ago
parent fe745779ba
commit 8a4caea84f

@ -158,23 +158,37 @@ def make_containers():
firstbit = lambda s: (s+'-').split('-')[0] firstbit = lambda s: (s+'-').split('-')[0]
secondbit = lambda s: (s+'-').split('-')[1] secondbit = lambda s: (s+'-').split('-')[1]
return [ i = 1
{ lst = []
"distro": firstbit(distro),
"name": "target-%s-%s" % (distro, i), for distro in DISTROS:
"hostname": docker_hostname, distro, star, count = distro.rpartition('*')
"port": BASE_PORT + i, if star:
"python_path": ( count = int(count)
'/usr/bin/python3' else:
if secondbit(distro) == 'py3' count = 1
else '/usr/bin/python'
) for x in range(count):
} lst.append({
for i, distro in enumerate(DISTROS, 1) "distro": firstbit(distro),
] "name": "target-%s-%s" % (distro, i),
"hostname": docker_hostname,
"port": BASE_PORT + i,
"python_path": (
'/usr/bin/python3'
if secondbit(distro) == 'py3'
else '/usr/bin/python'
)
})
i += 1
return lst
def start_containers(containers): def start_containers(containers):
if os.environ.get('KEEP'):
return
run_batches([ run_batches([
[ [
"docker rm -f %(name)s || true" % container, "docker rm -f %(name)s || true" % container,

Loading…
Cancel
Save