Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
ubuntu_20_04
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
HZB
EPICS
base
ubuntu_20_04
Commits
5a8b60de
Commit
5a8b60de
authored
1 year ago
by
(INACTIVE) Marcel Bajdel (new marcel.bajdel)
Browse files
Options
Downloads
Patches
Plain Diff
Correcting the check branch image
parent
fcbdfd61
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!20
Release
,
!13
Docker image branch
,
!12
Docker image branch
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+11
-9
11 additions, 9 deletions
.gitlab-ci.yml
with
11 additions
and
9 deletions
.gitlab-ci.yml
+
11
−
9
View file @
5a8b60de
...
...
@@ -2,7 +2,7 @@ stages:
# List of stages for jobs, and their order of execution
-
build_branch
# builds if the image does not exist
-
branch_scan
# Check whether the image is already existing or not for the tag
-
check_image
_tag
# Check whether there are any vulnerabilities in the image
-
check_
branch_
image
# Check whether there are any vulnerabilities in the image
-
build_develop
# builds when the merge request is made into development branch
-
test_latest
# tests when the image with tag latest is pushed
-
build_tag
# builds when the tag is pushed
...
...
@@ -47,8 +47,8 @@ branch_scan:
when
:
on_success
expire_in
:
10 minutes
check_image
_tag
:
stage
:
check_image
_tag
check_
branch_
image
:
stage
:
check_
branch_
image
image
:
name
:
gcr.io/go-containerregistry/crane:debug
entrypoint
:
[
"
"
]
...
...
@@ -70,9 +70,7 @@ check_image_tag:
fi
artifacts
:
paths
:
-
docker_latest_image.txt
-
docker_latest_image
build_develop
:
# This build will run only for main branch
stage
:
build_develop
...
...
@@ -87,6 +85,9 @@ build_develop: # This build will run only for main branch
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
==
"develop"'
-
if
:
'
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
==
"develop"'
-
changes
:
-
README.md
when
:
never
test_latest
:
# This test will run only for tag latest
stage
:
test_latest
...
...
@@ -102,6 +103,9 @@ test_latest: # This test will run only for tag latest
paths
:
-
test_latest.log
rules
:
-
changes
:
-
README.md
when
:
never
-
if
:
'
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
==
"main"'
-
if
:
'
$CI_COMMIT_BRANCH
==
"develop"'
...
...
@@ -115,10 +119,8 @@ build_tag: # This build will run only for tags
script
:
# specify auths for kaniko executor
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# check if dockers images exists
-
if crane manifest $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME; then export DOCKER_TAG_IMAGE_EXISTS=true; else export DOCKER_TAG_IMAGE_EXISTS=false; fi
# if the image does not exist, build it with the added tag
-
if [ "$DOCKER_LATEST_IMAGE_EXISTS" == "false" ]; then
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
; else echo "Docker image already exists"; fi
-
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
test_tag
:
# This test will run only for tags
stage
:
test_tag
...
...
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