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

Merge branch 'url' into 'main'

Git URL in Version Info

See merge request !267
parents 36c4ae8b 78ecfef7
No related branches found
No related tags found
1 merge request!267Git URL in Version Info
Pipeline #136538 passed
......@@ -5,6 +5,7 @@ tasks.withType(JavaCompile) {
def versionFile = new File("${projectDir}/src/main/resources/version/nshmp-lib-version.json")
new File(versionFile.getParent()).mkdirs()
def details = versionDetails()
def ciProjectUrl = System.getenv("CI_PROJECT_URL")
def versionInfo = [
branchName: details.branchName,
commitDistance: details.commitDistance,
......@@ -13,7 +14,7 @@ tasks.withType(JavaCompile) {
isCleanTag: details.isCleanTag,
lastTag: details.lastTag,
projectName: project.name,
url: '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,
]
def json = groovy.json.JsonOutput.toJson(versionInfo)
......
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