Skip to content
Permalink
Browse files

JENKINS-28030 I was using the preCheckout method to write the .chef f…

…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...
tfitch committed May 8, 2015
1 parent 0ce7d00 commit a19a22631924197975c68521bd6305d2dfc3d147
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/main/java/io/chef/jenkins/ChefIdentityBuildWrapper.java
@@ -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();
@@ -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();
}

0 comments on commit a19a226

Please sign in to comment.
You can’t perform that action at this time.