7373 * credentials to be configured for each project.
7474 */
7575public class AWSCodeDeployPublisher extends Publisher {
76- public static final String POLLING_TIMEOUT_KEY = "pollingTimeoutSec" ;
77- public static final String POLLING_FREQ_KEY = "pollingFreqSec" ;
7876 public static final long DEFAULT_TIMEOUT_SECONDS = 900 ;
7977 public static final long DEFAULT_POLLING_FREQUENCY_SECONDS = 15 ;
8078 public static final String ROLE_SESSION_NAME = "jenkins-codedeploy-plugin" ;
@@ -112,7 +110,9 @@ public AWSCodeDeployPublisher(
112110 String deploymentGroupName ,
113111 String deploymentConfig ,
114112 String region ,
115- JSONObject waitForCompletion ,
113+ Boolean waitForCompletion ,
114+ Long pollingTimeoutSec ,
115+ Long pollingFreqSec ,
116116 String credentials ,
117117 String awsAccessKey ,
118118 String awsSecretKey ,
@@ -127,7 +127,11 @@ public AWSCodeDeployPublisher(
127127 this .externalId = externalId ;
128128 this .applicationName = applicationName ;
129129 this .deploymentGroupName = deploymentGroupName ;
130- this .deploymentConfig = deploymentConfig ;
130+ if (deploymentConfig != null && deploymentConfig .length () == 0 ) {
131+ this .deploymentConfig = null ;
132+ } else {
133+ this .deploymentConfig = deploymentConfig ;
134+ }
131135 this .region = region ;
132136 this .includes = includes ;
133137 this .excludes = excludes ;
@@ -139,19 +143,17 @@ public AWSCodeDeployPublisher(
139143 this .awsSecretKey = awsSecretKey ;
140144 this .iamRoleArn = iamRoleArn ;
141145
142- if (waitForCompletion != null ) {
143- this .waitForCompletion = true ;
144-
145- if (waitForCompletion .containsKey (POLLING_TIMEOUT_KEY )) {
146- this .pollingTimeoutSec = waitForCompletion .getLong (POLLING_TIMEOUT_KEY );
147- } else {
146+ if (waitForCompletion != null && waitForCompletion ) {
147+ this .waitForCompletion = waitForCompletion ;
148+ if (pollingTimeoutSec == null ) {
148149 this .pollingTimeoutSec = DEFAULT_TIMEOUT_SECONDS ;
149- }
150-
151- if (waitForCompletion .containsKey (POLLING_FREQ_KEY )) {
152- this .pollingFreqSec = waitForCompletion .getLong (POLLING_FREQ_KEY );
153150 } else {
151+ this .pollingTimeoutSec = pollingTimeoutSec ;
152+ }
153+ if (pollingFreqSec == null ) {
154154 this .pollingFreqSec = DEFAULT_POLLING_FREQUENCY_SECONDS ;
155+ } else {
156+ this .pollingFreqSec = pollingFreqSec ;
155157 }
156158 } else {
157159 this .waitForCompletion = false ;
0 commit comments