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

Add RELEASE_INFRA_PUSH related code to support pushes from kubernetes/release. #28922

Merged
merged 1 commit into from
Jul 15, 2016

Conversation

david-mcmahon
Copy link
Contributor

@david-mcmahon david-mcmahon commented Jul 13, 2016

ref #16529

@david-mcmahon david-mcmahon added area/test area/test-infra release-note Denotes a PR that will be considered when it comes time to generate release notes. retest-not-required labels Jul 13, 2016
# Push to GCS?
if [[ ${KUBE_SKIP_PUSH_GCS:-} =~ ^[yY]$ ]]; then
echo "Not pushed to GCS..."
elif $RELEASE_INFRA_PUSH; then
Copy link
Contributor

Choose a reason for hiding this comment

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

[[ -n "${RELEASE_INFRA_PUSH:-}" ]]

Copy link
Contributor Author

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.

Copy link
Contributor Author

@david-mcmahon david-mcmahon Jul 13, 2016

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.

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor Author

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." \
Copy link
Contributor

Choose a reason for hiding this comment

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

>&2

@spxtr
Copy link
Contributor

spxtr commented Jul 13, 2016

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.

@k8s-github-robot k8s-github-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 13, 2016
@david-mcmahon david-mcmahon force-pushed the release-push branch 2 times, most recently from cf271f6 to ae9232d Compare July 13, 2016 22:45
@david-mcmahon
Copy link
Contributor Author

ping.

@spxtr
Copy link
Contributor

spxtr commented Jul 14, 2016

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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PTAL

@k8s-bot
Copy link

k8s-bot commented Jul 14, 2016

GCE e2e build/test passed for commit ae18034.

@spxtr
Copy link
Contributor

spxtr commented Jul 14, 2016

Ok, I think it's reasonable.

@spxtr spxtr added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 14, 2016
@k8s-github-robot
Copy link

Automatic merge from submit-queue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test area/test-infra lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants