chenges for dockerfile and oscodename

This commit is contained in:
Muzahid 2022-02-22 21:15:15 +05:30
parent d354d031d9
commit ca943c6864
Signed by: cis-muzahid
GPG Key ID: 1DC85E7D3AB613EA
2 changed files with 15 additions and 18 deletions

View File

@ -15,8 +15,8 @@ request_headers = {
ty = "/change_hook/base"
path =".buildbot"
dockerfile_extra_contents_focal = """
dockerfile_extra_contents = {}
dockerfile_extra_contents['focal'] = """
# Buildbot
RUN apt-get install -yq --no-install-suggests --no-install-recommends \
@ -35,7 +35,7 @@ ENTRYPOINT /usr/local/bin/buildbot_entrypoint.sh "$BUILDMASTER" "$WORKERNAME" "$
"""
dockerfile_extra_contents_bionic = """
dockerfile_extra_contents['bionic'] = """
# Buildbot
RUN apt-get install -yq --no-install-suggests --no-install-recommends \
@ -69,7 +69,7 @@ def list_jobs(directory=".buildbot"):
return results
def _get_dockerfile_contents(jobname, os_codename):
def _get_dockerfile_contents(jobname, os_codename='bionic'):
"""
Read contents of a Dockerfile and add extra contents for the given os_codename
"""
@ -78,10 +78,7 @@ def _get_dockerfile_contents(jobname, os_codename):
# remove any line containing FROM or RUN keywords
re.match(r"(?m)^(FROM|RUN).*$", "", contents)
return contents + {
"focal": dockerfile_extra_contents_focal,
"bionic": dockerfile_extra_contents_bionic,
}[os_codename]
return contents + dockerfile_extra_contents[os_codename]
def trigger_child_hooks(buildbotUrl: str, os_codename: str, repository, branch, jobname, directory=".buildbot", is_build_script_available, is_test_script_available):

View File

@ -29,9 +29,9 @@ def find_artifacts(directory="out"):
return join(directory, _)
@util.renderer
def get_dockerfile_contents(props):
return _get_dockerfile_contents(props.getProperty('jobname', default=None), util.Interpolate("%(prop:os_codename)s"))
# @util.renderer
# def get_dockerfile_contents(props):
# return _get_dockerfile_contents(props.getProperty('jobname', default=None), util.Interpolate("%(prop:os_codename)s"))
def add_parent_step(build_factory):
@ -44,13 +44,13 @@ def add_parent_step(build_factory):
command=["sudo", "wget", "-O", "https://git.bitmessage.org/Bitmessage/buildbot_multibuild/raw/branch/master/lib/worker_multibuild.py", "worker_multibuild.py"]
))
build_factory.addStep(
steps.SetPropertyFromCommand(
name="Get OS codename",
command="grep ^VERSION_CODENAME= /etc/os-release | cut -d= -f2",
property="os_codename",
)
)
# build_factory.addStep(
# steps.SetPropertyFromCommand(
# name="Get OS codename",
# command="grep ^VERSION_CODENAME= /etc/os-release | cut -d= -f2",
# property="os_codename",
# )
# )
build_factory.addStep(
steps.ShellCommand(