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

Merge branch 'docker_image_branch' into 'develop'

Docker image branch

See merge request !17
parents 75e1b6a3 f229a35a
No related branches found
No related tags found
2 merge requests!20Release,!17Docker image branch
......@@ -7,6 +7,7 @@ stages:
- test_latest # tests when the image with tag latest is pushed
- build_tag # builds when the tag is pushed
- test_tag # tests when the tag is pushed
- trigger_pipeline # Triggering other pipeline
build_branch: # Creating tarball for the each branch in the repository
stage: build_branch
......@@ -25,7 +26,7 @@ build_branch: # Creating tarball for the each branch in the repository
when: on_success
expire_in: 10 minutes
rules:
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH == "main"'
when: never
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"'
when: never
......@@ -53,7 +54,7 @@ branch_scan: # Scan the tarball with trivy
when: on_success
expire_in: 10 minutes
rules:
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH == "main"'
when: never
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"'
when: never
......@@ -91,7 +92,7 @@ check_branch_image: # check for vulnerabilities and validate with crane
paths: # save the results
- tar_images
rules:
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH == "main"'
when: never
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"'
when: never
......@@ -104,7 +105,7 @@ check_branch_image: # check for vulnerabilities and validate with crane
when: never
- changes:
- '*'
build_develop: # This build will run at the merge to develop
stage: build_develop
image:
......@@ -116,7 +117,6 @@ build_develop: # This build will run at the merge to develop
# build the image with tag latest if the merge request is made into main
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:latest
rules:
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "release"'
when: never
......@@ -138,7 +138,6 @@ test_latest: # This test will run only for tag latest
paths:
- test_latest.log
rules:
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "release"'
when: never
......@@ -174,6 +173,20 @@ test_tag: # This test will run only for tags
artifacts:
paths:
- test_tag.log
after_script:
- 'curl --request POST --form "token=glptt-eb00396b920d3a6043997b78714990b1fa0063ea" --form ref=pipeline_branch https://codebase.helmholtz.cloud/api/v4/projects/9922/trigger/pipeline'
trigger_pipeline:
stage: trigger_pipeline
script:
- apt-get update -qy
- apt-get install -y curl
- 'curl --request POST --form "token=glptt-eb00396b920d3a6043997b78714990b1fa0063ea" --form ref=pipeline_branch https://codebase.helmholtz.cloud/api/v4/projects/9922/trigger/pipeline'
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "release"'
when: never
- changes:
- README.md
when: never
needs:
- test_latest
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