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
43f51029
Commit
43f51029
authored
Apr 21, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify protobufs
parent
35ea9b87
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
19 deletions
+16
-19
update-generated-protobuf.sh
hack/after-build/update-generated-protobuf.sh
+1
-1
verify-generated-protobuf.sh
hack/after-build/verify-generated-protobuf.sh
+9
-15
update-generated-protobuf.sh
hack/update-generated-protobuf.sh
+6
-1
verify-generated-protobuf.sh
hack/verify-generated-protobuf.sh
+0
-2
No files found.
hack/after-build/update-generated-protobuf.sh
View file @
43f51029
...
@@ -32,7 +32,7 @@ if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3.0."* ]]; the
...
@@ -32,7 +32,7 @@ if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3.0."* ]]; the
echo
" https://github.com/google/protobuf/releases"
echo
" https://github.com/google/protobuf/releases"
echo
echo
echo
"WARNING: Protobuf changes are not being validated"
echo
"WARNING: Protobuf changes are not being validated"
exit
0
exit
1
fi
fi
gotoprotobuf
=
$(
kube::util::find-binary
"go-to-protobuf"
)
gotoprotobuf
=
$(
kube::util::find-binary
"go-to-protobuf"
)
...
...
hack/after-build/verify-generated-protobuf.sh
View file @
43f51029
...
@@ -21,19 +21,7 @@ set -o pipefail
...
@@ -21,19 +21,7 @@ set -o pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../..
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
# TODO: preinstall protobuf
APIROOTS
=
${
APIROOTS
:-
pkg
/api pkg/apis pkg/runtime pkg/util/intstr pkg/watch
}
if
[[
-z
"
$(
which protoc
)
"
||
"
$(
protoc
--version
)
"
!=
"libprotoc 3.0."
*
]]
;
then
echo
"Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and"
echo
"install the platform appropriate Protobuf package for your OS: "
echo
echo
" https://github.com/google/protobuf/releases"
echo
echo
"WARNING: Protobuf changes are not being validated"
# TODO: make error when protobuf is installed
exit
0
fi
APIROOTS
=
${
APIROOTS
:-
pkg
/api pkg/apis/extensions pkg/apis/metrics pkg/runtime pkg/util/intstr
}
_tmp
=
"
${
KUBE_ROOT
}
/_tmp"
_tmp
=
"
${
KUBE_ROOT
}
/_tmp"
cleanup
()
{
cleanup
()
{
...
@@ -42,18 +30,24 @@ cleanup() {
...
@@ -42,18 +30,24 @@ cleanup() {
trap
"cleanup"
EXIT SIGINT
trap
"cleanup"
EXIT SIGINT
cleanup
for
APIROOT
in
${
APIROOTS
}
;
do
for
APIROOT
in
${
APIROOTS
}
;
do
mkdir
-p
"
${
_tmp
}
/
${
APIROOT
%/*
}
"
mkdir
-p
"
${
_tmp
}
/
${
APIROOT
%/*
}
"
cp
-a
"
${
KUBE_ROOT
}
/
${
APIROOT
}
"
"
${
_tmp
}
/
${
APIROOT
}
"
cp
-a
"
${
KUBE_ROOT
}
/
${
APIROOT
}
"
"
${
_tmp
}
/
${
APIROOT
}
"
done
done
"
${
KUBE_ROOT
}
/hack/after-build/update-generated-protobuf.sh"
# We would like to use "sudo" when running on Travis and
# not use "sudo" when running on Jenkins.
SUDO
=
"sudo"
sudo
-h
>
/dev/null
||
SUDO
=
""
"
${
KUBE_ROOT
}
/hack/update-generated-protobuf.sh"
for
APIROOT
in
${
APIROOTS
}
;
do
for
APIROOT
in
${
APIROOTS
}
;
do
TMP_APIROOT
=
"
${
_tmp
}
/
${
APIROOT
}
"
TMP_APIROOT
=
"
${
_tmp
}
/
${
APIROOT
}
"
echo
"diffing
${
APIROOT
}
against freshly generated protobuf"
echo
"diffing
${
APIROOT
}
against freshly generated protobuf"
ret
=
0
ret
=
0
diff
-Naupr
-I
'Auto generated by'
"
${
KUBE_ROOT
}
/
${
APIROOT
}
"
"
${
TMP_APIROOT
}
"
||
ret
=
$?
diff
-Naupr
-I
'Auto generated by'
"
${
KUBE_ROOT
}
/
${
APIROOT
}
"
"
${
TMP_APIROOT
}
"
||
ret
=
$?
cp
-a
"
${
TMP_APIROOT
}
"
"
${
KUBE_ROOT
}
/
${
APIROOT
%/*
}
"
${
SUDO
}
cp
-a
"
${
TMP_APIROOT
}
"
"
${
KUBE_ROOT
}
/
${
APIROOT
%/*
}
"
if
[[
$ret
-eq
0
]]
;
then
if
[[
$ret
-eq
0
]]
;
then
echo
"
${
APIROOT
}
up to date."
echo
"
${
APIROOT
}
up to date."
else
else
...
...
hack/update-generated-protobuf.sh
View file @
43f51029
...
@@ -37,7 +37,12 @@ function prereqs() {
...
@@ -37,7 +37,12 @@ function prereqs() {
KUBE_BUILD_CONTAINER_NAME
=
"kube-build-
${
KUBE_ROOT_HASH
}
"
KUBE_BUILD_CONTAINER_NAME
=
"kube-build-
${
KUBE_ROOT_HASH
}
"
KUBE_BUILD_DATA_CONTAINER_NAME
=
"kube-build-data-
${
KUBE_ROOT_HASH
}
"
KUBE_BUILD_DATA_CONTAINER_NAME
=
"kube-build-data-
${
KUBE_ROOT_HASH
}
"
DOCKER_MOUNT_ARGS
=(
DOCKER_MOUNT_ARGS
=(
--volume
"
${
KUBE_ROOT
}
:/go/src/
${
KUBE_GO_PACKAGE
}
"
--volume
"
${
REPO_DIR
:-${
KUBE_ROOT
}}
/cluster:/go/src/
${
KUBE_GO_PACKAGE
}
/cluster"
--volume
"
${
REPO_DIR
:-${
KUBE_ROOT
}}
/cmd:/go/src/
${
KUBE_GO_PACKAGE
}
/cmd"
--volume
"
${
REPO_DIR
:-${
KUBE_ROOT
}}
/Godeps/_workspace/src:/go/src/
${
KUBE_GO_PACKAGE
}
/Godeps/_workspace/src"
--volume
"
${
REPO_DIR
:-${
KUBE_ROOT
}}
/hack:/go/src/
${
KUBE_GO_PACKAGE
}
/hack"
--volume
"
${
REPO_DIR
:-${
KUBE_ROOT
}}
/pkg:/go/src/
${
KUBE_GO_PACKAGE
}
/pkg"
--volume
"
${
REPO_DIR
:-${
KUBE_ROOT
}}
/third_party:/go/src/
${
KUBE_GO_PACKAGE
}
/third_party"
--volume
/etc/localtime:/etc/localtime:ro
--volume
/etc/localtime:/etc/localtime:ro
--volumes-from
"
${
KUBE_BUILD_DATA_CONTAINER_NAME
}
"
--volumes-from
"
${
KUBE_BUILD_DATA_CONTAINER_NAME
}
"
)
)
...
...
hack/verify-generated-protobuf.sh
View file @
43f51029
...
@@ -23,8 +23,6 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
...
@@ -23,8 +23,6 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env
kube::golang::setup_env
"
${
KUBE_ROOT
}
/hack/build-go.sh"
cmd/libs/go2idl/go-to-protobuf cmd/libs/go2idl/go-to-protobuf/protoc-gen-gogo
"
${
KUBE_ROOT
}
/hack/after-build/verify-generated-protobuf.sh"
"
$@
"
"
${
KUBE_ROOT
}
/hack/after-build/verify-generated-protobuf.sh"
"
$@
"
# ex: ts=2 sw=2 et filetype=sh
# ex: ts=2 sw=2 et filetype=sh
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