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
7a2d8fd0
Commit
7a2d8fd0
authored
Oct 01, 2014
by
Joe Beda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GCS uploads as part of release are now marked public and non-cached by default.
parent
4aac80c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
common.sh
build/common.sh
+18
-4
No files found.
build/common.sh
View file @
7a2d8fd0
...
@@ -25,7 +25,10 @@ source hack/config-go.sh
...
@@ -25,7 +25,10 @@ source hack/config-go.sh
# Incoming options
# Incoming options
readonly
BUILD_RUN_IMAGES
=
"
${
BUILD_RUN_IMAGES
:-
n
}
"
readonly
BUILD_RUN_IMAGES
=
"
${
BUILD_RUN_IMAGES
:-
n
}
"
readonly
RELEASE_GCS
=
"
${
RELEASE_GCS
:-
n
}
"
readonly
GCS_RELEASE
=
"
${
GCS_RELEASE
:-
n
}
"
readonly
GCS_NO_CACHING
=
"
${
GCS_NO_CACHING
:-
y
}
"
readonly
GCS_MAKE_PUBLIC
=
"
${
GCS_MAKE_PUBLIC
:-
y
}
"
# Constants
# Constants
readonly
KUBE_REPO_ROOT
=
"
${
PWD
}
"
readonly
KUBE_REPO_ROOT
=
"
${
PWD
}
"
...
@@ -204,7 +207,7 @@ function kube::build::docker_build() {
...
@@ -204,7 +207,7 @@ function kube::build::docker_build() {
echo
"+++ Building Docker image
${
image
}
. This can take a while."
echo
"+++ Building Docker image
${
image
}
. This can take a while."
set
+e
# We are handling the error here manually
set
+e
# We are handling the error here manually
local
-r
docker_output
local
docker_output
docker_output
=
$(${
build_cmd
}
2>&1
)
docker_output
=
$(${
build_cmd
}
2>&1
)
if
[[
$?
-ne
0
]]
;
then
if
[[
$?
-ne
0
]]
;
then
set
-e
set
-e
...
@@ -412,7 +415,7 @@ function kube::release::package_full_tarball() {
...
@@ -412,7 +415,7 @@ function kube::release::package_full_tarball() {
# GCS Release
# GCS Release
function
kube::release::gcs::release
()
{
function
kube::release::gcs::release
()
{
[[
"
${
RELEASE_GCS
}
"
==
"y"
]]
||
return
0
[[
"
${
GCS_RELEASE
}
"
==
"y"
]]
||
return
0
kube::release::gcs::verify_prereqs
kube::release::gcs::verify_prereqs
kube::release::gcs::ensure_release_bucket
kube::release::gcs::ensure_release_bucket
...
@@ -526,6 +529,11 @@ function kube::release::gcs::copy_release_tarballs() {
...
@@ -526,6 +529,11 @@ function kube::release::gcs::copy_release_tarballs() {
# copied. The real way to do this would perhaps to have some sort of release
# copied. The real way to do this would perhaps to have some sort of release
# version so that we are never overwriting a destination.
# version so that we are never overwriting a destination.
local
-r
gcs_destination
=
"gs://
${
KUBE_RELEASE_BUCKET
}
/
${
KUBE_RELEASE_PREFIX
}
"
local
-r
gcs_destination
=
"gs://
${
KUBE_RELEASE_BUCKET
}
/
${
KUBE_RELEASE_PREFIX
}
"
local
gcs_options
=()
if
[[
${
GCS_NO_CACHING
}
==
"y"
]]
;
then
gcs_options
=(
"-h"
"Cache-Control:private, max-age=0"
)
fi
echo
"+++ Copying client tarballs to
${
gcs_destination
}
"
echo
"+++ Copying client tarballs to
${
gcs_destination
}
"
...
@@ -533,5 +541,11 @@ function kube::release::gcs::copy_release_tarballs() {
...
@@ -533,5 +541,11 @@ function kube::release::gcs::copy_release_tarballs() {
gsutil
-q
rm
-f
-R
"
${
gcs_destination
}
"
>
/dev/null 2>&1
||
true
gsutil
-q
rm
-f
-R
"
${
gcs_destination
}
"
>
/dev/null 2>&1
||
true
# Now upload everything in release directory
# Now upload everything in release directory
gsutil
-m
cp
-r
"
${
RELEASE_DIR
}
"
/
*
"
${
gcs_destination
}
"
>
/dev/null 2>&1
gsutil
-m
"
${
gcs_options
[@]-
}
"
cp
-r
"
${
RELEASE_DIR
}
"
/
*
"
${
gcs_destination
}
"
>
/dev/null 2>&1
if
[[
${
GCS_MAKE_PUBLIC
}
==
"y"
]]
;
then
gsutil acl ch
-R
-g
all:R
"
${
gcs_destination
}
"
>
/dev/null 2>&1
fi
gsutil
ls
-lh
"
${
gcs_destination
}
"
}
}
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