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

Allow option to not build cmd/integration #1410

Merged
merged 1 commit into from
Sep 23, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion hack/test-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ function cleanup()

# Stop right away if the build fails
set -e
$(dirname $0)/build-go.sh cmd/integration

if [[ -z $KUBE_NO_BUILD_INTEGRATION ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

This will fail if we use set -o nounset (which I should correct shortly.)

This would be the standard way to check whether a variable is set or unset:

if [[ "${KUBE_NO_BUILD_INTEGRATION+set}" != "set" ]]; then
  ...

Also, the $(dirname $0) needs double quotes, in fact it needs double quotes around itself and around $0 as well...

This works:

  "$(dirname "$0")"/build-go.sh cmd/integration

But it's really ugly... So my preference is always to set a variable at the start of the script which only needs one quote:

basedir=$(dirname "$0")

And then use ${basedir} throughout the script:

source "${basedir}/util.sh"
source "${basedir}/config-go.sh"
...
if [[ "${KUBE_NO_BUILD_INTEGRATION+set}" != "set" ]]; then
  "${basedir}/build-go.sh" cmd/integration
fi

This script needs more love, so if you prefer we can merge your change unchanged and I can take a stab on it on a separate PR.

Cheers,
Filipe

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, in fact let me do that, I'll merge yours and follow up with another one myself.

$(dirname $0)/build-go.sh cmd/integration
fi

start_etcd

Expand Down