Navigation Menu

Skip to content

Commit

Permalink
fix JENKINS-46048 Improve support for Pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Ted Xiao authored and Jimilian committed Aug 16, 2017
1 parent baf5902 commit 32a092a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -24,7 +24,7 @@ build action called `S3 Copy Artifact` for downloading artifacts,
and a post-build action called `Publish Artifacts to S3 Bucket`.

For Pipeline users, the same two actions are available via the
`step` step. You can use the snippet generator to get started.
`s3CopyArtifact` and `s3Upload` step. You can use the snippet generator to get started.

When using an Amazon S3 compatible storage system (OpenStack Swift, EMC Atmos...),
the list of AWS regions can be overridden specifying a file
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Expand Up @@ -101,6 +101,11 @@
<artifactId>maven-plugin</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
<version>1.2</version>
</dependency>
</dependencies>

<repositories>
Expand Down
22 changes: 17 additions & 5 deletions src/main/java/hudson/plugins/s3/S3BucketPublisher.java
Expand Up @@ -22,6 +22,7 @@
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
Expand Down Expand Up @@ -126,22 +127,32 @@ public String getProfileName() {
return this.profileName;
}

/**
* for data binding only
*
* @return pluginFailureResultConstraint string representation
*/
@SuppressWarnings("unused")
public Result getPluginFailureResultConstraint() {
public String getPluginFailureResultConstraint() {
if (pluginFailureResultConstraint == null) {
return Result.FAILURE;
return Result.FAILURE.toString();
}
return pluginFailureResultConstraint;
return pluginFailureResultConstraint.toString();
}

@SuppressWarnings("unused")
public boolean isDontWaitForConcurrentBuildCompletion() {
return dontWaitForConcurrentBuildCompletion;
}

/**
* for data binding only
*
* @return consoleLogLevel string representation
*/
@SuppressWarnings("unused")
public Level getConsoleLogLevel() {
return consoleLogLevel;
public String getConsoleLogLevel() {
return consoleLogLevel.toString();
}

public S3Profile getProfile() {
Expand Down Expand Up @@ -377,6 +388,7 @@ public BuildStepMonitor getRequiredMonitorService() {
return dontWaitForConcurrentBuildCompletion ? BuildStepMonitor.NONE : BuildStepMonitor.STEP;
}

@Symbol("s3Upload")
public static final class DescriptorImpl extends BuildStepDescriptor<Publisher> {

private final CopyOnWriteList<S3Profile> profiles = new CopyOnWriteList<S3Profile>();
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/hudson/plugins/s3/S3CopyArtifact.java
Expand Up @@ -63,6 +63,7 @@
import jenkins.tasks.SimpleBuildStep;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
Expand Down Expand Up @@ -301,6 +302,7 @@ private static class JobResolver {
}

@Extension
@Symbol("s3CopyArtifact")
public static final class DescriptorImpl extends BuildStepDescriptor<Builder> {

public FormValidation doCheckProjectName(
Expand Down

0 comments on commit 32a092a

Please sign in to comment.