Match shell style guide.

Looking at https://google-styleguide.googlecode.com/svn/trunk/shell.xml
This commit is contained in:
Joe Beda
2014-09-09 15:03:32 -07:00
parent c5cb7202af
commit ed5bfa2f0f
16 changed files with 141 additions and 144 deletions

View File

@@ -34,17 +34,17 @@ else
echo "WARNING: No version information provided in build image"
fi
function make-binary() {
function kube::build::make_binary() {
local -r gopkg=$1
local -r bin=${gopkg##*/}
echo "+++ Building ${bin} for ${GOOS}/${GOARCH}"
pushd "${KUBE_REPO_ROOT}"
pushd "${KUBE_REPO_ROOT}" >/dev/null
godep go build -ldflags "${KUBE_LD_FLAGS-}" -o "${ARCH_TARGET}/${bin}" "${gopkg}"
popd
popd >/dev/null
}
function make-binaries() {
function kube::build::make_binaries() {
if [[ ${#targets[@]} -eq 0 ]]; then
targets=(
cmd/proxy
@@ -66,12 +66,12 @@ function make-binaries() {
mkdir -p "${ARCH_TARGET}"
if [[ -n "$1" ]]; then
make-binary "$1"
kube::build::make_binary "$1"
exit 0
fi
local b
for b in "${binaries[@]}"; do
make-binary "$b"
kube::build::make_binary "$b"
done
}

View File

@@ -14,10 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# This and builds all go components.
set -e
source $(dirname $0)/common.sh
make-binaries "$@"
kube::build::make_binaries "$@"

View File

@@ -14,14 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# This and builds all go components.
set -e
source $(dirname $0)/common.sh
readonly CROSS_BINARIES=(
"./cmd/kubecfg"
./cmd/kubecfg
)
for platform in ${KUBE_CROSSPLATFORMS}; do
@@ -29,7 +27,7 @@ for platform in ${KUBE_CROSSPLATFORMS}; do
export GOOS=${platform%/*}
export GOARCH=${platform##*/}
for binary in "${CROSS_BINARIES[@]}"; do
make-binaries "${binary}"
kube::build::make_binaries "${binary}"
done
)
done

View File

@@ -18,13 +18,15 @@ set -e
source $(dirname $0)/common.sh
ETCD_DIR="${KUBE_REPO_ROOT}/_output/etcd"
kube::build::make_binaries "./cmd/integration"
readonly ETCD_DIR="${KUBE_REPO_ROOT}/_output/etcd"
mkdir -p "${ETCD_DIR}"
echo "+++ Running integration test"
etcd -name test -data-dir ${ETCD_DIR} > "${KUBE_REPO_ROOT}/_output/etcd.log" &
ETCD_PID=$!
readonly ETCD_PID=$!
sleep 5

View File

@@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
source $(dirname $0)/common.sh