changes loop and worker
This commit is contained in:
parent
85fa3817cd
commit
48c2499cb2
|
@ -61,12 +61,16 @@ def list_jobs(directory=".buildbot"):
|
||||||
results = []
|
results = []
|
||||||
files = ["Dockerfile", "build.sh", "test.sh"]
|
files = ["Dockerfile", "build.sh", "test.sh"]
|
||||||
for item in listdir(directory):
|
for item in listdir(directory):
|
||||||
|
flag = False
|
||||||
for file in files:
|
for file in files:
|
||||||
filepath = join(directory, item, file)
|
filepath = join(directory, item, file)
|
||||||
if islink(filepath) and not exists(filepath):
|
if islink(filepath) or not isfile(filepath):
|
||||||
continue
|
flag = True
|
||||||
if exists(join(directory, item, 'Dockerfile')) or exists(join(directory, item, 'build.sh')) or exists(join(directory, item, 'test.sh')):
|
break
|
||||||
results.append(filepath)
|
if flag:
|
||||||
|
continue
|
||||||
|
if (exists(join(directory, item, 'Dockerfile')) and exists(join(directory, item, 'build.sh'))) or exists(join(directory, item, 'test.sh')):
|
||||||
|
results.append(item)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,7 +86,7 @@ def _get_dockerfile_contents(jobname):
|
||||||
res = ""
|
res = ""
|
||||||
inside_allowed_command = False
|
inside_allowed_command = False
|
||||||
for line in contents:
|
for line in contents:
|
||||||
if re.match(r"(?m)^(FROM|RUN).*$", line):
|
if re.match(r"(?m)^(FROM|RUN|ENV).*$", line):
|
||||||
inside_allowed_command = True
|
inside_allowed_command = True
|
||||||
if inside_allowed_command:
|
if inside_allowed_command:
|
||||||
res += line
|
res += line
|
||||||
|
|
|
@ -19,6 +19,9 @@ from buildbot.plugins import steps, util
|
||||||
from .lib.renderers import *
|
from .lib.renderers import *
|
||||||
|
|
||||||
|
|
||||||
|
os_codename='bionic'
|
||||||
|
|
||||||
|
|
||||||
def find_artifacts(directory="out"):
|
def find_artifacts(directory="out"):
|
||||||
"""
|
"""
|
||||||
find artifacts (any file) in a directory
|
find artifacts (any file) in a directory
|
||||||
|
@ -43,18 +46,17 @@ def add_parent_step(build_factory):
|
||||||
name="download worker",
|
name="download worker",
|
||||||
command=["wget", "-O", "https://git.bitmessage.org/Bitmessage/buildbot_multibuild/raw/branch/master/lib/worker_multibuild.py", join(getenv['HOME'], '.local/bin/worker_multibuild.py')]
|
command=["wget", "-O", "https://git.bitmessage.org/Bitmessage/buildbot_multibuild/raw/branch/master/lib/worker_multibuild.py", join(getenv['HOME'], '.local/bin/worker_multibuild.py')]
|
||||||
))
|
))
|
||||||
|
|
||||||
build_factory.addStep(
|
build_factory.addStep(
|
||||||
steps.ShellCommand(
|
steps.ShellCommand(
|
||||||
name="Execute worker script",
|
name="Execute worker script",
|
||||||
command=[
|
command=[
|
||||||
"python3",
|
"python3",
|
||||||
join(getenv['HOME'], '.local/bin/worker_multibuild.py'),
|
join(getenv['HOME'], '.local/bin/worker_multibuild.py'),
|
||||||
util.Interpolate("%(prop:jobname)s"),
|
|
||||||
util.Property('repository'),
|
util.Property('repository'),
|
||||||
util.Property('branch'),
|
util.Property('branch'),
|
||||||
"https://buildbot.bitmessage.org",
|
util.getURLForBuild(util, util.Property("builderid"), util.Property("buildnumber")),
|
||||||
util.Interpolate("%(prop:os_codename)s"),
|
os_codename,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue