Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Geomagnetism Program
geomag-algorithms
Merge requests
!2
Gitlab tests2
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Gitlab tests2
ghsc/users/trivers/geomag-algorithms:gitlabTests2
into
master
Overview
1
Commits
46
Pipelines
0
Changes
1
All threads resolved!
Hide all comments
Merged
Rivers, Travis (Contractor) Creighton
requested to merge
ghsc/users/trivers/geomag-algorithms:gitlabTests2
into
master
4 years ago
Overview
1
Commits
46
Pipelines
0
Changes
1
All threads resolved!
Hide all comments
Expand
0
0
Merge request reports
Viewing commit
fd2784ed
Prev
Next
Show latest version
1 file
+
213
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
fd2784ed
new stuff
· fd2784ed
Rivers, Travis (Contractor) Creighton
authored
4 years ago
.gitlab-ci.yml
0 → 100644
+
213
−
0
Options
image
:
usgs/centos:8
stages
:
-
test
-
integration
-
deploy
variables
:
CI_REGISTRY
:
${CODE_REGISTRY}
CI_REGISTRY_IMAGE
:
${CODE_REGISTRY_IMAGE}
## --------------------------------------------------
# Templates
## --------------------------------------------------
.adjust_image_names
:
before_script
:
-
IMAGE_NAME=usgs/${APP_NAME}:${CI_COMMIT_REF_SLUG}
-
IMAGE_NAME=${IMAGE_NAME/:master/:latest}
-
INTERNAL_IMAGE_NAME=${CI_REGISTRY_IMAGE}/${IMAGE_NAME}
-
STACK_NAME=${APP_NAME}
.build_docker_image
:
cache
:
{}
extends
:
-
.adjust_image_names
image
:
${CODE_REGISTRY}/ghsc/hazdev/cloud-formation/hazdev-build-runner:latest
only
:
-
master@ghsc/geomag/geomag-plots
-
production@ghsc/geomag/geomag-plots
-
tags@ghsc/geomag/geomag-plots
script
:
-
docker build
--pull
--build-arg APP_NAME=${APP_NAME}
--build-arg FROM_IMAGE=${FROM_IMAGE}
--build-arg GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME}
--build-arg GIT_COMMIT_SHA=${CI_COMMIT_SHA}
--tag local/${IMAGE_NAME} .
-
docker tag local/${IMAGE_NAME} ${IMAGE_NAME}
-
docker push ${IMAGE_NAME}
-
docker image rm ${IMAGE_NAME}
-
docker tag local/${IMAGE_NAME} ${INTERNAL_IMAGE_NAME}
-
docker push ${INTERNAL_IMAGE_NAME}
-
docker image rm ${INTERNAL_IMAGE_NAME}
stage
:
integration
tags
:
-
build
variables
:
FROM_IMAGE
:
${CODE_REGISTRY}/devops/images/usgs/centos:latest
.check_code
:
cache
:
{}
image
:
usgs/centos:latest
script
:
-
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
-
bash miniconda.sh -b -p $HOME/miniconda
-
export PATH="$HOME/miniconda/bin:$PATH"
-
conda config --set always_yes yes --set changeps1 no
-
conda update --yes conda
-
conda info -a
# Install Project Dependencies
-
conda config --add channels conda-forge
-
conda create -q -n test-environment python=${PYTHON_VERSION} obspy pycurl
-
source activate test-environment
-
pip install pipenv
-
pipenv --site-packages install --dev
# Run Code Checks
-
black --check .
-
pytest
stage
:
test
tags
:
-
development
variables
:
PYTHON_VERSION
:
3.8
.deploy
:
cache
:
{}
extends
:
-
.adjust_image_names
image
:
${CODE_REGISTRY}/ghsc/hazdev/cloud-formation/hazdev-build-runner:latest
script
:
-
git clone ${GENERIC_SWARM_DEPLOY_REPO} generic-deploy
-
export REGISTRY=${CI_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
.staging
:
only
:
-
master@ghsc/geomag/geomag-plots
-
tags@ghsc/geomag/geomag-plots
.staging01
:
tags
:
-
staging01
.staging02
:
tags
:
-
staging02
.mage
:
variables
:
USGS_ONLY
:
'
false'
.mage01
:
tags
:
-
mage01
.production
:
except
:
-
^.*beta.*$
-
^.*-rc.*$
only
:
-
tags@ghsc/geomag/geomag-plots
-
production@ghsc/geomag/geomag-plots
when
:
manual
.production01
:
tags
:
-
production01
.production02
:
tags
:
-
production02
## --------------------------------------------------
# Test Stage
## --------------------------------------------------
Check Python 3.6
:
extends
:
-
.check_code
variables
:
PYTHON_VERSION
:
3.6
Check Python 3.7
:
extends
:
-
.check_code
variables
:
PYTHON_VERSION
:
3.7
Check Python 3.8
:
extends
:
-
.check_code
variables
:
PYTHON_VERSION
:
3.8
## --------------------------------------------------
# Integration Stage
## --------------------------------------------------
Build Algorithms Image
:
extends
:
-
.build_docker_image
variables
:
APP_NAME
:
geomag-algorithms
# TODO: Penetration testing (e.g. OWASP ZAP etc...)
## --------------------------------------------------
# Deploy Stage
## --------------------------------------------------
# Deploy Production01:
# extends:
# - .deploy
# - .production
# - .production01
# variables:
# APP_NAME: geomag-plots
# Deploy Production02:
# extends:
# - .deploy
# - .production
# - .production02
# variables:
# APP_NAME: geomag-plots
# Deploy Staging01:
# extends:
# - .deploy
# - .staging
# - .staging01
# variables:
# APP_NAME: geomag-plots
# Deploy Staging02:
# extends:
# - .deploy
# - .staging
# - .staging02
# variables:
# APP_NAME: geomag-plots
# Deploy Mage01:
# extends:
# - .deploy
# - .staging
# - .mage
# - .mage01
# variables:
# APP_NAME: geomag-plots
Loading