Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-ws-static
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
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-ws-static
Merge requests
!142
Versions
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Versions
ghsc/users/bclayton/nshmp/nshmp-ws-static:versions
into
main
Overview
0
Commits
3
Pipelines
0
Changes
3
Merged
Clayton, Brandon Scott
requested to merge
ghsc/users/bclayton/nshmp/nshmp-ws-static:versions
into
main
1 year ago
Overview
0
Commits
3
Pipelines
0
Changes
3
Expand
Write empty JSON file if git fails.
Update deps.
0
0
Merge request reports
Compare
main
version 1
bb3a8776
1 year ago
main (base)
and
latest version
latest version
255e1b3f
3 commits,
1 year ago
version 1
bb3a8776
2 commits,
1 year ago
3 files
+
27
−
21
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
gradle/app-version.gradle
+
23
−
16
Options
@@ -4,21 +4,28 @@ tasks.withType(JavaCompile) {
doFirst
{
def
versionFile
=
new
File
(
"${projectDir}/src/main/resources/version/nshmp-ws-static-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:
rootProject
.
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
(
'{}'
)
}
}
}
Loading