Skip to content

Commit

Permalink
Add temp var for date to attempt to fix Server date issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rubberbandage committed Jan 21, 2019
1 parent 1fe96d4 commit 18408fa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>date-plugin</artifactId>
<groupId>rubberbandage.teamcity</groupId>
<version>1.2-SNAPSHOT</version>
<version>1.3-SNAPSHOT</version>
</parent>
<artifactId>build</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion date-plugin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>date-plugin</artifactId>
<groupId>rubberbandage.teamcity</groupId>
<version>1.2-SNAPSHOT</version>
<version>1.3-SNAPSHOT</version>
</parent>
<artifactId>date-plugin-server</artifactId>
<version>1.1-SNAPSHOT</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public void buildStarted(SRunningBuild build)

String buildNumber = build.getBuildNumber();

if (date == null) date = new Date();

// If the build number contains the DATE = "{date}" pattern we replace it by the current date.
buildNumber = buildNumber.replace(DATE, createBuildNumber(date));
buildNumber = buildNumber.replace(BRANCH, createBranchName(build.getBranch()));
Expand All @@ -55,8 +53,10 @@ public void buildStarted(SRunningBuild build)

private String createBuildNumber(Date date)
{
Date tempDate = (date == null) ? new Date() : date;

SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
return sdf.format(date);
return sdf.format(tempDate);
}

private String createBranchName(Branch branch) {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>rubberbandage.teamcity</groupId>
<artifactId>date-plugin</artifactId>
<version>1.2-SNAPSHOT</version>
<version>1.3-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<teamcity-version>10.0</teamcity-version>
Expand Down

0 comments on commit 18408fa

Please sign in to comment.