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