Skip to content

Commit

Permalink
Clean-up master.cfg, initial step
Browse files Browse the repository at this point in the history
  • Loading branch information
cvicentiu committed Nov 29, 2024
1 parent 6338210 commit 64e29bf
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 32 deletions.
2 changes: 1 addition & 1 deletion master-bintars/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### BUILDBOT SERVICES

Expand Down
2 changes: 1 addition & 1 deletion master-docker-nonstandard-2/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### BUILDBOT SERVICES

Expand Down
2 changes: 1 addition & 1 deletion master-docker-nonstandard/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### BUILDBOT SERVICES

Expand Down
2 changes: 1 addition & 1 deletion master-galera/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

FQDN = os.getenv("BUILDMASTER_WG_IP", default="100.64.100.1")

Expand Down
2 changes: 1 addition & 1 deletion master-nonlatent/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### PROJECT IDENTITY

Expand Down
2 changes: 1 addition & 1 deletion master-protected-branches/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### BUILDBOT SERVICES

Expand Down
2 changes: 1 addition & 1 deletion master-web/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external
# private file, so that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### PROJECT IDENTITY

Expand Down
62 changes: 38 additions & 24 deletions master.cfg
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
# -*- python -*-
# ex: set filetype=python:

from buildbot.plugins import *
from buildbot.process.properties import Property, Properties
from buildbot.steps.shell import ShellCommand, Compile, Test, SetPropertyFromCommand
from buildbot.steps.mtrlogobserver import MTR, MtrLogObserver
from buildbot.steps.source.github import GitHub
from buildbot.process.remotecommand import RemoteCommand
from datetime import timedelta
from twisted.internet import defer

import docker
import os
import sys

sys.setrecursionlimit(10000)
import yaml

sys.path.insert(0, "/srv/buildbot/master")

from common_factories import *
from constants import *
from locks import *
from buildbot.plugins import reporters, secrets, steps, util
from buildbot.process.properties import Property
from common_factories import (
getQuickBuildFactory,
getRpmAutobakeFactory,
getSourceTarball,
)
from constants import (
BUILDERS_GALERA_MTR,
GITHUB_STATUS_BUILDERS,
SAVED_PACKAGE_BRANCHES,
os_info,
)
from locks import getLocks
from schedulers_definition import SCHEDULERS
from utils import *
from utils import (
canStartBuild,
createDebRepo,
createWorker,
dockerfile,
hasDockerLibrary,
hasFiles,
hasInstall,
hasUpgrade,
ls2string,
nextBuild,
printEnv,
savePackage,
uploadDebArtifacts,
)

with open("master-config.yaml", "r") as f:
master_config = yaml.safe_load(f)
Expand All @@ -31,12 +43,14 @@ with open("master-config.yaml", "r") as f:
# a shorter alias to save typing.
c = BuildmasterConfig = {}

# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
# Load the slave, database passwords and 3rd-party tokens from an external
# private file, so that the rest of the configuration can be public.
config = {"private": {}}
exec(open("master-private.cfg").read(), config, {})

####### BUILDBOT SERVICES
#######
# BUILDBOT SERVICES
#######

# 'services' is a list of BuildbotService items like reporter targets. The
# status of each build will be pushed to these targets. buildbot/reporters/*.py
Expand Down Expand Up @@ -235,7 +249,7 @@ f_deb_autobake.addStep(
"master_branch": Property("master_branch"),
"parentbuildername": Property("buildername"),
},
doStepIf=lambda step: savePackage(step),
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
f_deb_autobake.addStep(
Expand All @@ -250,7 +264,7 @@ f_deb_autobake.addStep(
"master_branch": Property("master_branch"),
"parentbuildername": Property("buildername"),
},
doStepIf=lambda step: hasInstall(step) and savePackage(step) and hasFiles(step),
doStepIf=lambda step: hasInstall(step) and savePackage(step, SAVED_PACKAGE_BRANCHES) and hasFiles(step),
)
)
f_deb_autobake.addStep(
Expand All @@ -265,7 +279,7 @@ f_deb_autobake.addStep(
"master_branch": Property("master_branch"),
"parentbuildername": Property("buildername"),
},
doStepIf=lambda step: hasUpgrade(step) and savePackage(step) and hasFiles(step),
doStepIf=lambda step: hasUpgrade(step) and savePackage(step, SAVED_PACKAGE_BRANCHES) and hasFiles(step),
)
)
f_deb_autobake.addStep(
Expand Down
2 changes: 1 addition & 1 deletion validate_master_cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ for dir in autogen/* \
$RUNC run -i -v "$(pwd):/srv/buildbot/master" \
-w /srv/buildbot/master \
quay.io/mariadb-foundation/bb-master:master \
bash -c "cd $dir && buildbot checkconfig master.cfg"
bash -c "buildbot checkconfig $dir/master.cfg"
echo -e "done\n"
done

0 comments on commit 64e29bf

Please sign in to comment.