Skip to content

Commit

Permalink
[fixed JENKINS-19740] Added postCheckout for SCMs
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgarnet committed Sep 25, 2013
1 parent de9816e commit e4ba0b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/hudson/model/AbstractBuild.java
Expand Up @@ -667,6 +667,10 @@ public void defaultCheckout() throws IOException, InterruptedException {
} catch (Exception e) {
throw new IOException2("Failed to parse changelog",e);
}

// Get a chance to do something after checkout and changelog is done
scm.postCheckout( build, launcher, build.getWorkspace(), listener );

return;
}
} catch (AbortException e) {
Expand Down
7 changes: 7 additions & 0 deletions core/src/main/java/hudson/scm/SCM.java
Expand Up @@ -420,6 +420,13 @@ private boolean is1_346OrLater() {
*/
public abstract boolean checkout(AbstractBuild<?,?> build, Launcher launcher, FilePath workspace, BuildListener listener, File changelogFile) throws IOException, InterruptedException;

/**
* Get a chance to do operations after the workspace i checked out and the changelog is written.
*/
public void postCheckout(AbstractBuild<?,?> build, Launcher launcher, FilePath workspace, BuildListener listener) throws IOException, InterruptedException {
/* Default implementation is noop */
}

/**
* Adds environmental variables for the builds to the given map.
*
Expand Down

0 comments on commit e4ba0b3

Please sign in to comment.