From cdc6a948a6cfd02fd623dd45edef90d0a66fcf91 Mon Sep 17 00:00:00 2001 From: yanhuqing Date: Fri, 6 Jul 2018 16:31:20 +0800 Subject: [PATCH] add git version --- pom.xml | 25 ++++++++++++++----- .../datasource/PhysicalDatasource.java | 2 +- version.txt | 5 ++-- version.txt.template | 1 + 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 1f83b2ad1..c0226f726 100644 --- a/pom.xml +++ b/pom.xml @@ -11,9 +11,6 @@ UTF-8 - - yyyy-MM-dd HH:mm:ss version.txt.template version.txt dble Server (ActionTech) @@ -395,9 +392,13 @@ ${project.basedir}/${version.template.file} ${project.basedir}/${version.file} + + @gitcommitid@ + ${git.commit.id} + @buildtime@ - ${maven.build.timestamp} + ${timestamp} @pomversion@ @@ -432,7 +433,7 @@ @server-version@ - 5.6.29-dble-${project.version}-${timestamp} + 5.6.29-dble-${project.version}-${git.commit.id}-${timestamp} @version-comment@ @@ -653,7 +654,19 @@ yyyyMMddHHmmss - + + pl.project13.maven + git-commit-id-plugin + 2.2.4 + + + get-the-git-infos + + revision + + + + org.apache.maven.plugins maven-checkstyle-plugin diff --git a/src/main/java/com/actiontech/dble/backend/datasource/PhysicalDatasource.java b/src/main/java/com/actiontech/dble/backend/datasource/PhysicalDatasource.java index 258ae40a8..4c9ede59e 100644 --- a/src/main/java/com/actiontech/dble/backend/datasource/PhysicalDatasource.java +++ b/src/main/java/com/actiontech/dble/backend/datasource/PhysicalDatasource.java @@ -372,8 +372,8 @@ public abstract class PhysicalDatasource { public void connectionError(Throwable e, BackendConnection conn) { Map labels = AlertUtil.genSingleLabel("data_host", hostConfig.getName() + "-" + config.getHostName()); AlertUtil.alert(AlarmCode.CREATE_CONN_FAIL, Alert.AlertLevel.WARN, "createNewConn Error" + e.getMessage(), "mysql", config.getId(), labels); - handler.connectionError(e, conn); createConnAlert = true; + handler.connectionError(e, conn); } @Override diff --git a/version.txt b/version.txt index d6e6d0d01..4bb6ac5ba 100644 --- a/version.txt +++ b/version.txt @@ -1,5 +1,6 @@ -BuildTime 2018-05-07 08:17:48 -MavenVersion 2.18.06.0-dev +GitVersion 3d1f096980d7a067913aa329db0280ce8d2e743c +BuildTime 20180706161245 +MavenVersion 9.9.9.9 GitUrl https://github.com/actiontech/dble WebSite http://dble.cloud/ QQGroup 669663113 diff --git a/version.txt.template b/version.txt.template index b8d351a46..60adc54d6 100644 --- a/version.txt.template +++ b/version.txt.template @@ -1,3 +1,4 @@ +GitVersion @gitcommitid@ BuildTime @buildtime@ MavenVersion @pomversion@ GitUrl @giturl@