Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
91238f8b
Commit
91238f8b
authored
Jun 10, 2015
by
James DeFelice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make building contrib code optional
parent
e10afad4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
9 deletions
+48
-9
common.sh
build/common.sh
+19
-5
golang.sh
hack/lib/golang.sh
+29
-4
No files found.
build/common.sh
View file @
91238f8b
...
@@ -304,10 +304,9 @@ function kube::build::ensure_golang() {
...
@@ -304,10 +304,9 @@ function kube::build::ensure_golang() {
}
}
}
}
# Set up the context directory for the kube-build image and build it.
# The set of source targets to include in the kube-build image
function
kube::build::build_image
()
{
function
kube::build::source_targets
()
{
local
-r
build_context_dir
=
"
${
LOCAL_OUTPUT_IMAGE_STAGING
}
/
${
KUBE_BUILD_IMAGE
}
"
local
targets
=(
local
-r
source
=(
api
api
build
build
cmd
cmd
...
@@ -323,11 +322,22 @@ function kube::build::build_image() {
...
@@ -323,11 +322,22 @@ function kube::build::build_image() {
test
test
third_party
third_party
)
)
if
[
-n
"
${
KUBERNETES_CONTRIB
:-}
"
]
;
then
for
contrib
in
"
${
KUBERNETES_CONTRIB
}
"
;
do
targets+
=(
$(
eval
"kube::contrib::
${
contrib
}
::source_targets"
)
)
done
fi
echo
"
${
targets
[@]
}
"
}
# Set up the context directory for the kube-build image and build it.
function
kube::build::build_image
()
{
local
-r
build_context_dir
=
"
${
LOCAL_OUTPUT_IMAGE_STAGING
}
/
${
KUBE_BUILD_IMAGE
}
"
kube::build::build_image_cross
kube::build::build_image_cross
mkdir
-p
"
${
build_context_dir
}
"
mkdir
-p
"
${
build_context_dir
}
"
tar
czf
"
${
build_context_dir
}
/kube-source.tar.gz"
"
${
source
[@]
}
"
tar
czf
"
${
build_context_dir
}
/kube-source.tar.gz"
$(
kube::build::source_targets
)
kube::version::get_version_vars
kube::version::get_version_vars
kube::version::save_version_vars
"
${
build_context_dir
}
/kube-version-defs"
kube::version::save_version_vars
"
${
build_context_dir
}
/kube-version-defs"
...
@@ -415,6 +425,10 @@ function kube::build::run_build_command() {
...
@@ -415,6 +425,10 @@ function kube::build::run_build_command() {
"
${
DOCKER_MOUNT_ARGS
[@]
}
"
"
${
DOCKER_MOUNT_ARGS
[@]
}
"
)
)
if
[
-n
"
${
KUBERNETES_CONTRIB
:-}
"
]
;
then
docker_run_opts+
=(
-e
"KUBERNETES_CONTRIB=
${
KUBERNETES_CONTRIB
}
"
)
fi
# If we have stdin we can run interactive. This allows things like 'shell.sh'
# If we have stdin we can run interactive. This allows things like 'shell.sh'
# to work. However, if we run this way and don't have stdin, then it ends up
# to work. However, if we run this way and don't have stdin, then it ends up
# running in a daemon-ish mode. So if we don't have a stdin, we explicitly
# running in a daemon-ish mode. So if we don't have a stdin, we explicitly
...
...
hack/lib/golang.sh
View file @
91238f8b
...
@@ -18,8 +18,16 @@
...
@@ -18,8 +18,16 @@
readonly
KUBE_GO_PACKAGE
=
github.com/GoogleCloudPlatform/kubernetes
readonly
KUBE_GO_PACKAGE
=
github.com/GoogleCloudPlatform/kubernetes
readonly
KUBE_GOPATH
=
"
${
KUBE_OUTPUT
}
/go"
readonly
KUBE_GOPATH
=
"
${
KUBE_OUTPUT
}
/go"
# Load contrib target functions
if
[
-n
"
${
KUBERNETES_CONTRIB
:-}
"
]
;
then
for
contrib
in
"
${
KUBERNETES_CONTRIB
}
"
;
do
source
"
${
KUBE_ROOT
}
/contrib/
${
contrib
}
/target.sh"
done
fi
# The set of server targets that we are only building for Linux
# The set of server targets that we are only building for Linux
readonly
KUBE_SERVER_TARGETS
=(
kube::golang::server_targets
()
{
local
targets
=(
cmd/kube-proxy
cmd/kube-proxy
cmd/kube-apiserver
cmd/kube-apiserver
cmd/kube-controller-manager
cmd/kube-controller-manager
...
@@ -27,7 +35,15 @@ readonly KUBE_SERVER_TARGETS=(
...
@@ -27,7 +35,15 @@ readonly KUBE_SERVER_TARGETS=(
cmd/hyperkube
cmd/hyperkube
cmd/kubernetes
cmd/kubernetes
plugin/cmd/kube-scheduler
plugin/cmd/kube-scheduler
)
)
if
[
-n
"
${
KUBERNETES_CONTRIB
:-}
"
]
;
then
for
contrib
in
"
${
KUBERNETES_CONTRIB
}
"
;
do
targets+
=(
$(
eval
"kube::contrib::
${
contrib
}
::server_targets"
)
)
done
fi
echo
"
${
targets
[@]
}
"
}
readonly
KUBE_SERVER_TARGETS
=(
$(
kube::golang::server_targets
)
)
readonly
KUBE_SERVER_BINARIES
=(
"
${
KUBE_SERVER_TARGETS
[@]##*/
}
"
)
readonly
KUBE_SERVER_BINARIES
=(
"
${
KUBE_SERVER_TARGETS
[@]##*/
}
"
)
# The server platform we are building on.
# The server platform we are building on.
...
@@ -43,7 +59,8 @@ readonly KUBE_CLIENT_BINARIES=("${KUBE_CLIENT_TARGETS[@]##*/}")
...
@@ -43,7 +59,8 @@ readonly KUBE_CLIENT_BINARIES=("${KUBE_CLIENT_TARGETS[@]##*/}")
readonly
KUBE_CLIENT_BINARIES_WIN
=(
"
${
KUBE_CLIENT_BINARIES
[@]/%/.exe
}
"
)
readonly
KUBE_CLIENT_BINARIES_WIN
=(
"
${
KUBE_CLIENT_BINARIES
[@]/%/.exe
}
"
)
# The set of test targets that we are building for all platforms
# The set of test targets that we are building for all platforms
readonly
KUBE_TEST_TARGETS
=(
kube::golang::test_targets
()
{
local
targets
=(
cmd/integration
cmd/integration
cmd/gendocs
cmd/gendocs
cmd/genman
cmd/genman
...
@@ -53,7 +70,15 @@ readonly KUBE_TEST_TARGETS=(
...
@@ -53,7 +70,15 @@ readonly KUBE_TEST_TARGETS=(
examples/k8petstore/web-server
examples/k8petstore/web-server
github.com/onsi/ginkgo/ginkgo
github.com/onsi/ginkgo/ginkgo
test
/e2e/e2e.test
test
/e2e/e2e.test
)
)
if
[
-n
"
${
KUBERNETES_CONTRIB
:-}
"
]
;
then
for
contrib
in
"
${
KUBERNETES_CONTRIB
}
"
;
do
targets+
=(
$(
eval
"kube::contrib::
${
contrib
}
::test_targets"
)
)
done
fi
echo
"
${
targets
[@]
}
"
}
readonly
KUBE_TEST_TARGETS
=(
$(
kube::golang::test_targets
)
)
readonly
KUBE_TEST_BINARIES
=(
"
${
KUBE_TEST_TARGETS
[@]##*/
}
"
)
readonly
KUBE_TEST_BINARIES
=(
"
${
KUBE_TEST_TARGETS
[@]##*/
}
"
)
readonly
KUBE_TEST_BINARIES_WIN
=(
"
${
KUBE_TEST_BINARIES
[@]/%/.exe
}
"
)
readonly
KUBE_TEST_BINARIES_WIN
=(
"
${
KUBE_TEST_BINARIES
[@]/%/.exe
}
"
)
readonly
KUBE_TEST_PORTABLE
=(
readonly
KUBE_TEST_PORTABLE
=(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment