Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Miosix Docker
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Analyze
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
Avionics
Software Development
Docker Containers
Miosix Docker
Commits
2af9f153
Commit
2af9f153
authored
6 months ago
by
Niccolò Betto
Browse files
Options
Downloads
Patches
Plain Diff
Introduce versioned CI build based on tags
parent
bcab6f43
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#10627
passed
6 months ago
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+20
-8
20 additions, 8 deletions
.gitlab-ci.yml
with
20 additions
and
8 deletions
.gitlab-ci.yml
+
20
−
8
View file @
2af9f153
...
...
@@ -2,17 +2,29 @@ variables:
GIT_SUBMODULE_STRATEGY
:
recursive
stages
:
-
docker
-
build
docker
:
stage
:
docker
build
:
stage
:
build
image
:
docker
tags
:
-
docker
rules
:
# If triggered by a push to the default branch...
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
variables
:
VERSION
:
"
latest"
# ...push to latest...
changes
:
-
Dockerfile
# ...only if Dockerfile changed
# If triggered by tag creation...
-
if
:
$CI_COMMIT_TAG
variables
:
VERSION
:
$CI_COMMIT_TAG
# ...push to tag name
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker build -t $CI_REGISTRY_IMAGE:latest .
-
docker push $CI_REGISTRY_IMAGE:latest
rules
:
-
changes
:
-
Dockerfile
-
docker build -t $CI_REGISTRY_IMAGE:$VERSION .
-
docker push $CI_REGISTRY_IMAGE:$VERSION
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