Skip to content

Commit

Permalink
KYLO-3221: Add git commit ID to version.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
felten committed Dec 13, 2018
1 parent e9705db commit b112695
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 80 deletions.
227 changes: 148 additions & 79 deletions services/service-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -548,85 +548,154 @@

<build>

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>

<!-- create single distribution file -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/descriptor.xml</descriptor>
</descriptors>
<tarLongFileMode>posix</tarLongFileMode>
</configuration>
<executions>
<execution>
<id>make-distribution</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<!-- Liquibase plugin for quick testing of database upgrades with following command
mvn package liquibase:updateSQL -->

<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase.version}</version>
<configuration>
<changeLogFile>src/main/resources/com/thinkbiganalytics/db/master.xml</changeLogFile>
<!--<driver>org.mariadb.jdbc.Driver</driver>-->
<!--<url>jdbc:mysql://localhost:3306/kylo</url>-->
<!--<username>root</username>-->
<!--<password>hadoop</password>-->
<verbose>false</verbose>
<logging>info</logging>
</configuration>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.0.0</version>
</dependency>
<!--<dependency>-->
<!--<groupId>com.microsoft.sqlserver</groupId>-->
<!--<artifactId>mssql-jdbc</artifactId>-->
<!--<version>6.2.1.jre7</version>-->
<!--</dependency>-->
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>${liquibase.version}</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.18.2-GA</version>
</dependency>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate4</artifactId>
<version>${liquibase-hibernate4.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>1.4.2.RELEASE</version>
</dependency>
</dependencies>
</plugin>

</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<!-- Expose git details; specifically the commit ID -->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.2.5</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<!-- *NOTE*: The default phase of revision is initialize, but in
case you want to change it, you can do so by adding the phase here -->
<phase>initialize</phase>
</execution>
<execution>
<id>validate-the-git-infos</id>
<phase>package</phase>
</execution>
</executions>

<configuration>
<generateGitPropertiesFile>false</generateGitPropertiesFile>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<format>properties</format>
<injectAllReactorProjects>false</injectAllReactorProjects>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
<failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo>
<skip>false</skip>

<!-- Can be used to exclude certain properties from being emitted
into the resulting file. May be useful when you want to hide {@code git.remote.origin.url}
(maybe because it contains your repo password?), or the email of the committer
etc. Each value may be globbing, that is, you can write {@code git.commit.user.*}
to exclude both, the {@code name}, as well as {@code email} properties from
being emitted into the resulting files. Please note that the strings here
are Java regexes ({@code .*} is globbing, not plain {@code *}). -->
<excludeProperties>
<!-- <excludeProperty>git.user.*</excludeProperty> -->
</excludeProperties>

<!-- Can be used to include only certain properties into the resulting
file. Will be overruled by the exclude properties. Each value may be globbing,
that is, you can write {@code git.commit.user.*} to include both, the {@code
name}, as well as {@code email} properties into the resulting files. Please
note that the strings here are Java regexes ({@code .*} is globbing, not
plain {@code *}). -->
<includeOnlyProperties>
<!-- <includeOnlyProperty>^git.commit.id.full$</includeOnlyProperty> -->
</includeOnlyProperties>

<useNativeGit>false</useNativeGit>
<abbrevLength>7</abbrevLength>
<gitDescribe>
<skip>true</skip>
<always>false</always>
<abbrev>7</abbrev>
<dirty>-dirty</dirty>
<match>v*</match>
<tags>true</tags>
<forceLongFormat>false</forceLongFormat>
</gitDescribe>
<evaluateOnCommit>HEAD</evaluateOnCommit>
<useBranchNameFromBuildEnvironment>false</useBranchNameFromBuildEnvironment>
</configuration>

</plugin>

<!-- create single distribution file -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/descriptor.xml</descriptor>
</descriptors>
<tarLongFileMode>posix</tarLongFileMode>
</configuration>
<executions>
<execution>
<id>make-distribution</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<!-- Liquibase plugin for quick testing of database upgrades with following
command mvn package liquibase:updateSQL -->

<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase.version}</version>
<configuration>
<changeLogFile>src/main/resources/com/thinkbiganalytics/db/master.xml</changeLogFile>
<!--<driver>org.mariadb.jdbc.Driver</driver> -->
<!--<url>jdbc:mysql://localhost:3306/kylo</url> -->
<!--<username>root</username> -->
<!--<password>hadoop</password> -->
<verbose>false</verbose>
<logging>info</logging>
</configuration>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.0.0</version>
</dependency>
<!--<dependency> -->
<!--<groupId>com.microsoft.sqlserver</groupId> -->
<!--<artifactId>mssql-jdbc</artifactId> -->
<!--<version>6.2.1.jre7</version> -->
<!--</dependency> -->
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>${liquibase.version}</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.18.2-GA</version>
</dependency>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate4</artifactId>
<version>${liquibase-hibernate4.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>1.4.2.RELEASE</version>
</dependency>
</dependencies>
</plugin>

</plugins>
</build>

</project>
3 changes: 2 additions & 1 deletion services/service-app/src/main/resources/version.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
version=${pom.version}
build.date=${timestamp}
build.date=${timestamp}
git.commit.id=${git.commit.id}

0 comments on commit b112695

Please sign in to comment.