-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add RELEASE_INFRA_PUSH related code to support pushes from kubernetes/release. #28922
Add RELEASE_INFRA_PUSH related code to support pushes from kubernetes/release. #28922
Conversation
# Push to GCS? | ||
if [[ ${KUBE_SKIP_PUSH_GCS:-} =~ ^[yY]$ ]]; then | ||
echo "Not pushed to GCS..." | ||
elif $RELEASE_INFRA_PUSH; then |
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.
[[ -n "${RELEASE_INFRA_PUSH:-}" ]]
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.
Well RELEASE_INFRA_PUSH is a convenient true or false bool so we can code it so it reads nice like that.
The other (unsightly) option is:
if [[ "${RELEASE_INFRA_PUSH:-}" == "true" ]]
But -n will always be true unless we change the default.
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.
Another nice option in bash is to use 0 or 1 for your bool values and take advantage of the double paren eval. Both are certainly more Go or Python like than the overly decorated expression above (== true):
So both read nicely:
RELEASE_INFRA_PUSH=1
if ((RELEASE_INFRA_PUSH)); then
Or:
RELEASE_INFRA_PUSH=true
if $RELEASE_INFRA_PUSH; then
I have started to prefer the former in the past couple of years, but since most of this infra uses true/false, I thought I'd stick with that.
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.
Okay, seems reasonable. It's just different from the norm in this repo.
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.
minor nit - scripts in this repo generally use ${VAR}
rather than $VAR
.
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.
Indeed. Will correct next iteration.
RELEASE_INFRA_CLONE=$WORKSPACE/release | ||
|
||
if [[ ! -x $RELEASE_INFRA_CLONE/push-ci-build.sh ]]; then | ||
echo "FATAL: Something went wrong." \ |
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.
>&2
For testing this, you can edit the file to set whatever environment variables will make it do its thing and then be sure to remove them once you've seen it work. |
cf271f6
to
ae9232d
Compare
ping. |
cc @rmmh test-infra on-call |
$FEDERATION && federation_flag="--federation" | ||
# Use --nomock to do the real thing | ||
#$release_infra_clone/push-ci-build.sh --nomock $federation_flag | ||
$release_infra_clone/push-ci-build.sh $federation_flag |
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.
If $FEDERATION
is false then federation_flag
never gets set and this will fail from nounset, I think.
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.
PTAL
ae9232d
to
ae18034
Compare
GCE e2e build/test passed for commit ae18034. |
Ok, I think it's reasonable. |
Automatic merge from submit-queue |
…f-#28922-kubernetes#29892-kubernetes#30182-kubernetes#31025-kubernetes#32013-kubernetes#32235-kubernetes#34359-kubernetes#35233-upstream-release-1.3 Automated cherry pick of kubernetes#28922 kubernetes#29892 kubernetes#30182 kubernetes#31025 kubernetes#32013 kubernetes#32235 kubernetes#34359 kubernetes#35233
ref #16529