This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String s = FileUtils.readFileToString(build.getLogFile()); | |
assertThat(s, contains("aaa1")); | |
assertThat(s, contains("aaa2")); | |
assertThat(s, contains("aaa3")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FreeStyleProject project = j.createFreeStyleProject(); | |
project.getBuildersList().add(new HelloWorldNotifier(“aaa”)); | |
FreeStyleBuild build = project.scheduleBuild2(0).get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Rule public JenkinsRule j = new JenkinsRule(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Extension | |
public class BuildListener extends RunListener<AbstractBuild> { | |
@Override | |
public void onStarted(AbstractBuild abstractBuild, TaskListener listener) { | |
// Do nothing. | |
} | |
@Override | |
public void onCompleted(AbstractBuild abstractBuild, TaskListener listener) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException{ | |
global = formData.getString("global"); | |
save(); | |
return super.configure(req, formData); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public String getDisplayName() { | |
return "HelloWorldNotifier"; // What people will see as the plugin name in the configs | |
} | |
@Override | |
public boolean isApplicable(Class<? extends AbstractProject> aClass) { | |
return true; // We are always OK with someone adding this as a build step for their job | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Extension | |
public static final class DescriptorImpl extends BuildStepDescriptor<Publisher> { // Publisher because Notifiers are a type of publisher | |
Private Integer global; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private final String local; | |
@DataBoundConstructor | |
public HelloWorldNotifier(String local){ | |
this.local = local; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package testGroup.HelloWorldNotifier; | |
public class HelloWorldNotifier extends Notifier { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<settings> | |
<pluginGroups> | |
<pluginGroup>org.jenkins-ci.tools</pluginGroup> | |
</pluginGroups> | |
<profiles> | |
<!-- Give access to Jenkins plugins --> | |
<profile> | |
<id>jenkins</id> | |
<activation> |
NewerOlder