Skip to content

Commit

Permalink
JENKINS-31139 Output plugin version in console
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry Lacour committed Oct 30, 2015
1 parent b91ba9b commit 90f5feb
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -13,6 +13,7 @@
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import org.jenkinsci.plugins.pretestedintegration.exceptions.EstablishingWorkspaceFailedException;
import org.jenkinsci.plugins.pretestedintegration.exceptions.IntegrationFailedException;
import org.jenkinsci.plugins.pretestedintegration.exceptions.NothingToDoException;
Expand Down Expand Up @@ -58,6 +59,7 @@ public PretestedIntegrationBuildWrapper(final AbstractSCMBridge scmBridge) {
*/
@Override
public BuildWrapper.Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) {
listener.getLogger().println(String.format("%s Pretested Integration Plugin v%s", LOG_PREFIX, getVersion()));
boolean proceedToBuildStep = true;
try {
scmBridge.validateConfiguration(build.getProject());
Expand Down Expand Up @@ -97,6 +99,13 @@ public DescriptorImpl getDescriptor() {
return (DescriptorImpl) super.getDescriptor();
}

/**
* @return the plugin version
*/
public String getVersion(){
return Jenkins.getInstance().getPlugin("pretested-integration").getWrapper().getVersion();
}

/**
* A singleton Descriptor for every concrete BuildWrapper implementation.
*/
Expand Down

0 comments on commit 90f5feb

Please sign in to comment.