mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-04 10:47:25 +00:00
Match shell style guide.
Looking at https://google-styleguide.googlecode.com/svn/trunk/shell.xml
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
@@ -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 "$@"
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user