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

Merge branch 'upstream-path' into 'master'

add upstream path

Closes #20

See merge request ghsc/nshmp/nshmp-netcdf!63
parents 2a6cfe8a 7b0a892a
No related branches found
No related tags found
1 merge request!63add upstream path
Pipeline #52964 passed
variables: variables:
DATA_CONUS_2018A: conus-2018a DATA_CONUS_2018A: conus-2018a
DATA_URL: ${S3_BUCKET}/nshmp_2018a_v1.1-CONUS-hazards-with-preliminary-PGV-fv0.3-1x1.nc DATA_URL: ${S3_BUCKET}/nshmp_2018a_v1.1-CONUS-hazards-with-preliminary-PGV-fv0.3-1x1.nc
IMAGE_NAME: ${CODE_REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${ENVIRONMENT}-${CI_COMMIT_SHORT_SHA}
# TODO: Remove hard coded url # TODO: Remove hard coded url
S3_BUCKET: https://nshmp-netcdf-lp-development-rbucket-1of3d1x45yfd9.s3-us-west-2.amazonaws.com S3_BUCKET: https://nshmp-netcdf-lp-development-rbucket-1of3d1x45yfd9.s3-us-west-2.amazonaws.com
# Do not run for merge requests # Do not run for merge requests
workflow: workflow:
rules: rules:
...@@ -20,6 +20,7 @@ stages: ...@@ -20,6 +20,7 @@ stages:
- init - init
- build - build
- deploy - deploy
- trigger
#### ####
# Template: Common Gradle test # Template: Common Gradle test
...@@ -31,7 +32,6 @@ stages: ...@@ -31,7 +32,6 @@ stages:
tags: tags:
- development - development
.templates: .templates:
adjust-ref: &adjust-ref | adjust-ref: &adjust-ref |
if [[ \ if [[ \
...@@ -105,6 +105,7 @@ Build Image 2018: ...@@ -105,6 +105,7 @@ Build Image 2018:
FROM_IMAGE=${DEVOPS_REGISTRY}usgs/java:11 FROM_IMAGE=${DEVOPS_REGISTRY}usgs/java:11
ci_job_token=${CI_JOB_TOKEN} ci_job_token=${CI_JOB_TOKEN}
netcdf_file=DATA/data.nc netcdf_file=DATA/data.nc
UPSTREAM_PATH: ghsc/nshmp/nshmp-netcdf
Build Project: Build Project:
extends: extends:
...@@ -133,6 +134,8 @@ Unit Tests: ...@@ -133,6 +134,8 @@ Unit Tests:
coverage: '/Total.*?([0-9]{1,3})%/' coverage: '/Total.*?([0-9]{1,3})%/'
extends: extends:
- .gradle - .gradle
needs:
- Init
rules: rules:
- -
changes: changes:
...@@ -152,6 +155,8 @@ Unit Tests: ...@@ -152,6 +155,8 @@ Unit Tests:
Markdown Lint: Markdown Lint:
extends: extends:
- .gradle - .gradle
needs:
- Init
rules: rules:
- -
changes: changes:
...@@ -168,6 +173,8 @@ Markdown Lint: ...@@ -168,6 +173,8 @@ Markdown Lint:
YAML Lint: YAML Lint:
extends: extends:
- .gradle - .gradle
needs:
- Init
rules: rules:
- -
changes: changes:
...@@ -189,9 +196,49 @@ Staging 01: ...@@ -189,9 +196,49 @@ Staging 01:
- .deploy - .deploy
- .onprem-staging - .onprem-staging
- .staging01 - .staging01
needs:
- Build Image 2018
- Build Project
- Init
- Markdown Lint
- Unit Tests
- YAML Lint
# Staging 02: # Staging 02:
# extends: # extends:
# - .deploy # - .deploy
# - .onprem-staging # - .onprem-staging
# - .staging02 # - .staging02
####
# Stage: trigger
####
Trigger nshmp-webapps:
needs:
- Build Image 2018
rules:
-
if: !reference [.development-env, if]
variables: !reference [.development-env, variables]
when: manual
- !reference [.staging-env]
- !reference [.production-env]
parallel:
matrix:
- REGION: us-west-2
script:
- apk add curl
- |
curl --request POST \
--form token=${NSHMP_WEBAPPS_CDK_TRIGGER_TOKEN} \
--form ref=main \
--form description="Triggered by nshmp-netcdf" \
--form "variables[CDK_DEPLOY_REGION]=${REGION}" \
--form "variables[ENVIRONMENT]=${ENVIRONMENT}" \
--form "variables[IMAGE]=${IMAGE_NAME}" \
--form "variables[STACK_NAME]=nshmp-netcdf-conus-2018a" \
"https://code.chs.usgs.gov/api/v4/projects/${NSHMP_WEBAPPS_CDK_PROJECT_ID}/trigger/pipeline"
stage: trigger
variables:
UPSTREAM_PATH: ghsc/nshmp/nshmp-netcdf
...@@ -31,6 +31,7 @@ ext { ...@@ -31,6 +31,7 @@ ext {
apply from: "${projectDir}/gradle/repositories.gradle" apply from: "${projectDir}/gradle/repositories.gradle"
apply from: "${projectDir}/gradle/dependencies.gradle" apply from: "${projectDir}/gradle/dependencies.gradle"
apply from: "${projectDir}/gradle/node.gradle"
test { test {
useJUnitPlatform() useJUnitPlatform()
...@@ -99,7 +100,6 @@ gradle.afterProject { ...@@ -99,7 +100,6 @@ gradle.afterProject {
into nshmpLib into nshmpLib
} }
apply from: "${nshmpLibGradleDir}/git-hooks.gradle" apply from: "${nshmpLibGradleDir}/git-hooks.gradle"
apply from: "${nshmpLibGradleDir}/node.gradle"
apply from: "${nshmpLibGradleDir}/spotbugs.gradle" apply from: "${nshmpLibGradleDir}/spotbugs.gradle"
apply from: "${nshmpLibGradleDir}/spotless.gradle" apply from: "${nshmpLibGradleDir}/spotless.gradle"
} }
apply plugin: "com.github.node-gradle.node"
node {
download = true
version = "14.16.0"
}
/* Install markdownlint-cli with NPM */
task nodeInstall(type: NpmTask) {
description "Install markdownlint-clia and yamllint with NPM"
args = [
"install",
"markdownlint-cli",
"yaml-lint",
"--save-dev",
"--loglevel",
"error"
]
}
/* Run markdownlint */
task markdownlint(type: NpxTask) {
description "Run markdownlint"
dependsOn nodeInstall
command = "markdownlint"
args = ["**/*.md"]
}
/* Apply markdownlint fixes */
task markdownlintApply(type: NpxTask) {
description "Apply markdownlint fixes"
dependsOn nodeInstall
command = "markdownlint"
args = [
"**/*.md",
"--fix",
]
}
/* Run yamllint */
task yamllint(type: NpxTask) {
description "Run yamllint"
dependsOn nodeInstall
command = "yamllint"
args = [
"**/*.yml",
"--ignore=.gradle/**",
"--ignore=node_modules/**",
"--ignore=.gitlab-ci.yml"
]
}
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