Skip to content
Snippets Groups Projects
Commit 9d993088 authored by (INACTIVE) Marcel Bajdel (new marcel.bajdel)'s avatar (INACTIVE) Marcel Bajdel (new marcel.bajdel) :rocket:
Browse files

Adding additional info

parent 544f3e40
No related branches found
No related tags found
3 merge requests!20Release,!13Docker image branch,!12Docker image branch
stages:
# List of stages for jobs, and their order of execution
- build_branch # builds if the image does not exist
- check_image_tag # Check whether there are any vulnerabilities in the image
- 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
- build_main # builds when the merge request is made into main
- build_tag # builds when the tag is pushed
- test_main # tests when the merge request is made into main
......@@ -33,7 +33,28 @@ build_branch:
when: never
- changes:
- '*'
branch_scan:
stage: branch_scan
image:
name: trivy
entrypoint: [""]
script:
- mkdir scan_result
- cd tar_images
- |
for tar_image in *.tar;
do
[ -e "$tar_image" ] || continue;
file_name=${tar_image%.*};
echo $file_name;
if [ "$vulnerability_scanner" = "trivy" ]; then trivy image --timeout 15m --offline-scan --input $tar_image -f json -o ../scan_result/$file_name.json --severity CRITICAL; fi
done
artifacts:
paths:
- scan_result
when: on_success
expire_in: 10 minutes
check_image_tag: # Check whether the image is already existing or not for the tag
stage: check_image_tag
image:
......@@ -60,26 +81,6 @@ check_image_tag: # Check whether the image is already existing or not for the ta
paths:
- docker_latest_image.txt
branch_scan:
stage: branch_scan
image:
name: trivy
entrypoint: [""]
script:
- mkdir scan_result
- cd tar_images
- |
for tar_image in *.tar;
do
[ -e "$tar_image" ] || continue;
file_name=${tar_image%.*};
echo $file_name;
if [ "$vulnerability_scanner" = "trivy" ]; then trivy image --timeout 15m --offline-scan --input $tar_image -f json -o ../scan_result/$file_name.json --severity CRITICAL; fi
done
artifacts:
paths:
- scan_result
expire_in: 10 minutes
build_main: # This build will run only for main branch
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment