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

Merge branch 'deploy-updates' into 'master'

Update Deployment

See merge request ghsc/nshmp/nshmp-netcdf!64
parents 4075e448 8230bfd1
No related branches found
No related tags found
1 merge request!64Update Deployment
Pipeline #53487 canceled
...@@ -19,67 +19,14 @@ include: ...@@ -19,67 +19,14 @@ include:
stages: stages:
- init - init
- build - build
- deploy
- trigger - trigger
####
# Template: Common Gradle test
####
.gradle: .gradle:
image: ${DEVOPS_REGISTRY}usgs/java:11-jdk image: ${DEVOPS_REGISTRY}usgs/java:11-jdk
stage: build stage: build
tags: tags:
- development - development
.templates:
adjust-ref: &adjust-ref |
if [[ \
${CI_COMMIT_REF_SLUG} == "master" || \
${CI_COMMIT_REF_SLUG} == "production" || \
-n "${CI_COMMIT_TAG}" \
]]; then
CI_COMMIT_REF_SLUG="latest";
fi
####
# Template: Deploy to Docker Swarm
####
.deploy:
cache: {}
image: ${CODE_REGISTRY}/ghsc/hazdev/cloud-formation/hazdev-build-runner:latest
dependencies:
script:
- *adjust-ref
- git clone ${GENERIC_SWARM_DEPLOY_REPO} generic-deploy
- export REGISTRY=${CODE_REGISTRY_IMAGE}
- cp -v
generic-deploy/default.config.sh
generic-deploy/default.funcs.sh
generic-deploy/deploy.sh
scripts/.
- scripts/deploy.sh
stage: deploy
tags:
- deploy
- swarm
variables:
APP_NAME: nshmp-netcdf
STACK_NAME: nshmp-netcdf
.onprem-staging:
only:
- master@ghsc/nshmp/nshmp-netcdf
- tags@ghsc/nshmp/nshmp-netcdf
.staging01:
tags:
- staging01
.staging02:
tags:
- staging02
#### ####
# Stage: init # Stage: init
#### ####
...@@ -187,29 +134,6 @@ YAML Lint: ...@@ -187,29 +134,6 @@ YAML Lint:
- ./gradlew yamllint; - ./gradlew yamllint;
stage: build stage: build
####
# Stage: deploy
####
Staging 01:
extends:
- .deploy
- .onprem-staging
- .staging01
needs:
- Build Image 2018
- Build Project
- Init
- Markdown Lint
- Unit Tests
- YAML Lint
# Staging 02:
# extends:
# - .deploy
# - .onprem-staging
# - .staging02
#### ####
# Stage: trigger # Stage: trigger
#### ####
...@@ -224,21 +148,22 @@ Trigger nshmp-webapps: ...@@ -224,21 +148,22 @@ Trigger nshmp-webapps:
when: manual when: manual
- !reference [.staging-env] - !reference [.staging-env]
- !reference [.production-env] - !reference [.production-env]
parallel:
matrix:
- REGION: us-west-2
script: script:
- apk add curl - apk add curl
- | - |
curl --request POST \ if [ "${ENVIRONMENT}" == 'production' ]; then
REF="production";
fi
- |
curl --request POST \
--form token=${NSHMP_WEBAPPS_CDK_TRIGGER_TOKEN} \ --form token=${NSHMP_WEBAPPS_CDK_TRIGGER_TOKEN} \
--form ref=main \ --form ref=${REF} \
--form description="Triggered by nshmp-netcdf" \ --form "variables[description]=Triggered by nshmp-netcdf" \
--form "variables[CDK_DEPLOY_REGION]=${REGION}" \
--form "variables[ENVIRONMENT]=${ENVIRONMENT}" \ --form "variables[ENVIRONMENT]=${ENVIRONMENT}" \
--form "variables[IMAGE]=${IMAGE_NAME}" \ --form "variables[NSHMP_APPS_IMAGE]=${IMAGE_NAME}" \
--form "variables[STACK_NAME]=nshmp-netcdf-conus-2018a" \ --form "variables[TRIGGER_PASSCODE]=${NSHMP_WEBAPPS_CDK_TRIGGER_TOKEN}" \
"https://code.chs.usgs.gov/api/v4/projects/${NSHMP_WEBAPPS_CDK_PROJECT_ID}/trigger/pipeline" "https://${PRIVATE_GITLAB}/api/v4/projects/${NSHMP_WEBAPPS_CDK_PROJECT_ID}/trigger/pipeline"
stage: trigger stage: trigger
variables: variables:
REF: main
UPSTREAM_PATH: ghsc/nshmp/nshmp-netcdf UPSTREAM_PATH: ghsc/nshmp/nshmp-netcdf
export SERVICE_MAP=(
"/nshmp/ws/conus-2018/static":"conus-2018a"
);
version: "3.7"
# General deployment config
x-app: &app
deploy:
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
replicas: 1
update_config:
order: start-first
parallelism: 1
ports:
- 8080
services:
# Deploy nshmp-netcdf with CONUS 2018A static data
conus-2018a:
<<: *app
image: '${REGISTRY}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_SLUG}'
environment:
NSHM: 'CONUS_2018A'
CONTEXT_PATH: '/nshmp/ws/conus-2018/static'
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