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
e32aac7b
Commit
e32aac7b
authored
Nov 10, 2014
by
Maxwell Forbes
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2272 from jbeda/build-copy-extra
Upload extra artifacts with build
parents
626eb270
8ffa1f66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
common.sh
build/common.sh
+11
-9
No files found.
build/common.sh
View file @
e32aac7b
...
@@ -35,9 +35,8 @@ readonly KUBE_GCS_UPLOAD_RELEASE="${KUBE_GCS_UPLOAD_RELEASE:-n}"
...
@@ -35,9 +35,8 @@ readonly KUBE_GCS_UPLOAD_RELEASE="${KUBE_GCS_UPLOAD_RELEASE:-n}"
readonly
KUBE_GCS_NO_CACHING
=
"
${
KUBE_GCS_NO_CACHING
:-
y
}
"
readonly
KUBE_GCS_NO_CACHING
=
"
${
KUBE_GCS_NO_CACHING
:-
y
}
"
readonly
KUBE_GCS_MAKE_PUBLIC
=
"
${
KUBE_GCS_MAKE_PUBLIC
:-
y
}
"
readonly
KUBE_GCS_MAKE_PUBLIC
=
"
${
KUBE_GCS_MAKE_PUBLIC
:-
y
}
"
# KUBE_GCS_RELEASE_BUCKET default: kubernetes-releases-${project_hash}
# KUBE_GCS_RELEASE_BUCKET default: kubernetes-releases-${project_hash}
# KUBE_GCS_RELEASE_PREFIX default: devel/
readonly
KUBE_GCS_RELEASE_PREFIX
=
${
KUBE_GCS_RELEASE_PREFIX
-devel/
}
# KUBE_GCS_DOCKER_REG_PREFIX default: docker-reg/
readonly
KUBE_GCS_DOCKER_REG_PREFIX
=
${
KUBE_GCS_DOCKER_REG_PREFIX
-docker-reg/
}
# Constants
# Constants
...
@@ -615,7 +614,7 @@ function kube::release::gcs::release() {
...
@@ -615,7 +614,7 @@ function kube::release::gcs::release() {
kube::release::gcs::verify_prereqs
kube::release::gcs::verify_prereqs
kube::release::gcs::ensure_release_bucket
kube::release::gcs::ensure_release_bucket
kube::release::gcs::push_images
kube::release::gcs::push_images
kube::release::gcs::copy_release_
tarball
s
kube::release::gcs::copy_release_
artifact
s
}
}
# Verify things are set up for uploading to GCS
# Verify things are set up for uploading to GCS
...
@@ -654,8 +653,6 @@ function kube::release::gcs::ensure_release_bucket() {
...
@@ -654,8 +653,6 @@ function kube::release::gcs::ensure_release_bucket() {
local
project_hash
local
project_hash
project_hash
=
$(
kube::build::short_hash
"
$GCLOUD_PROJECT
"
)
project_hash
=
$(
kube::build::short_hash
"
$GCLOUD_PROJECT
"
)
KUBE_GCS_RELEASE_BUCKET
=
${
KUBE_GCS_RELEASE_BUCKET
-kubernetes-releases-
${
project_hash
}}
KUBE_GCS_RELEASE_BUCKET
=
${
KUBE_GCS_RELEASE_BUCKET
-kubernetes-releases-
${
project_hash
}}
KUBE_GCS_RELEASE_PREFIX
=
${
KUBE_GCS_RELEASE_PREFIX
-devel/
}
KUBE_GCS_DOCKER_REG_PREFIX
=
${
KUBE_GCS_DOCKER_REG_PREFIX
-docker-reg/
}
if
!
gsutil
ls
"gs://
${
KUBE_GCS_RELEASE_BUCKET
}
"
>
/dev/null 2>&1
;
then
if
!
gsutil
ls
"gs://
${
KUBE_GCS_RELEASE_BUCKET
}
"
>
/dev/null 2>&1
;
then
echo
"Creating Google Cloud Storage bucket:
$KUBE_GCS_RELEASE_BUCKET
"
echo
"Creating Google Cloud Storage bucket:
$KUBE_GCS_RELEASE_BUCKET
"
...
@@ -716,7 +713,7 @@ function kube::release::gcs::push_images() {
...
@@ -716,7 +713,7 @@ function kube::release::gcs::push_images() {
done
done
}
}
function
kube::release::gcs::copy_release_
tarball
s
()
{
function
kube::release::gcs::copy_release_
artifact
s
()
{
# TODO: This isn't atomic. There will be points in time where there will be
# TODO: This isn't atomic. There will be points in time where there will be
# no active release. Also, if something fails, the release could be half-
# no active release. Also, if something fails, the release could be half-
# 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
...
@@ -728,7 +725,7 @@ function kube::release::gcs::copy_release_tarballs() {
...
@@ -728,7 +725,7 @@ function kube::release::gcs::copy_release_tarballs() {
gcs_options
=(
"-h"
"Cache-Control:private, max-age=0"
)
gcs_options
=(
"-h"
"Cache-Control:private, max-age=0"
)
fi
fi
echo
"+++ Copying
client tarball
s to
${
gcs_destination
}
"
echo
"+++ Copying
release artifact
s to
${
gcs_destination
}
"
# First delete all objects at the destination
# First delete all objects at the destination
gsutil
-q
rm
-f
-R
"
${
gcs_destination
}
"
>
/dev/null 2>&1
||
true
gsutil
-q
rm
-f
-R
"
${
gcs_destination
}
"
>
/dev/null 2>&1
||
true
...
@@ -736,14 +733,19 @@ function kube::release::gcs::copy_release_tarballs() {
...
@@ -736,14 +733,19 @@ function kube::release::gcs::copy_release_tarballs() {
# Now upload everything in release directory
# Now upload everything in release directory
gsutil
-m
"
${
gcs_options
[@]+
${
gcs_options
[@]
}}
"
cp
-r
"
${
RELEASE_DIR
}
"
/
*
"
${
gcs_destination
}
"
gsutil
-m
"
${
gcs_options
[@]+
${
gcs_options
[@]
}}
"
cp
-r
"
${
RELEASE_DIR
}
"
/
*
"
${
gcs_destination
}
"
# Having the "template" scripts from the GCE cluster deploy hosted with the
# release is useful for GKE. Copy everything from that directory up also.
gsutil
-m
"
${
gcs_options
[@]+
${
gcs_options
[@]
}}
"
cp
"
${
KUBE_ROOT
}
/cluster/gce/templates/*.sh"
"
${
gcs_destination
}
extra/gce-templates/"
# TODO(jbeda): Generate an HTML page with links for this release so it is easy
# TODO(jbeda): Generate an HTML page with links for this release so it is easy
# to see it. For extra credit, generate a dynamic page that builds up the
# to see it. For extra credit, generate a dynamic page that builds up the
# release list using the GCS JSON API. Use Angular and Bootstrap for extra
# release list using the GCS JSON API. Use Angular and Bootstrap for extra
# extra credit.
# extra credit.
if
[[
${
KUBE_GCS_MAKE_PUBLIC
}
=
~ ^[yY]
$
]]
;
then
if
[[
${
KUBE_GCS_MAKE_PUBLIC
}
=
~ ^[yY]
$
]]
;
then
echo
"+++ Marking all uploaded objects public"
gsutil acl ch
-R
-g
all:R
"
${
gcs_destination
}
"
>
/dev/null 2>&1
gsutil acl ch
-R
-g
all:R
"
${
gcs_destination
}
"
>
/dev/null 2>&1
fi
fi
gsutil
ls
-lh
"
${
gcs_destination
}
"
gsutil
ls
-lh
r
"
${
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