Navigation Menu

Skip to content

Commit

Permalink
JENKINS-28030 I was using the preCheckout method to write the .chef f…
Browse files Browse the repository at this point in the history
…older when I should have been using setUp. Now .chef folder won't be erased by SCM checkout on first job run.
  • Loading branch information
Tyler Fitch committed May 8, 2015
1 parent 0ce7d00 commit a19a226
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/java/io/chef/jenkins/ChefIdentityBuildWrapper.java
Expand Up @@ -79,7 +79,7 @@ public String getJobIdentity() {
}

@Override
public void preCheckout(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
public Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
// This is where you 'build' the project.
listener.getLogger().println("Running build with Chef Identity of " + this.jobIdentity);
ChefIdentity chefIdentity = new ChefIdentity();
Expand Down Expand Up @@ -116,10 +116,7 @@ public void preCheckout(AbstractBuild build, Launcher launcher, BuildListener li
new FilePath(ws, ".chef/knife.rb").write(chefIdentity.getKnifeRb(), "UTF-8");
}
}
}

@Override
public Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {

return new NoopEnv();
}

Expand Down

0 comments on commit a19a226

Please sign in to comment.