generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
############################## | ||
# Check tags in security-scan-config.yaml | ||
# Image Tag, rc-tag | ||
############################## | ||
|
||
|
||
# Get release version | ||
DESIRED_TAG="${1:-"main"}" | ||
|
||
# Get eventing-manager tag from sec-scanners-config.yaml | ||
SEC_SCAN_TO_CHECK="${2:-europe-docker.pkg.dev/kyma-project/prod/eventing-manager}" | ||
IMAGE_TAG=$(cat sec-scanners-config.yaml | grep "${SEC_SCAN_TO_CHECK}" | cut -d : -f 2) | ||
|
||
# Get rc-tag | ||
RC_TAG_TO_CHECK="${3:-rc-tag}" | ||
RC_TAG=$(cat sec-scanners-config.yaml | grep "${RC_TAG_TO_CHECK}" | cut -d : -f 2 | xargs) | ||
|
||
# Check IMAGE_TAG and required image tag | ||
if [[ "$IMAGE_TAG" != "$DESIRED_TAG" ]] || [[ "$RC_TAG" != "$DESIRED_TAG" ]]; then | ||
# ERROR: Tag issue | ||
echo "Tags are not correct: | ||
- wanted: $DESIRED_TAG | ||
- security-scanner image tag: $IMAGE_TAG | ||
- rc-tag: $RC_TAG" | ||
exit 1 | ||
fi | ||
|
||
# OK: Everything is fine | ||
echo "Tags are correct" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu # stop on error and on missing variable. | ||
|
||
# This script checks that the TAG arg does not exist, already. | ||
|
||
TAG="$1" | ||
|
||
if [ $(git tag -l $TAG) ]; then | ||
echo "Error; tag $TAG already exists" | ||
exit 1 | ||
else | ||
echo "tag $TAG does not exist" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
# This script checks that the VERSION arg does follow the pattern x.y.z where x, y and z are integers. | ||
|
||
TAG="$1" | ||
|
||
if [[ $TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Version format is valid" | ||
else | ||
echo "Version format is invalid" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script verifies, that the current branch name starts with 'release-' | ||
|
||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
if [[ "$CURRENT_BRANCH" == release-* ]]; then | ||
echo "Branch name starts with 'release-'." | ||
else | ||
echo "Branch name does not start with 'release-'." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters