提交 e4ba0b36 编写于 作者: C Christian Wolfgang

[fixed JENKINS-19740] Added postCheckout for SCMs

上级 de9816ee
...@@ -667,6 +667,10 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs ...@@ -667,6 +667,10 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
} catch (Exception e) { } catch (Exception e) {
throw new IOException2("Failed to parse changelog",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; return;
} }
} catch (AbortException e) { } catch (AbortException e) {
......
...@@ -420,6 +420,13 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint { ...@@ -420,6 +420,13 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint {
*/ */
public abstract boolean checkout(AbstractBuild<?,?> build, Launcher launcher, FilePath workspace, BuildListener listener, File changelogFile) throws IOException, InterruptedException; 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. * Adds environmental variables for the builds to the given map.
* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册