Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-ws
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-ws
Commits
8fd41ce2
Commit
8fd41ce2
authored
1 year ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
write empty file
parent
3b283670
No related branches found
No related tags found
2 merge requests
!202
Production Release
,
!201
Versions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gradle/app-version.gradle
+23
-16
23 additions, 16 deletions
gradle/app-version.gradle
with
23 additions
and
16 deletions
gradle/app-version.gradle
+
23
−
16
View file @
8fd41ce2
...
...
@@ -4,21 +4,28 @@ tasks.withType(JavaCompile) {
doFirst
{
def
versionFile
=
new
File
(
"${projectDir}/src/main/resources/version/nshmp-ws-version.json"
)
new
File
(
versionFile
.
getParent
()).
mkdirs
()
def
details
=
versionDetails
()
def
ciProjectUrl
=
System
.
getenv
(
"CI_PROJECT_URL"
)
def
branch
=
System
.
getenv
(
"CI_COMMIT_BRANCH"
)
def
versionInfo
=
[
branchName:
branch
?
branch
:
details
.
branchName
,
commitDistance:
details
.
commitDistance
,
gitHash:
details
.
gitHash
,
gitHashFull:
details
.
gitHashFull
,
isCleanTag:
details
.
isCleanTag
,
lastTag:
details
.
lastTag
,
projectName:
project
.
name
,
url:
ciProjectUrl
?
ciProjectUrl
:
'git config --get remote.origin.url'
.
execute
().
text
.
replace
(
'\n'
,
''
),
version:
details
.
version
,
]
def
json
=
groovy
.
json
.
JsonOutput
.
toJson
(
versionInfo
)
versionFile
.
write
(
groovy
.
json
.
JsonOutput
.
prettyPrint
(
json
))
try
{
def
details
=
versionDetails
()
def
ciProjectUrl
=
System
.
getenv
(
"CI_PROJECT_URL"
)
def
branch
=
System
.
getenv
(
"CI_COMMIT_BRANCH"
)
def
versionInfo
=
[
branchName:
branch
?
branch
:
details
.
branchName
,
commitDistance:
details
.
commitDistance
,
gitHash:
details
.
gitHash
,
gitHashFull:
details
.
gitHashFull
,
isCleanTag:
details
.
isCleanTag
,
lastTag:
details
.
lastTag
,
projectName:
project
.
name
,
url:
ciProjectUrl
?
ciProjectUrl
:
"git config --get remote.origin.url"
.
execute
().
text
.
replace
(
"\n"
,
""
),
version:
details
.
version
,
]
def
json
=
groovy
.
json
.
JsonOutput
.
toJson
(
versionInfo
)
versionFile
.
write
(
groovy
.
json
.
JsonOutput
.
prettyPrint
(
json
))
}
catch
(
Exception
e
)
{
println
(
"Failed to create version file. Writing blank file."
)
println
(
e
)
versionFile
.
write
(
'{}'
)
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment