Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
k8s-github-robot merged 1 commit into
kubernetes:masterfrom
david-mcmahon:release-push
Jul 15, 2016
Merged

Add RELEASE_INFRA_PUSH related code to support pushes from kubernetes/release.#28922
k8s-github-robot merged 1 commit into
kubernetes:masterfrom
david-mcmahon:release-push

Conversation

@david-mcmahon
Copy link
Copy Markdown
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
Comment thread hack/jenkins/build.sh Outdated
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
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.

Comment thread hack/jenkins/build.sh Outdated
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

ping.

@spxtr
Copy link
Copy Markdown
Contributor

spxtr commented Jul 14, 2016

cc @rmmh test-infra on-call

Comment thread hack/jenkins/build.sh Outdated
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

k8s-bot commented Jul 14, 2016

GCE e2e build/test passed for commit ae18034.

@spxtr
Copy link
Copy Markdown
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
Copy Markdown

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