@@ -82,6 +82,7 @@ public class AWSCodeDeployPublisher extends Publisher {
82
82
private final String s3bucket ;
83
83
private final String s3prefix ;
84
84
private final String applicationName ;
85
+ private final String deploymentDescription ;
85
86
private final String deploymentGroupName ; // TODO allow for deployment to multiple groups
86
87
private final String deploymentConfig ;
87
88
private final Long pollingTimeoutSec ;
@@ -109,6 +110,7 @@ public AWSCodeDeployPublisher(
109
110
String s3bucket ,
110
111
String s3prefix ,
111
112
String applicationName ,
113
+ String deploymentDescription ,
112
114
String deploymentGroupName ,
113
115
String deploymentConfig ,
114
116
String region ,
@@ -130,6 +132,7 @@ public AWSCodeDeployPublisher(
130
132
this .externalId = externalId ;
131
133
this .applicationName = applicationName ;
132
134
this .deploymentGroupName = deploymentGroupName ;
135
+ this .deploymentDescription = deploymentDescription ;
133
136
if (deploymentConfig != null && deploymentConfig .length () == 0 ) {
134
137
this .deploymentConfig = null ;
135
138
} else {
@@ -356,7 +359,7 @@ private void registerRevision(AWSClients aws, RevisionLocation revisionLocation)
356
359
}
357
360
358
361
private String createDeployment (AWSClients aws , RevisionLocation revisionLocation ) throws Exception {
359
-
362
+ String deploymentDescription = getDeploymentDescriptionFromEnv ();
360
363
this .logger .println ("Creating deployment with revision at " + revisionLocation );
361
364
362
365
CreateDeploymentResult createDeploymentResult = aws .codedeploy .createDeployment (
@@ -365,7 +368,7 @@ private String createDeployment(AWSClients aws, RevisionLocation revisionLocatio
365
368
.withDeploymentGroupName (getDeploymentGroupNameFromEnv ())
366
369
.withApplicationName (getApplicationNameFromEnv ())
367
370
.withRevision (revisionLocation )
368
- .withDescription ("Deployment created by Jenkins" )
371
+ .withDescription (deploymentDescription )
369
372
);
370
373
371
374
return createDeploymentResult .getDeploymentId ();
@@ -590,6 +593,10 @@ public String getApplicationName() {
590
593
return applicationName ;
591
594
}
592
595
596
+ public String getDeploymentDescription (){
597
+ return deploymentDescription ;
598
+ }
599
+
593
600
public String getDeploymentGroupName () {
594
601
return deploymentGroupName ;
595
602
}
@@ -669,7 +676,9 @@ public int getProxyPort() {
669
676
public String getApplicationNameFromEnv () {
670
677
return Util .replaceMacro (this .applicationName , envVars );
671
678
}
672
-
679
+ public String getDeploymentDescriptionFromEnv (){
680
+ return Util .replaceMacro (this .deploymentDescription , envVars );
681
+ }
673
682
public String getDeploymentGroupNameFromEnv () {
674
683
return Util .replaceMacro (this .deploymentGroupName , envVars );
675
684
}
0 commit comments