Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set workerbuilddir? #86

Open
baccenfutter opened this issue Apr 11, 2018 · 1 comment
Open

How to set workerbuilddir? #86

baccenfutter opened this issue Apr 11, 2018 · 1 comment

Comments

@baccenfutter
Copy link

For my builds to work, I need to leverage one of buildbot's features, namely customize the workerbuilddir. I am testing Ansible roles and the name of the directory has to be the name of the role in order for ansible to find the role in its role_path. However, the default workerbuilddir is build.

How do I set workerbuilddir in buildbot-travis?

@vdsbenoit
Copy link

AFAIK, it is not included in Buildbot-travis yet. You can easily add the feature yourself in the code.
In the class TravisSetupSteps of the module create_steps.py, you can add

workdir = self.build.getProperty("workdir", "")
if workdir:
	if isinstance(workdir, util.Interpolate):
		workdir = workdir.getRenderingFor(self.build).result
	workdir = self.workdir + '/' + workdir
else:
    workdir = self.workdir

and then add workdir in this statement:

step = ShellCommand(name=name, description=command, command=command, doStepIf=not self.disable)

so it looks like this:

 step = ShellCommand(name=name, description=command, command=command, doStepIf=not self.disable, workdir=workdir)

Once you have performed these changes, you'll be able to set your build directory in the environment variable of your .bbtravis.yml files:

env:
  global:
    - workdir=/path/to/your/workdir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants