Skip to content
Snippets Groups Projects
Commit 2ed44352 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

Merge branch 'version-info' into 'main'

simplify app version

See merge request !760
parents 81a6a68b e87219ea
No related branches found
No related tags found
1 merge request!760simplify app version
Pipeline #320771 passed
...@@ -12,8 +12,8 @@ micronautVersion = 3.2.3 ...@@ -12,8 +12,8 @@ micronautVersion = 3.2.3
micronautRxVersion = 2.1.1 micronautRxVersion = 2.1.1
nodePluginVersion = 3.0.1 nodePluginVersion = 3.0.1
nodeVersion = 16.3.0 nodeVersion = 16.3.0
nshmpLibVersion = 1.4.1 nshmpLibVersion = 1.4.2
nshmpWsUtilsVersion = 0.3.13 nshmpWsUtilsVersion = 0.3.14
openApiVersion = 4.0.0 openApiVersion = 4.0.0
shadowVersion = 7.1.2 shadowVersion = 7.1.2
spotbugsVersion = 4.7.0 spotbugsVersion = 4.7.0
......
...@@ -9,14 +9,8 @@ tasks.withType(JavaCompile) { ...@@ -9,14 +9,8 @@ tasks.withType(JavaCompile) {
try { try {
def details = versionDetails() def details = versionDetails()
def ciProjectUrl = System.getenv("CI_PROJECT_URL") def ciProjectUrl = System.getenv("CI_PROJECT_URL")
def branch = System.getenv("CI_COMMIT_BRANCH")
def versionInfo = [ def versionInfo = [
branchName: branch ? branch : details.branchName, gitHash: details.gitHashFull,
commitDistance: details.commitDistance,
gitHash: details.gitHash,
gitHashFull: details.gitHashFull,
isCleanTag: details.isCleanTag,
lastTag: details.lastTag,
projectName: project.name, projectName: project.name,
url: ciProjectUrl ? ciProjectUrl : "git config --get remote.origin.url".execute().text.replace("\n", ""), url: ciProjectUrl ? ciProjectUrl : "git config --get remote.origin.url".execute().text.replace("\n", ""),
version: details.version, version: details.version,
......
...@@ -46,7 +46,6 @@ public class HazVersion implements AppVersion { ...@@ -46,7 +46,6 @@ public class HazVersion implements AppVersion {
try { try {
var git = Git.open(modelPath.toFile()); var git = Git.open(modelPath.toFile());
var repo = git.getRepository(); var repo = git.getRepository();
var hash = repo.getRefDatabase().findRef("HEAD").getObjectId().name();
var url = repo var url = repo
.getConfig() .getConfig()
.getString("remote", "origin", "url") .getString("remote", "origin", "url")
...@@ -56,14 +55,9 @@ public class HazVersion implements AppVersion { ...@@ -56,14 +55,9 @@ public class HazVersion implements AppVersion {
return VersionInfo.builder() return VersionInfo.builder()
.projectName(projectName) .projectName(projectName)
.url(repo.getConfig().getString("remote", "origin", "url")) .url(url)
.version(git.describe().call()) .version(git.describe().call())
.branchName(repo.getBranch()) .gitHash(repo.getRefDatabase().findRef("HEAD").getObjectId().name())
.commitDistance(0)
.gitHash(hash.substring(0, 10))
.gitHashFull(hash)
.isCleanTag(git.status().call().isClean())
.lastTag("")
.build(); .build();
} catch (Exception e) { } catch (Exception e) {
return null; return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment