-
Notifications
You must be signed in to change notification settings - Fork 12
Fail PR build if any image SHA placeholders are found #179
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,3 +38,19 @@ jobs: | |
| env: | ||
| CONTAINER_ENGINE: docker | ||
| BUILD_IMAGE_SPEC: localhost:5000/kroxy-jekyll:latest | ||
|
|
||
| # Currently the image shas are not available when we create the release, they need to be manually | ||
| # updated in the release PR before merge. | ||
| - name: Require release manifests to contain non-placeholder container image SHAs | ||
| run: | | ||
| PLACEHOLDER="REPLACE_WITH_SHA_AFTER_IMAGE_RELEASE" | ||
| # || true prevents the script failing when 0 matches are found | ||
| matching_files=$(grep -r -l "${PLACEHOLDER}" _data/release/ || true) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess for should add
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some how I didn't connect it up with the following line. I would write this as But I don't think it's worth a PR to change it. |
||
| if [[ -n "${matching_files}" ]]; then | ||
| echo "Error: ${PLACEHOLDER} found in release manifests:" >&2 | ||
| echo "${matching_files}" >&2 | ||
| echo "Please replace the placeholders in these files with the released image SHAs" >&2 | ||
| exit 1 | ||
| else | ||
| echo "Success: Release manifests contain no image SHA placeholders" | ||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the
|| truepart commented out code?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, it's a comment on why we've got to include an || true, so that githubs
set -edoesn't fail the script fast.