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
6df3deb4
Commit
6df3deb4
authored
Jan 19, 2019
by
Roy Lenferink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bash script syntax improvements
parent
771baea3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
24 additions
and
24 deletions
+24
-24
gen-swagger-docs.sh
hack/gen-swagger-doc/gen-swagger-docs.sh
+3
-3
build.sh
hack/jenkins/build.sh
+1
-1
gotest.sh
hack/jenkins/gotest.sh
+1
-1
upload-to-gcs.sh
hack/jenkins/upload-to-gcs.sh
+2
-2
verify-dockerized.sh
hack/jenkins/verify-dockerized.sh
+1
-1
verify.sh
hack/jenkins/verify.sh
+1
-1
logging.sh
hack/lib/logging.sh
+2
-2
test.sh
hack/lib/test.sh
+0
-0
test-e2e-node.sh
hack/make-rules/test-e2e-node.sh
+4
-4
update-openapi-spec.sh
hack/update-openapi-spec.sh
+2
-2
update-staging-godeps-dockerized.sh
hack/update-staging-godeps-dockerized.sh
+2
-2
update-translations.sh
hack/update-translations.sh
+5
-5
No files found.
hack/gen-swagger-doc/gen-swagger-docs.sh
View file @
6df3deb4
...
@@ -37,12 +37,12 @@ top_level_models=$(grep '&[A-Za-z]*{},' /register.go | sed 's/.*&//;s/{},//')
...
@@ -37,12 +37,12 @@ top_level_models=$(grep '&[A-Za-z]*{},' /register.go | sed 's/.*&//;s/{},//')
VERSION
=
"
${
1
#*_
}
"
VERSION
=
"
${
1
#*_
}
"
for
m
in
${
top_level_models
}
for
m
in
${
top_level_models
}
do
do
if
grep
-xq
"===
${
VERSION
}
.
$
m
"
./definitions.adoc
if
grep
-xq
"===
${
VERSION
}
.
$
{
m
}
"
./definitions.adoc
then
then
buf+
=
"* <<
${
VERSION
}
.
$
m
>>
\n
"
buf+
=
"* <<
${
VERSION
}
.
$
{
m
}
>>
\n
"
fi
fi
done
done
sed
-i
"1i
$
buf
"
./definitions.adoc
sed
-i
"1i
$
{
buf
}
"
./definitions.adoc
# fix the links in .adoc, replace <<x.y>> with link:definitions.html#_x_y[x.y], and lowercase the _x_y part
# fix the links in .adoc, replace <<x.y>> with link:definitions.html#_x_y[x.y], and lowercase the _x_y part
sed
-i
-e
's|<<\(.*\)\.\(.*\)>>|link:#_\L\1_\2\E[\1.\2]|g'
./definitions.adoc
sed
-i
-e
's|<<\(.*\)\.\(.*\)>>|link:#_\L\1_\2\E[\1.\2]|g'
./definitions.adoc
...
...
hack/jenkins/build.sh
View file @
6df3deb4
...
@@ -30,7 +30,7 @@ set -o xtrace
...
@@ -30,7 +30,7 @@ set -o xtrace
# is an incoming variable Jenkins provides us for this job's scratch
# is an incoming variable Jenkins provides us for this job's scratch
# space.
# space.
export
HOME
=
${
WORKSPACE
}
# Nothing should want Jenkins $HOME
export
HOME
=
${
WORKSPACE
}
# Nothing should want Jenkins $HOME
export
PATH
=
$
PATH
:/usr/local/go/bin
export
PATH
=
$
{
PATH
}
:/usr/local/go/bin
# Skip gcloud update checking
# Skip gcloud update checking
export
CLOUDSDK_COMPONENT_MANAGER_DISABLE_UPDATE_CHECK
=
true
export
CLOUDSDK_COMPONENT_MANAGER_DISABLE_UPDATE_CHECK
=
true
...
...
hack/jenkins/gotest.sh
View file @
6df3deb4
...
@@ -28,7 +28,7 @@ set -o xtrace
...
@@ -28,7 +28,7 @@ set -o xtrace
# space.
# space.
export
HOME
=
${
WORKSPACE
}
# Nothing should want Jenkins $HOME
export
HOME
=
${
WORKSPACE
}
# Nothing should want Jenkins $HOME
export
GOPATH
=
${
HOME
}
/_gopath
export
GOPATH
=
${
HOME
}
/_gopath
export
PATH
=
${
GOPATH
}
/bin:
${
HOME
}
/third_party/etcd:/usr/local/go/bin:
$
PATH
export
PATH
=
${
GOPATH
}
/bin:
${
HOME
}
/third_party/etcd:/usr/local/go/bin:
$
{
PATH
}
# Install a few things needed by unit and /integration tests.
# Install a few things needed by unit and /integration tests.
command
-v
etcd &>/dev/null
||
./hack/install-etcd.sh
command
-v
etcd &>/dev/null
||
./hack/install-etcd.sh
...
...
hack/jenkins/upload-to-gcs.sh
View file @
6df3deb4
...
@@ -139,9 +139,9 @@ function print_started() {
...
@@ -139,9 +139,9 @@ function print_started() {
# will be available as started["metadata"][KEY.lower()].
# will be available as started["metadata"][KEY.lower()].
echo
"
\"
metadata
\"
: {"
echo
"
\"
metadata
\"
: {"
local
sep
=
""
# leading commas are easy to track
local
sep
=
""
# leading commas are easy to track
for
env_var
in
$
metadata_keys
;
do
for
env_var
in
$
{
metadata_keys
}
;
do
local
var_upper
=
"
${
env_var
#BUILD_METADATA_
}
"
local
var_upper
=
"
${
env_var
#BUILD_METADATA_
}
"
echo
"
$
sep
\"
${
var_upper
,,
}
\"
:
\"
${
!env_var
}
\"
"
echo
"
$
{
sep
}
\"
${
var_upper
,,
}
\"
:
\"
${
!env_var
}
\"
"
sep
=
","
sep
=
","
done
done
echo
" },"
echo
" },"
...
...
hack/jenkins/verify-dockerized.sh
View file @
6df3deb4
...
@@ -21,7 +21,7 @@ set -o xtrace
...
@@ -21,7 +21,7 @@ set -o xtrace
retry
()
{
retry
()
{
for
i
in
{
1..5
}
;
do
for
i
in
{
1..5
}
;
do
"
$@
"
&&
return
0
||
sleep
$i
"
$@
"
&&
return
0
||
sleep
"
${
i
}
"
done
done
"
$@
"
"
$@
"
}
}
...
...
hack/jenkins/verify.sh
View file @
6df3deb4
...
@@ -28,7 +28,7 @@ set -o xtrace
...
@@ -28,7 +28,7 @@ set -o xtrace
# space.
# space.
export
HOME
=
${
WORKSPACE
}
# Nothing should want Jenkins $HOME
export
HOME
=
${
WORKSPACE
}
# Nothing should want Jenkins $HOME
export
GOPATH
=
${
HOME
}
/_gopath
export
GOPATH
=
${
HOME
}
/_gopath
export
PATH
=
${
GOPATH
}
/bin:
${
HOME
}
/third_party/etcd:/usr/local/go/bin:
$
PATH
export
PATH
=
${
GOPATH
}
/bin:
${
HOME
}
/third_party/etcd:/usr/local/go/bin:
$
{
PATH
}
# Install a few things needed by the verification tests.
# Install a few things needed by the verification tests.
command
-v
etcd &>/dev/null
||
./hack/install-etcd.sh
command
-v
etcd &>/dev/null
||
./hack/install-etcd.sh
...
...
hack/lib/logging.sh
View file @
6df3deb4
...
@@ -34,7 +34,7 @@ kube::log::errexit() {
...
@@ -34,7 +34,7 @@ kube::log::errexit() {
kube::log::error
"Call tree:"
kube::log::error
"Call tree:"
for
((
i
=
1
;
i<
${#
FUNCNAME
[@]
}
-1
;
i++
))
for
((
i
=
1
;
i<
${#
FUNCNAME
[@]
}
-1
;
i++
))
do
do
kube::log::error
"
$
i
:
${
BASH_SOURCE
[
$i
+1]
}
:
${
BASH_LINENO
[
$i
]
}
${
FUNCNAME
[
$i
]
}
(...)"
kube::log::error
"
$
{
i
}
:
${
BASH_SOURCE
[
${
i
}
+1]
}
:
${
BASH_LINENO
[
${
i
}
]
}
${
FUNCNAME
[
${
i
}
]
}
(...)"
done
done
fi
fi
kube::log::error_exit
"Error in
${
BASH_SOURCE
[1]
}
:
${
BASH_LINENO
[0]
}
. '
${
BASH_COMMAND
}
' exited with status
$err
"
"
${
1
:-
1
}
"
1
kube::log::error_exit
"Error in
${
BASH_SOURCE
[1]
}
:
${
BASH_LINENO
[0]
}
. '
${
BASH_COMMAND
}
' exited with status
$err
"
"
${
1
:-
1
}
"
1
...
@@ -66,7 +66,7 @@ kube::log::stack() {
...
@@ -66,7 +66,7 @@ kube::log::stack() {
local
source_file
=
${
BASH_SOURCE
[
$frame_no
]
}
local
source_file
=
${
BASH_SOURCE
[
$frame_no
]
}
local
source_lineno
=
${
BASH_LINENO
[
$((
frame_no
-
1
))
]
}
local
source_lineno
=
${
BASH_LINENO
[
$((
frame_no
-
1
))
]
}
local
funcname
=
${
FUNCNAME
[
$frame_no
]
}
local
funcname
=
${
FUNCNAME
[
$frame_no
]
}
echo
"
$
i
:
${
source_file
}
:
${
source_lineno
}
${
funcname
}
(...)"
>
&2
echo
"
$
{
i
}
:
${
source_file
}
:
${
source_lineno
}
${
funcname
}
(...)"
>
&2
done
done
fi
fi
}
}
...
...
hack/lib/test.sh
View file @
6df3deb4
This diff is collapsed.
Click to expand it.
hack/make-rules/test-e2e-node.sh
View file @
6df3deb4
...
@@ -115,14 +115,14 @@ if [ ${remote} = true ] ; then
...
@@ -115,14 +115,14 @@ if [ ${remote} = true ] ; then
IFS
=
','
read
-ra
IM
<<<
"
${
images
}
"
IFS
=
','
read
-ra
IM
<<<
"
${
images
}
"
images
=
""
images
=
""
for
i
in
"
${
IM
[@]
}
"
;
do
for
i
in
"
${
IM
[@]
}
"
;
do
if
[[
$(
gcloud compute instances list
"
${
instance_prefix
}
-
$
i
"
|
grep
${
i
})
]]
;
then
if
[[
$(
gcloud compute instances list
"
${
instance_prefix
}
-
$
{
i
}
"
|
grep
${
i
})
]]
;
then
if
[[
${
hosts
}
!=
""
]]
;
then
if
[[
"
${
hosts
}
"
!=
""
]]
;
then
hosts
=
"
${
hosts
}
,"
hosts
=
"
${
hosts
}
,"
fi
fi
echo
"Reusing host
${
instance_prefix
}
-
$
i
"
echo
"Reusing host
${
instance_prefix
}
-
$
{
i
}
"
hosts
=
"
${
hosts
}${
instance_prefix
}
-
${
i
}
"
hosts
=
"
${
hosts
}${
instance_prefix
}
-
${
i
}
"
else
else
if
[[
${
images
}
!=
""
]]
;
then
if
[[
"
${
images
}
"
!=
""
]]
;
then
images
=
"
${
images
}
,"
images
=
"
${
images
}
,"
fi
fi
images
=
"
${
images
}${
i
}
"
images
=
"
${
images
}${
i
}
"
...
...
hack/update-openapi-spec.sh
View file @
6df3deb4
...
@@ -55,7 +55,7 @@ API_LOGFILE=${API_LOGFILE:-/tmp/openapi-api-server.log}
...
@@ -55,7 +55,7 @@ API_LOGFILE=${API_LOGFILE:-/tmp/openapi-api-server.log}
kube::etcd::start
kube::etcd::start
echo
"dummy_token,admin,admin"
>
$
TMP_DIR
/tokenauth.csv
echo
"dummy_token,admin,admin"
>
$
{
TMP_DIR
}
/tokenauth.csv
# Start kube-apiserver
# Start kube-apiserver
kube::log::status
"Starting kube-apiserver"
kube::log::status
"Starting kube-apiserver"
...
@@ -67,7 +67,7 @@ kube::log::status "Starting kube-apiserver"
...
@@ -67,7 +67,7 @@ kube::log::status "Starting kube-apiserver"
--advertise-address
=
"10.10.10.10"
\
--advertise-address
=
"10.10.10.10"
\
--cert-dir
=
"
${
TMP_DIR
}
/certs"
\
--cert-dir
=
"
${
TMP_DIR
}
/certs"
\
--runtime-config
=
"api/all=true"
\
--runtime-config
=
"api/all=true"
\
--token-auth-file
=
$TMP_DIR
/tokenauth.csv
\
--token-auth-file
=
"
${
TMP_DIR
}
/tokenauth.csv"
\
--logtostderr
\
--logtostderr
\
--v
=
2
\
--v
=
2
\
--service-cluster-ip-range
=
"10.0.0.0/24"
>
"
${
API_LOGFILE
}
"
2>&1 &
--service-cluster-ip-range
=
"10.0.0.0/24"
>
"
${
API_LOGFILE
}
"
2>&1 &
...
...
hack/update-staging-godeps-dockerized.sh
View file @
6df3deb4
...
@@ -36,7 +36,7 @@ if (( ${KUBE_VERBOSE} >= 6 )); then
...
@@ -36,7 +36,7 @@ if (( ${KUBE_VERBOSE} >= 6 )); then
fi
fi
while
getopts
":df"
opt
;
do
while
getopts
":df"
opt
;
do
case
$
opt
in
case
$
{
opt
}
in
d
)
# do not godep-restore into a temporary directory, but use the existing GOPATH
d
)
# do not godep-restore into a temporary directory, but use the existing GOPATH
DRY_RUN
=
true
DRY_RUN
=
true
;;
;;
...
@@ -44,7 +44,7 @@ while getopts ":df" opt; do
...
@@ -44,7 +44,7 @@ while getopts ":df" opt; do
FAIL_ON_DIFF
=
true
FAIL_ON_DIFF
=
true
;;
;;
\?
)
\?
)
echo
"Invalid option: -
$
OPTARG
"
>
&2
echo
"Invalid option: -
$
{
OPTARG
}
"
>
&2
exit
1
exit
1
;;
;;
esac
esac
...
...
hack/update-translations.sh
View file @
6df3deb4
...
@@ -23,7 +23,7 @@ generate_pot="false"
...
@@ -23,7 +23,7 @@ generate_pot="false"
generate_mo
=
"false"
generate_mo
=
"false"
while
getopts
"hf:xg"
opt
;
do
while
getopts
"hf:xg"
opt
;
do
case
$
opt
in
case
$
{
opt
}
in
h
)
h
)
echo
"
$0
[-f files] [-x] [-g]"
echo
"
$0
[-f files] [-x] [-g]"
echo
" -f <file-path>: Files to process"
echo
" -f <file-path>: Files to process"
...
@@ -78,10 +78,10 @@ fi
...
@@ -78,10 +78,10 @@ fi
if
[[
"
${
generate_mo
}
"
==
"true"
]]
;
then
if
[[
"
${
generate_mo
}
"
==
"true"
]]
;
then
echo
"Generating .po and .mo files"
echo
"Generating .po and .mo files"
for
x
in
translations/
*
/
*
/
*
/
*
.po
;
do
for
x
in
translations/
*
/
*
/
*
/
*
.po
;
do
msgcat
-s
$
x
>
tmp.po
msgcat
-s
$
{
x
}
>
tmp.po
mv
tmp.po
$
x
mv
tmp.po
$
{
x
}
echo
"generating .mo file for:
$
x
"
echo
"generating .mo file for:
$
{
x
}
"
msgfmt
$
x
-o
"
$(
dirname
$x
)
/
$(
basename
$x
.po
)
.mo"
msgfmt
$
{
x
}
-o
"
$(
dirname
${
x
})
/
$(
basename
${
x
}
.po
)
.mo"
done
done
fi
fi
...
...
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