Skip to content

Commit

Permalink
Add ability to specify custom suffix to versionLabel (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbpatel219 authored Aug 4, 2021
1 parent a8defe3 commit 7e37d89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class BeanstalkDeployment {
private String environment;
private String template = "default";
private String versionPrefix = "";
private String versionSuffix = "";
private Object file;

public BeanstalkDeployment(String name) {
Expand All @@ -25,6 +26,14 @@ public void setVersionPrefix(String versionPrefix) {
this.versionPrefix = versionPrefix;
}

public String getVersionSuffix() {
return versionSuffix;
}

public void setVersionSuffix(String versionSuffix) {
this.versionSuffix = versionSuffix;
}

public String getApplication() {
return application;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fi/evident/gradle/beanstalk/DeployTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected String getVersionLabel() {
String timeLabel = new SimpleDateFormat("yyyyMMdd'.'HHmmss").format(new Date());
versionLabel = versionLabel.replace("SNAPSHOT", timeLabel); // Append time to get unique version label
}
return deployment.getVersionPrefix() + versionLabel;
return deployment.getVersionPrefix() + versionLabel + deployment.getVersionSuffix();
}

public void setBeanstalk(BeanstalkPluginExtension beanstalk) {
Expand Down

0 comments on commit 7e37d89

Please sign in to comment.