Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
webservice
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
masi9606
webservice
Commits
8b85dae9
Commit
8b85dae9
authored
6 months ago
by
schnarkus
Browse files
Options
Downloads
Patches
Plain Diff
tag in a sepate job
parent
743b3d28
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#68711
failed
6 months ago
Stage: test
Stage: build
Stage: tag
Stage: publish
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+20
-1
20 additions, 1 deletion
.gitlab-ci.yml
with
20 additions
and
1 deletion
.gitlab-ci.yml
+
20
−
1
View file @
8b85dae9
...
@@ -13,6 +13,7 @@ variables:
...
@@ -13,6 +13,7 @@ variables:
stages
:
stages
:
-
test
-
test
-
build
-
build
-
tag
-
publish
-
publish
test_job
:
test_job
:
...
@@ -33,12 +34,28 @@ build_job:
...
@@ -33,12 +34,28 @@ build_job:
tags
:
tags
:
-
docker-privileged
-
docker-privileged
script
:
script
:
-
docker build -t $CI_REGISTRY_IMAGE:$version
-t $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$environment_tag
-f Containerfile .
-
docker build -t $CI_REGISTRY_IMAGE:$version -f Containerfile .
artifacts
:
artifacts
:
paths
:
paths
:
-
artifact.bin
-
artifact.bin
expire_in
:
5 min
expire_in
:
5 min
tag_job
:
stage
:
tag
rules
:
-
if
:
$CI_COMMIT_REF_NAME == "prod" || $CI_COMMIT_REF_NAME == "dev"
when
:
always
image
:
docker:latest
services
:
-
docker:dind
tags
:
-
docker-privileged
dependencies
:
-
build_job
script
:
-
docker tag $CI_REGISTRY_IMAGE:$version $CI_REGISTRY_IMAGE:latest
-
docker tag $CI_REGISTRY_IMAGE:$version $CI_REGISTRY_IMAGE:$environment_tag
publish_job
:
publish_job
:
stage
:
publish
stage
:
publish
rules
:
rules
:
...
@@ -49,6 +66,8 @@ publish_job:
...
@@ -49,6 +66,8 @@ publish_job:
-
docker:dind
-
docker:dind
tags
:
tags
:
-
docker-privileged
-
docker-privileged
dependencies
:
-
tag_job
script
:
script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-
docker push $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