[users at bb.net] Re-using an existing builder in a nightly scheduler.

Edd Barrett edd at theunixzoo.co.uk
Thu Jul 2 10:57:42 UTC 2020


Hi all,

First, we use buildbot for our CI on a daily basis and it's been great! We are
grateful for the efforts of the devs. Thank you!

I need to add a nightly scheduler to our config that re-uses an existing
builder.

The builder in question:
```
c['builders'].append(
    util.BuilderConfig(name="buildbot-build-script",
      workernames=ALL_WORKERS,
      factory=buildbot_sh_factory))
```

And the factory:
```
@util.renderer
def get_repourl(props):
        return props.getProperty('repository')

buildbot_sh_factory = util.BuildFactory()
buildbot_sh_factory.addStep(steps.Git(repourl=get_repourl,
                                      mode='full', method='clobber',
                                      shallow=True))
buildbot_sh_factory.addStep(steps.ShellCommand(
    command=["/bin/sh", "-x", ".buildbot.sh"], timeout=BUILD_SCRIPT_TIMEOUT))
```

(I think I can kill `get_repourl()` and use `util.Property()` but that's
unrelated I think).

Until now, this builder has only ever been triggered by git changes via a
SingleBranchScheduler.

Now I'd like to use this same builder in a NightlyScheduler, but in the absence
of a git change, there's no way for BB to know which repo and branch to use.

I tried two things in a NightlyScheduler:
 - Pass `properties={'repository': ...}`
 - Pass `codebases={'myrepo': {'repository': ...}}`

Neither seemed to achieve the desired effect, so I must be doing it wrong.

Using the former, the `repository` property never made it as far as build steps. It was empty, so presumably over-written somewhere.

With the latter I got 'No sourcestamp found in build for codebase'.

I just need to ensure that the repository property is populated with a string of my choosing in the NightlyScheduler. Is it possible?

Thanks

--
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk


More information about the users mailing list