2021-12-23 09:01:52 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
""" parent webhook """
|
|
|
|
|
|
|
|
from buildbot.plugins import steps, util, secrets
|
2021-12-23 12:26:44 +01:00
|
|
|
from .lib.renderers import *
|
2021-12-23 09:01:52 +01:00
|
|
|
|
|
|
|
c = BuildmasterConfig = {}
|
|
|
|
|
|
|
|
c['buildbotNetUsageData'] = None
|
|
|
|
|
|
|
|
####### SECRETS
|
|
|
|
|
|
|
|
c['secretsProviders'] = [secrets.SecretInAFile(dirname="/var/lib/buildbot/secrets/bitmessage")]
|
|
|
|
gitea_known_hosts = util.Secret('gitea_known_hosts')
|
|
|
|
gitea_privkey = util.Secret('gitea_privkey')
|
|
|
|
|
|
|
|
travis_bash = util.BuildFactory()
|
|
|
|
travis_bash.addStep(
|
|
|
|
steps.GitHub(
|
|
|
|
repourl=util.Property("repository"),
|
|
|
|
name="github",
|
|
|
|
doStepIf=is_github,
|
|
|
|
hideStepIf=isnt_github,
|
|
|
|
branch=util.Property("branch"),
|
|
|
|
mode="incremental",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
travis_bash.addStep(
|
|
|
|
steps.Gitea(
|
|
|
|
repourl=util.Property("repository"),
|
|
|
|
sshPrivateKey=gitea_privkey,
|
|
|
|
sshKnownHosts=gitea_known_hosts,
|
|
|
|
name="gitea",
|
|
|
|
doStepIf=is_gitea,
|
|
|
|
hideStepIf=isnt_gitea,
|
|
|
|
branch=util.Property("branch"),
|
|
|
|
mode="incremental",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
# execute an interpolate of '.buildbot/$(prop:jobname)/build.sh'
|
|
|
|
travis_bash.addStep(
|
|
|
|
steps.ShellCommand(
|
|
|
|
name="Execute build script",
|
|
|
|
command=[
|
|
|
|
"bash",
|
2021-12-23 12:26:44 +01:00
|
|
|
util.Interpolate(".buildbot/%(prop:jobname)s/build.sh"),
|
2021-12-23 09:01:52 +01:00
|
|
|
],
|
|
|
|
doStepIf=is_build_script_available,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
travis_bash.addStep(
|
|
|
|
steps.ShellCommand(
|
|
|
|
name="Execute test script",
|
|
|
|
command=[
|
|
|
|
"bash",
|
2021-12-23 12:26:44 +01:00
|
|
|
util.Interpolate(".buildbot/%(prop:jobname)s/test.sh"),
|
2021-12-23 09:01:52 +01:00
|
|
|
],
|
|
|
|
doStepIf=is_test_script_available,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
# execute multibuild.py
|
|
|
|
travis_bash.addStep(
|
|
|
|
steps.ShellCommand(
|
|
|
|
name="Execute multibuild script",
|
|
|
|
command=[
|
|
|
|
"python",
|
2021-12-23 12:26:44 +01:00
|
|
|
"multibuild.py",
|
|
|
|
util.Interpolate("%(prop:jobname)s"),
|
|
|
|
util.Property("repository"),
|
|
|
|
util.Property("branch"),
|
|
|
|
"https://buildbot.bitmessage.org",
|
2021-12-23 09:01:52 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|