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
Commits
7d89eb99
Commit
7d89eb99
authored
5 months ago
by
Shavers, Nicholas H
Browse files
Options
Downloads
Plain Diff
Merge branch '124-use-projects-container-reg' into 'master'
Use Project's Container Registry Closes
#124
See merge request
!348
parents
c921ba99
be1177a9
No related branches found
No related tags found
1 merge request
!348
Use Project's Container Registry
Pipeline
#510550
canceled
5 months ago
Stage: init
Stage: test
Stage: integration
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+10
-21
10 additions, 21 deletions
.gitlab-ci.yml
with
10 additions
and
21 deletions
.gitlab-ci.yml
+
10
−
21
View file @
7d89eb99
...
...
@@ -25,9 +25,10 @@ workflow:
.adjust_image_names
:
before_script
:
-
IMAGE_NAME=
usgs/
${APP_NAME}:${CI_COMMIT_REF_SLUG}
-
IMAGE_NAME=${APP_NAME}:${CI_COMMIT_REF_SLUG}
-
IMAGE_NAME=${IMAGE_NAME/:master/:latest}
-
INTERNAL_IMAGE_NAME=${CODE_REGISTRY_IMAGE}/${IMAGE_NAME}
-
PROJECT_IMAGE_NAME=$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
-
PROJECT_IMAGE_NAME=${PROJECT_IMAGE_NAME/:master/:latest}
.deploy
:
extends
:
...
...
@@ -41,7 +42,7 @@ workflow:
scripts/.
-
export APP_NAME=${APP_NAME}
-
export IMAGE_NAME=${IMAGE_NAME}
-
export REGISTRY=${C
ODE
_REGISTRY_IMAGE}
-
export REGISTRY=${C
I
_REGISTRY_IMAGE}
-
export STACK_NAME=${APP_NAME}
-
./scripts/deploy.sh
stage
:
deploy
...
...
@@ -91,13 +92,6 @@ workflow:
# template for jobs that need docker-in-docker
.dind
:
# TODO: refactor Docker build to different runner
# before_script:
# - |
# echo "${CI_REGISTRY_PASSWORD}" | docker login \
# --username "${CI_REGISTRY_USER}" \
# --password-stdin \
# "${CI_REGISTRY}"
image
:
code.usgs.gov:5001/devops/images/usgs/docker:20
services
:
-
alias
:
docker
...
...
@@ -216,20 +210,15 @@ Build Docker Image:
# fail HIGH,CRITICAL vulnerabilities
-
trivy image --exit-code 1 --severity HIGH,CRITICAL "${LOCAL_IMAGE}";
## push image
-
if [ "${CI_PROJECT_PATH}" != "${UPSTREAM_PATH}" ]; then
echo "Skipping push on non-upstream (${CI_PROJECT_PATH})";
exit 0;
fi
-
|
for IMAGE in "${INTERNAL_IMAGE_NAME}"; do
docker tag "${LOCAL_IMAGE}" "${IMAGE}";
docker push "${IMAGE}";
done
## push image to user or project registries
-
echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
-
docker tag "${LOCAL_IMAGE}" "${PROJECT_IMAGE_NAME}";
-
docker push "${PROJECT_IMAGE_NAME}";
stage
:
integration
tags
:
# TODO: refactor to separate build/publish steps
-
build
-
deploy
variables
:
APP_NAME
:
geomag-algorithms
FROM_IMAGE
:
code.usgs.gov:5001/devops/images/usgs/python:3.10-obspy
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment