Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-43782] General Build Steps Do Not Work In Pipelines (#21)
Get Computer object off the workspace instead of static Computer method.

Source: https://groups.google.com/forum/#!topic/jenkinsci-dev/MwdVHQ-lbvc
"You can get the `Node`/`Computer` from the `FilePath workspace` (which will work for freestyle builds, too)"
  • Loading branch information
michaelcresswell authored and escoem committed Jan 30, 2018
1 parent 46b2ce1 commit 02694ea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Expand Up @@ -182,7 +182,7 @@ public void setExtraVars(List<ExtraVar> extraVars) {
public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath ws, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws InterruptedException, IOException {
try {
CLIRunner runner = new CLIRunner(run, ws, launcher, listener);
Computer computer = Computer.currentComputer();
Computer computer = ws.toComputer();
if (computer == null) {
throw new AbortException("The ansible ad-hoc command build step requires to be launched on a node");
}
Expand Down
Expand Up @@ -212,7 +212,7 @@ public void setExtraVars(List<ExtraVar> extraVars) {
public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath ws, @Nonnull Launcher launcher, @Nonnull TaskListener listener)
throws InterruptedException, IOException
{
Computer computer = Computer.currentComputer();
Computer computer = ws.toComputer();
Node node;
if (computer == null || (node = computer.getNode()) == null) {
throw new AbortException("The ansible playbook build step requires to be launched on a node");
Expand Down
Expand Up @@ -103,7 +103,7 @@ public void setOutput(String output) {
public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath ws, @Nonnull Launcher launcher, @Nonnull TaskListener listener)
throws InterruptedException, IOException
{
Computer computer = Computer.currentComputer();
Computer computer = ws.toComputer();
Node node;
if (computer == null || (node = computer.getNode()) == null) {
throw new AbortException("The ansible vault build step requires to be launched on a node");
Expand Down

0 comments on commit 02694ea

Please sign in to comment.