Skip to content
Snippets Groups Projects

Production Release | nshmp-haz

Merged Clayton, Brandon Scott requested to merge main into production
1 file
+ 32
20
Compare changes
  • Side-by-side
  • Inline
+ 32
20
@@ -15,9 +15,23 @@ ext {
nshmDir = "nshms";
// Download and unzip NSHM
downloadNshm = {repo, tag, year ->
downloadNshm = {repo, year ->
def yaml = new Yaml()
def nshmConfig = new Yaml().load(new File("${projectDir}/nshms.yml").newInputStream())
def nshm = nshmConfig.nshms.find{nshm -> nshm.repo == repo && nshm.year == year}
if (nshm == null) {
throw new Exception("NSHM ${repo} ${year} not found.")
}
def tag = nshm.tag
def zipName = "${repo}-${tag}.zip";
def zipFile = new File(nshmDir, zipName)
def nshmFile = file("${nshmDir}/${repo}-${year}")
if (nshmFile.exists()) {
delete nshmFile
}
download.run {
src "https://code.usgs.gov/ghsc/nshmp/nshms/${repo}/-/archive/${tag}/${zipName}"
@@ -27,7 +41,7 @@ ext {
from zipTree(zipFile)
into nshmDir
}
file("${nshmDir}/${repo}-${tag}").renameTo(file("${nshmDir}/${repo}-${year}"))
file("${nshmDir}/${repo}-${tag}").renameTo(nshmFile)
delete {
delete zipFile
}
@@ -39,25 +53,14 @@ task cleanNshm(type: Delete) {
}
clean.dependsOn cleanNshm
// Download all NSHMs
task nshms() {
dependsOn cleanNshm
def yaml = new Yaml()
def nshmConfig = new Yaml().load(new File("${projectDir}/nshms.yml").newInputStream())
doLast {
for (nshm in nshmConfig.nshms) {
// Download NSHM
downloadNshm(nshm.repo, nshm.tag, nshm.year)
}
}
}
// Test Alaska 2023 NSHM
task testAlaska2023(type: Test) {
description = "Test Alaska 2023 NSHM"
group = "verification"
dependsOn nshms
doFirst {
downloadNshm("nshm-alaska", 2023)
}
testLogging {
exceptionFormat "full"
@@ -78,7 +81,10 @@ task testAlaska2023(type: Test) {
task testConus2018(type: Test) {
description = "Test CONUS 2018 NSHM"
group = "verification"
dependsOn nshms
doFirst {
downloadNshm("nshm-conus", 2018)
}
testLogging {
exceptionFormat "full"
@@ -99,7 +105,10 @@ task testConus2018(type: Test) {
task testConus2023(type: Test) {
description = "Test CONUS 2023 NSHM"
group = "verification"
dependsOn nshms
doFirst {
downloadNshm("nshm-conus", 2023)
}
testLogging {
exceptionFormat "full"
@@ -120,7 +129,10 @@ task testConus2023(type: Test) {
task testHawaii2021(type: Test) {
description = "Test Hawaii 2021 NSHM"
group = "verification"
dependsOn nshms
doFirst {
downloadNshm("nshm-hawaii", 2021)
}
testLogging {
exceptionFormat "full"
Loading