diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a866b7c66c9baa05bbf19f69ae0068caf460b500..e5a22a7ae27c5a4078fa67667b82792d494aa8ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,67 +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: - - *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 #### @@ -187,29 +134,6 @@ YAML Lint: - ./gradlew yamllint; 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 #### @@ -224,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 diff --git a/scripts/custom.config.sh b/scripts/custom.config.sh deleted file mode 100644 index 496b3b0c57f8bda23f8df8f8a679aba38f26b667..0000000000000000000000000000000000000000 --- a/scripts/custom.config.sh +++ /dev/null @@ -1,3 +0,0 @@ -export SERVICE_MAP=( - "/nshmp/ws/conus-2018/static":"conus-2018a" -); diff --git a/scripts/nshmp-netcdf.yml b/scripts/nshmp-netcdf.yml deleted file mode 100644 index 1f1ff7b0aadcf1f94cf26c0e406212643d168bb9..0000000000000000000000000000000000000000 --- a/scripts/nshmp-netcdf.yml +++ /dev/null @@ -1,25 +0,0 @@ -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'