Skip to content
Snippets Groups Projects
Commit b4667e89 authored by Andres Maldonado's avatar Andres Maldonado
Browse files

[.gitlab-ci.yml] [test] Do not run 'build' if Dockerfile has not changed

Also, update some comments.
Line 50: `- "pica-ci-base/**"` changed to `- "pica-ci-base/Dockerfile"` 
in order to match comment
parent e8c57c07
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ pica-ci-base:
rules:
- if: '$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "dev-ci"'
changes:
- "pica-ci-base/**"
- "pica-ci-base/Dockerfile"
when: manual
# Create a file a few environment variables added (which Dockerfile has been modified, the complete name of the image...)
......@@ -59,8 +59,8 @@ set-variables:
script:
- chmod +x ./get-modified-image.sh
- ./get-modified-image.sh
# If the Dockerfile is changed, force the build.
# Otherwise, may be triggered manually.
# If there are changes in any of the files and folders of 'pica-*' or
# 'meta-*', then propose a manual build
rules:
- changes:
- "pica-*/**"
......@@ -73,7 +73,7 @@ build:
tags: [build]
image: $REGISTRY_PROD/pica-ci-base
before_script:
# First login on the production registry, in case the image is based on a other registry image
# First login on the production registry, in case the image is based on another registry image
- echo $REGISTRY_PROD_PASSWORD | docker login $REGISTRY_PROD -u $REGISTRY_PROD_USERNAME --password-stdin
- source variables
script:
......@@ -85,17 +85,18 @@ build:
- docker push $MODIFIED_IMAGE_FULL_TEST
after_script:
- docker logout $REGISTRY
# If the Dockerfile is changed, force the build.
# Otherwise, may be triggered manually.
# Build if Dockerfile changed and previous stage completed successfully
# Manual build for other changes commented out in order to not block
# the pipeline (see issue 34077, link on header)
rules:
- changes:
- "pica-*/Dockerfile"
- "meta-*/Dockerfile"
when: on_success
- changes:
- "pica-*/**"
- "meta-*/**"
when: manual
# - changes:
# - "pica-*/**"
# - "meta-*/**"
# when: manual
- when: never
# Run CoreOS' Clair and make the CI failed if a critical vulnerability isn't in the whitelist
......
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