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
e544da8a
Commit
e544da8a
authored
Apr 08, 2019
by
aaa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shellcheck failures in test-dockerized.sh and upload-to-gcs.sh
update pull request update pull request
parent
8a2f8e69
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
22 deletions
+25
-22
.shellcheck_failures
hack/.shellcheck_failures
+0
-2
test-dockerized.sh
hack/jenkins/test-dockerized.sh
+5
-1
upload-to-gcs.sh
hack/jenkins/upload-to-gcs.sh
+20
-19
No files found.
hack/.shellcheck_failures
View file @
e544da8a
...
@@ -27,8 +27,6 @@
...
@@ -27,8 +27,6 @@
./hack/cherry_pick_pull.sh
./hack/cherry_pick_pull.sh
./hack/ginkgo-e2e.sh
./hack/ginkgo-e2e.sh
./hack/grab-profiles.sh
./hack/grab-profiles.sh
./hack/jenkins/test-dockerized.sh
./hack/jenkins/upload-to-gcs.sh
./hack/lib/init.sh
./hack/lib/init.sh
./hack/lib/logging.sh
./hack/lib/logging.sh
./hack/lib/protoc.sh
./hack/lib/protoc.sh
...
...
hack/jenkins/test-dockerized.sh
View file @
e544da8a
...
@@ -21,7 +21,11 @@ set -o xtrace
...
@@ -21,7 +21,11 @@ set -o xtrace
retry
()
{
retry
()
{
for
i
in
{
1..5
}
;
do
for
i
in
{
1..5
}
;
do
"
$@
"
&&
return
0
||
sleep
"
${
i
}
"
if
"
$@
"
;
then
return
0
else
sleep
"
${
i
}
"
fi
done
done
"
$@
"
"
$@
"
}
}
...
...
hack/jenkins/upload-to-gcs.sh
View file @
e544da8a
...
@@ -70,13 +70,13 @@ if [[ -n "${remote_git_repo}" ]]; then
...
@@ -70,13 +70,13 @@ if [[ -n "${remote_git_repo}" ]]; then
fi
fi
if
[[
${
JOB_NAME
}
=
~
-pull-
]]
;
then
if
[[
${
JOB_NAME
}
=
~
-pull-
]]
;
then
:
${
JENKINS_GCS_LOGS_PATH
:
=
"gs://kubernetes-jenkins/pr-logs/pull/
${
GCS_SUBDIR
}${
ghprbPullId
:-
unknown
}
"
}
:
"
${
JENKINS_GCS_LOGS_PATH
:
=
"gs://kubernetes-jenkins/pr-logs/pull/
${
GCS_SUBDIR
}${
ghprbPullId
:-
unknown
}
"
}
"
:
${
JENKINS_GCS_LATEST_PATH
:
=
"gs://kubernetes-jenkins/pr-logs/directory"
}
:
"
${
JENKINS_GCS_LATEST_PATH
:
=
"gs://kubernetes-jenkins/pr-logs/directory"
}
"
:
${
JENKINS_GCS_LOGS_INDIRECT
:
=
"gs://kubernetes-jenkins/pr-logs/directory/
${
JOB_NAME
}
"
}
:
"
${
JENKINS_GCS_LOGS_INDIRECT
:
=
"gs://kubernetes-jenkins/pr-logs/directory/
${
JOB_NAME
}
"
}
"
else
else
:
${
JENKINS_GCS_LOGS_PATH
:
=
"gs://kubernetes-jenkins/logs"
}
:
"
${
JENKINS_GCS_LOGS_PATH
:
=
"gs://kubernetes-jenkins/logs"
}
"
:
${
JENKINS_GCS_LATEST_PATH
:
=
"gs://kubernetes-jenkins/logs"
}
:
"
${
JENKINS_GCS_LATEST_PATH
:
=
"gs://kubernetes-jenkins/logs"
}
"
:
${
JENKINS_GCS_LOGS_INDIRECT
:
=
""
}
:
"
${
JENKINS_GCS_LOGS_INDIRECT
:
=
""
}
"
fi
fi
readonly
artifacts_path
=
"
${
WORKSPACE
}
/_artifacts"
readonly
artifacts_path
=
"
${
WORKSPACE
}
/_artifacts"
...
@@ -121,7 +121,7 @@ function find_version() {
...
@@ -121,7 +121,7 @@ function find_version() {
echo
"
${
KUBE_GIT_VERSION
-
}
"
echo
"
${
KUBE_GIT_VERSION
-
}
"
else
else
# Last resort from the started.json
# Last resort from the started.json
gsutil
cat
${
gcs_build_path
}
/started.json
2>/dev/null |
\
gsutil
cat
"
${
gcs_build_path
}
/started.json"
2>/dev/null |
\
sed
-n
's/ *"version": *"\([^"]*\)",*/\1/p'
sed
-n
's/ *"version": *"\([^"]*\)",*/\1/p'
fi
fi
)
)
...
@@ -129,7 +129,8 @@ function find_version() {
...
@@ -129,7 +129,8 @@ function find_version() {
# Output started.json. Use test function below!
# Output started.json. Use test function below!
function
print_started
()
{
function
print_started
()
{
local
metadata_keys
=
$(
compgen
-e
|
grep
^BUILD_METADATA_
)
local
metadata_keys
metadata_keys
=
$(
compgen
-e
|
grep
^BUILD_METADATA_
)
echo
"{"
echo
"{"
echo
"
\"
version
\"
:
\"
${
version
}
\"
,"
# TODO(fejta): retire
echo
"
\"
version
\"
:
\"
${
version
}
\"
,"
# TODO(fejta): retire
echo
"
\"
job-version
\"
:
\"
${
version
}
\"
,"
echo
"
\"
job-version
\"
:
\"
${
version
}
\"
,"
...
@@ -153,7 +154,7 @@ function print_started() {
...
@@ -153,7 +154,7 @@ function print_started() {
# Use this to test changes to print_started.
# Use this to test changes to print_started.
if
[[
-n
"
${
TEST_STARTED_JSON
:-}
"
]]
;
then
if
[[
-n
"
${
TEST_STARTED_JSON
:-}
"
]]
;
then
version
=
$(
find_version
)
version
=
$(
find_version
)
cat
<
(
print_started
)
| jq
.
jq
.
<
(
print_started
)
exit
exit
fi
fi
...
@@ -202,34 +203,34 @@ function update_job_result_cache() {
...
@@ -202,34 +203,34 @@ function update_job_result_cache() {
echo
"Could not find Kubernetes version"
echo
"Could not find Kubernetes version"
fi
fi
mkdir
-p
${
tmp_results
%/*
}
mkdir
-p
"
${
tmp_results
%/*
}
"
# Construct a valid json file
# Construct a valid json file
echo
"["
>
${
tmp_results
}
echo
"["
>
"
${
tmp_results
}
"
for
upload_attempt
in
$(
seq
3
)
;
do
for
upload_attempt
in
$(
seq
3
)
;
do
echo
"Copying
${
job_results
}
to
${
tmp_results
}
(attempt
${
upload_attempt
}
)"
echo
"Copying
${
job_results
}
to
${
tmp_results
}
(attempt
${
upload_attempt
}
)"
# The sed construct below is stripping out only the "version" lines
# The sed construct below is stripping out only the "version" lines
# and then ensuring there's a single comma at the end of the line.
# and then ensuring there's a single comma at the end of the line.
gsutil
-q
cat
${
job_results
}
2>&- |
\
gsutil
-q
cat
"
${
job_results
}
"
2>&- |
\
sed
-n
's/^\({"version".*}\),*/\1,/p'
|
\
sed
-n
's/^\({"version".*}\),*/\1,/p'
|
\
tail
-
${
cache_size
}
>>
${
tmp_results
}
||
continue
tail
-
${
cache_size
}
>>
"
${
tmp_results
}
"
||
continue
break
break
done
done
echo
"{
\"
version
\"
:
\"
${
version
}
\"
,
\"
buildnumber
\"
:
\"
${
BUILD_NUMBER
}
\"
,"
\
echo
"{
\"
version
\"
:
\"
${
version
}
\"
,
\"
buildnumber
\"
:
\"
${
BUILD_NUMBER
}
\"
,"
\
"
\"
result
\"
:
\"
${
build_result
}
\"
}"
>>
${
tmp_results
}
"
\"
result
\"
:
\"
${
build_result
}
\"
}"
>>
"
${
tmp_results
}
"
echo
"]"
>>
${
tmp_results
}
echo
"]"
>>
"
${
tmp_results
}
"
for
upload_attempt
in
$(
seq
3
)
;
do
for
upload_attempt
in
$(
seq
3
)
;
do
echo
"Copying
${
tmp_results
}
to
${
job_results
}
(attempt
${
upload_attempt
}
)"
echo
"Copying
${
tmp_results
}
to
${
job_results
}
(attempt
${
upload_attempt
}
)"
gsutil
-q
-h
"Content-Type:application/json"
cp
-a
"
${
gcs_acl
}
"
\
gsutil
-q
-h
"Content-Type:application/json"
cp
-a
"
${
gcs_acl
}
"
\
${
tmp_results
}
${
job_results
}
||
continue
"
${
tmp_results
}
"
"
${
job_results
}
"
||
continue
break
break
done
done
rm
-f
${
tmp_results
}
rm
-f
"
${
tmp_results
}
"
}
}
function
upload_artifacts_and_build_result
()
{
function
upload_artifacts_and_build_result
()
{
...
@@ -285,8 +286,8 @@ if [[ -z "${BOOTSTRAP_MIGRATION:-}" ]]; then
...
@@ -285,8 +286,8 @@ if [[ -z "${BOOTSTRAP_MIGRATION:-}" ]]; then
if
[[
-n
"
${
JENKINS_BUILD_STARTED
:-}
"
]]
;
then
if
[[
-n
"
${
JENKINS_BUILD_STARTED
:-}
"
]]
;
then
upload_version
upload_version
elif
[[
-n
"
${
JENKINS_BUILD_FINISHED
:-}
"
]]
;
then
elif
[[
-n
"
${
JENKINS_BUILD_FINISHED
:-}
"
]]
;
then
upload_artifacts_and_build_result
${
JENKINS_BUILD_FINISHED
}
upload_artifacts_and_build_result
"
${
JENKINS_BUILD_FINISHED
}
"
update_job_result_cache
${
JENKINS_BUILD_FINISHED
}
update_job_result_cache
"
${
JENKINS_BUILD_FINISHED
}
"
else
else
echo
"ERROR: Called without JENKINS_BUILD_STARTED or JENKINS_BUILD_FINISHED set."
echo
"ERROR: Called without JENKINS_BUILD_STARTED or JENKINS_BUILD_FINISHED set."
echo
"ERROR: this should not happen"
echo
"ERROR: this should not happen"
...
...
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