Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no-relnote] Only trigger signing jobs on tags #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .nvidia-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,18 @@ release:ngc-ubi8:
- 'echo Image Tag: ${IMAGE_TAG} && [[ -n "${IMAGE_TAG}" ]] || exit 1'
script:
- 'echo "Signing the image ${IMAGE_NAME}:${IMAGE_TAG}"'
- ngc-cli/ngc registry image publish --source ${IMAGE_NAME}:${IMAGE_TAG} ${IMAGE_NAME}:${IMAGE_TAG} --public --discoverable --allow-guest --sign --org nvidia
- ngc-cli/ngc registry image publish --source ${IMAGE_NAME}:${IMAGE_TAG} ${IMAGE_NAME}:${IMAGE_TAG} --public --discoverable --allow-guest --sign --org nvidia

sign:ngc:
extends:
- .sign:ngc
parallel:
matrix:
- SIGN_JOB_NAME: [""]
DIST: ["CI_COMMIT_TAG", "ubi8"]
- DIST: ["ONLY_CI_COMMIT_TAG", "ubi8"]
rules:
- if: '$DIST == "CI_COMMIT_TAG"'
- if: $CI_COMMIT_TAG && '$DIST == "ONLY_CI_COMMIT_TAG"'
variables:
IMAGE_TAG: "${SIGN_JOB_NAME}${CI_COMMIT_TAG}"
- when: always
IMAGE_TAG: "${CI_COMMIT_TAG}"
- if: $CI_COMMIT_TAG
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, we have a duplicate if: $CI_COMMIT_TAG conditional in the .sign:ngc template. We need to make sure this is defined only once.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clarify what you mean by "this" here? It is my understanding that rules in gitlab CI are evaluated top to bottom and triggered on the first match. Rules that follow are not evaluated.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the rules defined in sign:ngc evaluated before the rules defined in .sign:ngc? If that is the case then we can resolve this comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we define rules here, these override the rules in the base definition. We are NOT extending the rules but replacing them.

variables:
IMAGE_TAG: "${SIGN_JOB_NAME}${CI_COMMIT_TAG}-${DIST}"
IMAGE_TAG: "${CI_COMMIT_TAG}-${DIST}"