diff --git a/fetch/src/main/java/com/indix/gocd/s3fetch/FetchExecutor.java b/fetch/src/main/java/com/indix/gocd/s3fetch/FetchExecutor.java index 4bfde7e..c20de11 100644 --- a/fetch/src/main/java/com/indix/gocd/s3fetch/FetchExecutor.java +++ b/fetch/src/main/java/com/indix/gocd/s3fetch/FetchExecutor.java @@ -6,6 +6,7 @@ import com.indix.gocd.utils.store.S3ArtifactStore; import com.thoughtworks.go.plugin.api.logging.Logger; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; import java.io.File; import java.io.IOException; @@ -24,9 +25,11 @@ public TaskExecutionResult execute(Config config, final Context context) { final String bucket = getBucket(config, env); final S3ArtifactStore store = getS3ArtifactStore(env, bucket); - context.printMessage(String.format("Getting artifacts from %s", store.pathString(artifactPathOnS3))); String destination = String.format("%s/%s", context.getWorkingDir(), config.getDestination()); - setupDestinationDirectory(destination); + context.printMessage(String.format("Getting artifacts from %s to %s", store.pathString(artifactPathOnS3), destination)); + if(StringUtils.isNotBlank(config.getDestination())) { + setupDestinationDirectory(destination); + } store.getPrefix(artifactPathOnS3, destination); return new TaskExecutionResult(true, "Fetched all artifacts"); } catch (Exception e) { diff --git a/fetch/src/main/java/com/indix/gocd/s3fetch/FetchTask.java b/fetch/src/main/java/com/indix/gocd/s3fetch/FetchTask.java index bee6348..53dabce 100644 --- a/fetch/src/main/java/com/indix/gocd/s3fetch/FetchTask.java +++ b/fetch/src/main/java/com/indix/gocd/s3fetch/FetchTask.java @@ -125,7 +125,7 @@ private GoPluginApiResponse handleGetConfigRequest() { HashMap destination = new HashMap(); destination.put("default-value", ""); - destination.put("required", true); + destination.put("required", false); config.put(Constants.DESTINATION, destination); return createResponse(DefaultGoPluginApiResponse.SUCCESS_RESPONSE_CODE, config); diff --git a/fetch/src/main/resources/views/task.template.html b/fetch/src/main/resources/views/task.template.html index 3e6b8a0..669c764 100644 --- a/fetch/src/main/resources/views/task.template.html +++ b/fetch/src/main/resources/views/task.template.html @@ -31,8 +31,8 @@
- - + + {{ GOINPUTNAME[Destination].$error.server }}