Skip to content

Commit

Permalink
Add datafile.go back to go build for container build scenario, with n…
Browse files Browse the repository at this point in the history
…o tool dependency.
  • Loading branch information
jackgr committed May 27, 2015
1 parent a379be1 commit 972c367
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,7 @@ network_closure.sh
# Web UI
www/master/node_modules/
www/master/npm-debug.log
www/master/shared/config/development.json

# Karma output
www/test_out
2 changes: 0 additions & 2 deletions build/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ kube::build::verify_prereqs
kube::build::build_ui_image
kube::build::run_build_ui_command hack/ui/build-www.sh

kube::ui::build_ui

kube::build::build_image
kube::build::run_build_command hack/build-cross.sh

Expand Down
2 changes: 2 additions & 0 deletions hack/build-cross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::ui::build_ui

KUBE_BUILD_PLATFORMS=("${KUBE_SERVER_PLATFORMS[@]}")
kube::golang::build_binaries "${KUBE_SERVER_TARGETS[@]}"

Expand Down
2 changes: 2 additions & 0 deletions hack/build-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"

kube::ui::build_ui

kube::golang::build_binaries "$@"
kube::golang::place_bins
28 changes: 14 additions & 14 deletions hack/lib/ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ function kube::ui::generate_asset_paths() {
function kube::ui::build_ui() {
if ! which go-bindata > /dev/null 2>&1 ; then
echo "Cannot find go-bindata. Install with \"go get github.com/jteeuwen/go-bindata/...\""
exit 1
fi

local -r asset_paths=$(kube::ui::generate_asset_paths)
if ! go-bindata -nocompress -o "${KUBE_BUILD_TARGET}" -prefix "${KUBE_OUTPUT}" -pkg ui "${asset_paths[@]}" third_party/swagger-ui/... >/dev/null 2>&1 ; then
echo "Cannot package assets."
exit 1
fi
echo "Skipping ui build."
else
local -r asset_paths=$(kube::ui::generate_asset_paths)
if ! go-bindata -nocompress -o "${KUBE_BUILD_TARGET}" -prefix "${KUBE_OUTPUT}" -pkg ui "${asset_paths[@]}" third_party/swagger-ui/... >/dev/null 2>&1 ; then
echo "Cannot package assets."
exit 1
fi

local -r build_target=/tmp/datafile.go
local -r build_target=/tmp/datafile.go

sed "s/YEAR/$(date +'%Y')/" hooks/boilerplate.go.txt > $build_target
printf "// generated by hack/build-ui.sh; DO NOT EDIT\n" >> $build_target
cat "${KUBE_BUILD_TARGET}" >> $build_target
sed "s/YEAR/$(date +'%Y')/" hooks/boilerplate.go.txt > $build_target
printf "// generated by hack/build-ui.sh; DO NOT EDIT\n" >> $build_target
cat "${KUBE_BUILD_TARGET}" >> $build_target

gofmt -s -w $build_target
mv $build_target "${KUBE_BUILD_TARGET}"
gofmt -s -w $build_target
mv $build_target "${KUBE_BUILD_TARGET}"
fi
}

6 changes: 3 additions & 3 deletions www/master/shared/config/generated-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ angular.module("kubernetesApp.config", [])

.constant("ENV", {
"/": {
"k8sApiServer": "/api/v1beta2",
"k8sApiv1beta3Server": "/api/v1beta3",
"k8sDataServer": "/cluster",
"k8sApiServer": "http://localhost:8080/api/v1beta2",
"k8sApiv1beta3Server": "http://localhost:8080/api/v1beta3",
"k8sDataServer": "http://localhost:5555/cluster",
"k8sDataPollMinIntervalSec": 10,
"k8sDataPollMaxIntervalSec": 120,
"k8sDataPollErrorThreshold": 5,
Expand Down

0 comments on commit 972c367

Please sign in to comment.