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
b2450d2e
Commit
b2450d2e
authored
Jun 14, 2017
by
Ian Chakeres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved gsutil_get_tar_md5 function before copy-to-staging function
parent
14391d3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
util.sh
cluster/gce/util.sh
+12
-11
No files found.
cluster/gce/util.sh
View file @
b2450d2e
...
@@ -148,6 +148,18 @@ function detect-project() {
...
@@ -148,6 +148,18 @@ function detect-project() {
fi
fi
}
}
# Use gsutil to get the md5 hash for a particular tar
function
gsutil_get_tar_md5
()
{
# location_tar could be local or in the cloud
# local tar_location example ./_output/release-tars/kubernetes-server-linux-amd64.tar.gz
# cloud tar_location example gs://kubernetes-staging-PROJECT/kubernetes-devel/kubernetes-server-linux-amd64.tar.gz
local
-r
tar_location
=
$1
#parse the output and return the md5 hash
#the sed command at the end removes whitespace
local
-r
tar_md5
=
$(
gsutil
hash
-h
-m
${
tar_location
}
2>/dev/null |
grep
"Hash (md5):"
|
awk
-F
':'
'{print $2}'
|
sed
's/^[[:space:]]*//g'
)
echo
"
${
tar_md5
}
"
}
# Copy a release tar and its accompanying hash.
# Copy a release tar and its accompanying hash.
function
copy-to-staging
()
{
function
copy-to-staging
()
{
local
-r
staging_path
=
$1
local
-r
staging_path
=
$1
...
@@ -179,17 +191,6 @@ function copy-to-staging() {
...
@@ -179,17 +191,6 @@ function copy-to-staging() {
echo
"+++
${
basename_tar
}
uploaded (sha1 =
${
hash
}
)"
echo
"+++
${
basename_tar
}
uploaded (sha1 =
${
hash
}
)"
}
}
# Use gsutil to get the md5 hash for a particular tar
function
gsutil_get_tar_md5
()
{
# location_tar could be local or in the cloud
# local tar_location example ./_output/release-tars/kubernetes-server-linux-amd64.tar.gz
# cloud tar_location example gs://kubernetes-staging-PROJECT/kubernetes-devel/kubernetes-server-linux-amd64.tar.gz
local
-r
tar_location
=
$1
#parse the output and return the md5 hash
#the sed command at the end removes whitespace
local
-r
tar_md5
=
$(
gsutil
hash
-h
-m
${
tar_location
}
2>/dev/null |
grep
"Hash (md5):"
|
awk
-F
':'
'{print $2}'
|
sed
's/^[[:space:]]*//g'
)
echo
"
${
tar_md5
}
"
}
# Given the cluster zone, return the list of regional GCS release
# Given the cluster zone, return the list of regional GCS release
# bucket suffixes for the release in preference order. GCS doesn't
# bucket suffixes for the release in preference order. GCS doesn't
...
...
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