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

update trigger, remove deploy

parent acce7c7d
No related branches found
No related tags found
1 merge request!64Update Deployment
......@@ -19,54 +19,14 @@ include:
stages:
- init
- build
- deploy
- trigger
####
# Template: Common Gradle test
####
.gradle:
image: ${DEVOPS_REGISTRY}usgs/java:11-jdk
stage: build
tags:
- 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:
- docker stack rm nshmp-netcdf
stage: deploy
tags:
- deploy
- swarm
variables:
APP_NAME: nshmp-netcdf
STACK_NAME: nshmp-netcdf
.staging01:
tags:
- staging01
.staging02:
tags:
- staging02
####
# Stage: init
####
......@@ -174,22 +134,6 @@ YAML Lint:
- ./gradlew yamllint;
stage: build
####
# Stage: deploy
####
Staging 01:
extends:
- .deploy
- .staging01
needs: []
Staging 02:
extends:
- .deploy
- .staging02
needs: []
####
# Stage: trigger
####
......@@ -204,21 +148,22 @@ Trigger nshmp-webapps:
when: manual
- !reference [.staging-env]
- !reference [.production-env]
parallel:
matrix:
- REGION: us-west-2
script:
- apk add curl
- |
curl --request POST \
if [ "${ENVIRONMENT}" == 'production' ]; then
REF="production";
fi
- |
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 ref=${REF} \
--form "variables[description]=Triggered by nshmp-netcdf" \
--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"
--form "variables[NSHMP_APPS_IMAGE]=${IMAGE_NAME}" \
--form "variables[TRIGGER_PASSCODE]=${NSHMP_WEBAPPS_CDK_TRIGGER_TOKEN}" \
"https://${PRIVATE_GITLAB}/api/v4/projects/${NSHMP_WEBAPPS_CDK_PROJECT_ID}/trigger/pipeline"
stage: trigger
variables:
REF: main
UPSTREAM_PATH: ghsc/nshmp/nshmp-netcdf
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