Skip to content
Snippets Groups Projects
Commit 7b0164e5 authored by Jeremy M Fee's avatar Jeremy M Fee
Browse files

Update pipeline

parent e0199301
No related branches found
No related tags found
2 merge requests!146Release CMO metadata to production,!20Pipeline update
---
include:
- project: 'ghsc/hazdev/pipeline-build-template'
ref: 'master'
file: 'templates/library.yml'
image: ${DEVOPS_REGISTRY}usgs/centos:latest image: ${DEVOPS_REGISTRY}usgs/centos:latest
stages: stages:
...@@ -14,6 +8,14 @@ stages: ...@@ -14,6 +8,14 @@ stages:
variables: variables:
CI_REGISTRY: ${CODE_REGISTRY} CI_REGISTRY: ${CODE_REGISTRY}
CI_REGISTRY_IMAGE: ${CODE_REGISTRY_IMAGE} CI_REGISTRY_IMAGE: ${CODE_REGISTRY_IMAGE}
# docker variables
FROM_IMAGE: ${CODE_REGISTRY}/devops/images/usgs/centos:latest
# environment variables
APP_NAME: geomag-algorithms
DATA_HOST: 'cwbpub.cr.usgs.gov'
DATA_PORT: '2060'
DATA_TYPE: 'edge'
## -------------------------------------------------- ## --------------------------------------------------
# Templates # Templates
...@@ -30,7 +32,11 @@ variables: ...@@ -30,7 +32,11 @@ variables:
cache: {} cache: {}
extends: extends:
- .adjust_image_names - .adjust_image_names
- .dind image: docker:19.03-git
only:
- master@ghsc/geomag/geomag-algorithms
- production@ghsc/geomag/geomag-algorithms
- tags@ghsc/geomag/geomag-algorithms
script: script:
- docker build - docker build
--pull --pull
...@@ -46,11 +52,11 @@ variables: ...@@ -46,11 +52,11 @@ variables:
- docker tag local/${IMAGE_NAME} ${INTERNAL_IMAGE_NAME} - docker tag local/${IMAGE_NAME} ${INTERNAL_IMAGE_NAME}
- docker push ${INTERNAL_IMAGE_NAME} - docker push ${INTERNAL_IMAGE_NAME}
- docker image rm ${INTERNAL_IMAGE_NAME} - docker image rm ${INTERNAL_IMAGE_NAME}
services:
- docker:19.03-dind
stage: integration stage: integration
tags: tags:
- build - build
variables:
FROM_IMAGE: ${CODE_REGISTRY}/devops/images/usgs/centos:latest
.check_code: .check_code:
cache: {} cache: {}
...@@ -89,6 +95,7 @@ variables: ...@@ -89,6 +95,7 @@ variables:
generic-deploy/default.funcs.sh generic-deploy/default.funcs.sh
generic-deploy/deploy.sh generic-deploy/deploy.sh
scripts/. scripts/.
- export APP_NAME=${APP_NAME} - export APP_NAME=${APP_NAME}
- export IMAGE_NAME=${IMAGE_NAME} - export IMAGE_NAME=${IMAGE_NAME}
- export REGISTRY=${CI_REGISTRY_IMAGE} - export REGISTRY=${CI_REGISTRY_IMAGE}
...@@ -98,8 +105,6 @@ variables: ...@@ -98,8 +105,6 @@ variables:
tags: tags:
- deploy - deploy
- swarm - swarm
variables:
APP_NAME: geomag-algorithms
.mage: .mage:
variables: variables:
...@@ -107,13 +112,20 @@ variables: ...@@ -107,13 +112,20 @@ variables:
DATA_PORT: '2060' DATA_PORT: '2060'
DATA_TYPE: 'edge' DATA_TYPE: 'edge'
.mage01: .staging:
tags: only:
- mage01 - master@ghsc/geomag/geomag-plots
- tags@ghsc/geomag/geomag-plots
.production:
except:
- ^.*beta.*$
- ^.*-rc.*$
only:
- tags@ghsc/geomag/geomag-plots
- production@ghsc/geomag/geomag-plots
when: manual
.mage02:
tags:
- mage02
## -------------------------------------------------- ## --------------------------------------------------
# Test Stage # Test Stage
...@@ -137,23 +149,20 @@ Check Python 3.8: ...@@ -137,23 +149,20 @@ Check Python 3.8:
variables: variables:
PYTHON_VERSION: '3.8' PYTHON_VERSION: '3.8'
## -------------------------------------------------- ## --------------------------------------------------
# Integration Stage # Integration Stage
## -------------------------------------------------- ## --------------------------------------------------
Build Staging Docker Image: Build Docker Image:
extends: extends:
- .build_docker_image - .build_docker_image
- .staging
variables: variables:
APP_NAME: geomag-algorithms APP_NAME: geomag-algorithms
Build Production Docker Image:
extends: # TODO: Penetration testing (e.g. OWASP ZAP etc...)
- .build_docker_image
- .production
variables:
APP_NAME: geomag-algorithms
## -------------------------------------------------- ## --------------------------------------------------
# Deploy Stage # Deploy Stage
...@@ -163,8 +172,10 @@ Deploy Mage01: ...@@ -163,8 +172,10 @@ Deploy Mage01:
extends: extends:
- .deploy - .deploy
- .staging - .staging
- .mage tags:
- .mage01 - deploy
- swarm
- mage01
variables: variables:
APP_NAME: geomag-algorithms APP_NAME: geomag-algorithms
...@@ -172,7 +183,54 @@ Deploy Mage02: ...@@ -172,7 +183,54 @@ Deploy Mage02:
extends: extends:
- .deploy - .deploy
- .production - .production
- .mage tags:
- .mage02 - deploy
- swarm
- mage02
variables:
APP_NAME: geomag-algorithms
Deploy Algorithms Production01:
extends:
- .deploy
- .production
tags:
- deploy
- swarm
- production01
variables:
APP_NAME: geomag-algorithms
Deploy Algorithms Production02:
extends:
- .deploy
- .production
tags:
- deploy
- swarm
- production02
variables:
APP_NAME: geomag-algorithms
Deploy Algorithms Staging01:
extends:
- .deploy
- .staging
tags:
- deploy
- swarm
- staging01
variables:
APP_NAME: geomag-algorithms
Deploy Algorithms Staging02:
extends:
- .deploy
- .staging
tags:
- deploy
- swarm
- staging02
variables: variables:
APP_NAME: geomag-algorithms APP_NAME: geomag-algorithms
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