Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</pluginRepositories>
<properties>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.baseline>2.504</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<useBeta>true</useBeta>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
Expand All @@ -77,10 +77,16 @@
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>4023.va_eeb_b_4e45f07</version>
<version>5054.v620b_5d2b_d5e6</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-api</artifactId>
<!-- TODO: Replace incremental version (https://github.com/jenkinsci/workflow-api-plugin/pull/417) with the latest release once upstream is released.-->
<version>1397.v02e97a_30f3ce</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
import org.jenkinsci.plugins.workflow.log.FileLogStorage;
import org.jenkinsci.plugins.workflow.log.LogStorage;
import org.jenkinsci.plugins.workflow.log.LogStorageFactory;
import org.jenkinsci.plugins.workflow.log.LogStorageFactoryDescriptor;
import org.jenkinsci.plugins.workflow.log.OutputStreamTaskListener;
import org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback;
import org.jenkinsci.plugins.workflow.steps.BodyInvoker;
Expand Down Expand Up @@ -431,8 +432,14 @@ private static class Decorator extends LauncherDecorator implements Serializable
j.assertLogNotContains(password.toUpperCase(Locale.ENGLISH), b);
j.assertLogContains("CURL -U **** HTTP://SERVER/ [master → remote]", b);
}
@TestExtension("remoteLogger[watching=true]") public static class LogFile implements LogStorageFactory {
@Override public LogStorage forBuild(FlowExecutionOwner b) {

public static class LogFile implements LogStorageFactory {

@DataBoundConstructor
public LogFile() {}

@Override
public LogStorage forBuild(FlowExecutionOwner b) {
final LogStorage base;
try {
base = FileLogStorage.forFile(new File(b.getRootDir(), "special.log"));
Expand All @@ -458,7 +465,22 @@ private static class Decorator extends LauncherDecorator implements Serializable
}
};
}

@TestExtension("remoteLogger[watching=true]")
public static final class DescriptorImpl extends LogStorageFactoryDescriptor<LogFile> {
@NonNull
@Override
public String getDisplayName() {
return "LogFile Storage";
}

@Override
public LogStorageFactory getDefaultInstance() {
return new LogFile();
}
}
}

private static class RemotableBuildListener extends OutputStreamTaskListener.Default implements BuildListener {
private static final long serialVersionUID = 1;
/** actual implementation */
Expand Down