Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
frozen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
CSE6
frozen
Commits
424f7651
Verified
Commit
424f7651
authored
2 years ago
by
Teemu Autto
Browse files
Options
Downloads
Patches
Plain Diff
Simplified build pipeline.
parent
0961c858
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+14
-19
14 additions, 19 deletions
.gitlab-ci.yml
with
14 additions
and
19 deletions
.gitlab-ci.yml
+
14
−
19
View file @
424f7651
...
...
@@ -20,7 +20,7 @@ cache:
variables
:
## Name for the generated image. Change this if you wish, but watch out
## for special characters!
IMAGE_NAME
:
tjts5901
APP_
IMAGE_NAME
:
${DOCKER_REGISTRY}/
tjts5901
## (Optional) More verbose output from pipeline
#CI_DEBUG_TRACE: "true"
...
...
@@ -39,11 +39,22 @@ variables:
## Build docker image
build
:
image
:
docker:stable
stage
:
build
before_script
:
## Make some checks that Docker credentials are configured.
-
test -z "${DOCKER_REGISTRY}" && (echo "Missing required variable DOCKER_REGISTRY. See 'Pipeline setup.md'"; exit 1)
-
test -z "${DOCKER_AUTH_CONFIG}" && (echo "Missing required variable DOCKER_AUTH_CONFIG. See 'Pipeline setup.md'"; exit 1)
script
:
## Build a new image, pulling the latest base, and tag it.
## If --pull is ommited, base from local is used.
-
docker build --pull -t $IMAGE_NAME .
-
docker build --pull -t $APP_IMAGE_NAME .
## Tag the build image for registry, and push it.
#- docker tag "${APP_IMAGE_NAME}" "${DOCKER_REGISTRY}:${APP_IMAGE_NAME}"
-
docker push "${DOCKER_REGISTRY}:${APP_IMAGE_NAME}"
## Build course documentation. You might not need this stage.
pages
:
...
...
@@ -52,7 +63,7 @@ pages:
## Use build from previous stage as base image.
dependencies
:
-
build
image
:
$IMAGE_NAME
image
:
$
APP_
IMAGE_NAME
script
:
## Install `mkdocs` and generate HTML documentation.
...
...
@@ -70,19 +81,3 @@ pages:
## Mark this stage as an "production" environment.
environment
:
production
## Push image to container registry
push-image
:
stage
:
deploy
dependencies
:
-
build
image
:
docker:stable
before_script
:
## Make some checks that Docker credentials are configured.
-
test -z "${DOCKER_REGISTRY}" && (echo "Missing required variable DOCKER_REGISTRY. See 'Pipeline setup.md'"; exit 1)
-
test -z "${DOCKER_AUTH_CONFIG}" && (echo "Missing required variable DOCKER_AUTH_CONFIG. See 'Pipeline setup.md'"; exit 1)
script
:
## Tag the build image for registry, and push it.
-
docker tag "${IMAGE_NAME}" "${DOCKER_REGISTRY}:${IMAGE_NAME}"
-
docker push "${DOCKER_REGISTRY}:${IMAGE_NAME}"
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