Skip to content

Commit 5de25a5

Browse files
author
Martin Guenthner
committed
Merge branch 'master' into appspec
2 parents ba4cd55 + 6ab34c0 commit 5de25a5

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</parent>
88

99
<artifactId>codedeploy</artifactId>
10-
<version>1.7-SNAPSHOT</version>
10+
<version>1.8-SNAPSHOT</version>
1111
<packaging>hpi</packaging>
1212
<groupId>com.amazonaws</groupId>
1313
<name>AWS CodeDeploy Plugin for Jenkins</name>

src/main/java/com/amazonaws/codedeploy/AWSCodeDeployPublisher.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class AWSCodeDeployPublisher extends Publisher {
7777
public static final long DEFAULT_TIMEOUT_SECONDS = 900;
7878
public static final long DEFAULT_POLLING_FREQUENCY_SECONDS = 15;
7979
public static final String ROLE_SESSION_NAME = "jenkins-codedeploy-plugin";
80-
public static final Regions[] AVAILABLE_REGIONS = {Regions.AP_SOUTHEAST_2, Regions.EU_WEST_1, Regions.US_EAST_1, Regions.US_WEST_2};
80+
public static final Regions[] AVAILABLE_REGIONS = {Regions.AP_NORTHEAST_1, Regions.AP_SOUTHEAST_2, Regions.EU_WEST_1, Regions.US_EAST_1, Regions.US_WEST_2};
8181

8282
private final String s3bucket;
8383
private final String s3prefix;
@@ -236,14 +236,14 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
236236
}
237237

238238
private FilePath getSourceDirectory(FilePath basePath) throws IOException, InterruptedException {
239-
String subdirectory = this.subdirectory.trim().length() > 0 ? this.subdirectory.trim() : "";
239+
String subdirectory = StringUtils.trimToEmpty(this.subdirectory);
240240
if (!subdirectory.isEmpty() && !subdirectory.startsWith("/")) {
241241
subdirectory = "/" + subdirectory;
242242
}
243243
FilePath sourcePath = basePath.withSuffix(subdirectory).absolutize();
244-
File sourceDirectory = new File(sourcePath.getRemote());
245-
if (!sourceDirectory.isDirectory() || !isSubDirectory(basePath, sourcePath)) {
246-
throw new IllegalArgumentException("Provided path is not a subdirectory of the workspace: " + sourcePath );
244+
if (!sourcePath.isDirectory() || !isSubDirectory(basePath, sourcePath)) {
245+
throw new IllegalArgumentException("Provided path (resolved as '" + sourcePath
246+
+"') is not a subdirectory of the workspace (resolved as '" + basePath + "')");
247247
}
248248
return sourcePath;
249249
}
@@ -408,7 +408,9 @@ private boolean waitForDeployment(AWSClients aws, String deploymentId) throws In
408408

409409
Thread.sleep(pollingFreqMillis);
410410
}
411-
411+
412+
logger.println("Deployment status: " + deployStatus.getStatus() + "; instances: " + deployStatus.getDeploymentOverview());
413+
412414
if (!deployStatus.getStatus().equals(DeploymentStatus.Succeeded.toString())) {
413415
this.logger.println("Deployment did not succeed. Final status: " + deployStatus.getStatus());
414416
success = false;

0 commit comments

Comments
 (0)