Skip to content
Snippets Groups Projects

Update algorithms job

Files
2
+ 45
11
image: ${DEVOPS_REGISTRY}usgs/centos:latest
cache:
paths:
# cache pip installed dependencies, see PIP_CACHE_DIR variable below
- .cache/pip
stages:
- test
- integration
@@ -9,6 +14,7 @@ stages:
variables:
CI_REGISTRY: ${CODE_REGISTRY}
CI_REGISTRY_IMAGE: ${CODE_REGISTRY_IMAGE}
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
TRIVY_VERSION: "0.11.0"
# docker variables
DOCKER_DRIVER: overlay2
@@ -61,7 +67,6 @@ variables:
- build
.check_code:
cache: {}
image: ${DEVOPS_REGISTRY}usgs/conda:latest
script:
- export PYTHON_VERSION=${PYTHON_VERSION:-3.8}
@@ -98,11 +103,29 @@ variables:
- deploy
- swarm
.mage:
.deploy-library:
cache: {}
image: "docker:stable-git"
script:
- PREFIX_LENGTH=${#REQUIRED_PREFIX};
- if [[ "${APP_DEPLOY_DIR:0:${PREFIX_LENGTH}}" != "${REQUIRED_PREFIX}" ]]; then
echo "APP_DEPLOY_DIR does not contain correct path";
exit 255;
fi
- if [ ! -d "${APP_DEPLOY_DIR}" ]; then
cd "$(dirname "${APP_DEPLOY_DIR}")";
git clone "${CI_REPOSITORY_URL}" "$(basename "${APP_DEPLOY_DIR}")";
fi
- cd "${APP_DEPLOY_DIR}";
- git checkout "${CI_COMMIT_REF_NAME}" || git checkout -b "${CI_COMMIT_REF_NAME}";
- git pull --ff-only "${CI_REPOSITORY_URL}" "${CI_COMMIT_REF_NAME}";
stage: deploy
tags:
- deploy
- swarm
variables:
DATA_HOST: "cwbpub.cr.usgs.gov"
DATA_PORT: "2060"
DATA_TYPE: "edge"
APP_DEPLOY_DIR: '/geomag/geomag-algorithms'
REQUIRED_PREFIX: '/geomag'
.staging:
only:
@@ -182,7 +205,18 @@ Scan Docker Image:
# Deploy Stage
## --------------------------------------------------
Deploy Mage01:
Deploy Mage01 Library:
extends:
- .deploy-library
- .staging
tags:
- deploy
- swarm
- mage01
variables:
APP_NAME: geomag-algorithms
Deploy Mage01 Web Service:
extends:
- .deploy
- .staging
@@ -193,7 +227,7 @@ Deploy Mage01:
variables:
APP_NAME: geomag-algorithms
Deploy Mage02:
Deploy Mage02 Web Service:
extends:
- .deploy
- .production
@@ -204,7 +238,7 @@ Deploy Mage02:
variables:
APP_NAME: geomag-algorithms
Deploy Algorithms Production01:
Deploy Production01 Web Service:
extends:
- .deploy
- .production
@@ -215,7 +249,7 @@ Deploy Algorithms Production01:
variables:
APP_NAME: geomag-algorithms
Deploy Algorithms Production02:
Deploy Production02 Web Service:
extends:
- .deploy
- .production
@@ -226,7 +260,7 @@ Deploy Algorithms Production02:
variables:
APP_NAME: geomag-algorithms
Deploy Algorithms Staging01:
Deploy Staging01 Web Service:
extends:
- .deploy
- .staging
@@ -237,7 +271,7 @@ Deploy Algorithms Staging01:
variables:
APP_NAME: geomag-algorithms
Deploy Algorithms Staging02:
Deploy Staging02 Web Service:
extends:
- .deploy
- .staging
Loading