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
b82b3c06
Commit
b82b3c06
authored
May 04, 2017
by
David McMahon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only tag release containers if the name is different.
parent
30575e52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
release.sh
build/lib/release.sh
+15
-9
No files found.
build/lib/release.sh
View file @
b82b3c06
...
@@ -287,6 +287,7 @@ function kube::release::create_docker_images_for_server() {
...
@@ -287,6 +287,7 @@ function kube::release::create_docker_images_for_server() {
local
docker_build_path
=
"
${
binary_dir
}
/
${
binary_name
}
.dockerbuild"
local
docker_build_path
=
"
${
binary_dir
}
/
${
binary_name
}
.dockerbuild"
local
docker_file_path
=
"
${
docker_build_path
}
/Dockerfile"
local
docker_file_path
=
"
${
docker_build_path
}
/Dockerfile"
local
binary_file_path
=
"
${
binary_dir
}
/
${
binary_name
}
"
local
binary_file_path
=
"
${
binary_dir
}
/
${
binary_name
}
"
local
docker_image_tag
=
"
${
KUBE_DOCKER_REGISTRY
:-
gcr
.io/google_containers
}
"
rm
-rf
${
docker_build_path
}
rm
-rf
${
docker_build_path
}
mkdir
-p
${
docker_build_path
}
mkdir
-p
${
docker_build_path
}
...
@@ -294,11 +295,13 @@ function kube::release::create_docker_images_for_server() {
...
@@ -294,11 +295,13 @@ function kube::release::create_docker_images_for_server() {
printf
" FROM
${
base_image
}
\n
ADD
${
binary_name
}
/usr/local/bin/
${
binary_name
}
\n
"
>
${
docker_file_path
}
printf
" FROM
${
base_image
}
\n
ADD
${
binary_name
}
/usr/local/bin/
${
binary_name
}
\n
"
>
${
docker_file_path
}
if
[[
${
arch
}
==
"amd64"
]]
;
then
if
[[
${
arch
}
==
"amd64"
]]
;
then
# If we are building a amd64 docker image, preserve the original image name
# If we are building a amd64 docker image, preserve the original
local
docker_image_tag
=
"gcr.io/google_containers/
${
binary_name
}
:
${
docker_tag
}
"
# image name
docker_image_tag+
=
"/
${
binary_name
}
:
${
docker_tag
}
"
else
else
# If we are building a docker image for another architecture, append the arch in the image tag
# If we are building a docker image for another architecture,
local
docker_image_tag
=
"gcr.io/google_containers/
${
binary_name
}
-
${
arch
}
:
${
docker_tag
}
"
# append the arch in the image tag
docker_image_tag+
=
"/
${
binary_name
}
-
${
arch
}
:
${
docker_tag
}
"
fi
fi
"
${
DOCKER
[@]
}
"
build
--pull
-q
-t
"
${
docker_image_tag
}
"
${
docker_build_path
}
>
/dev/null
"
${
DOCKER
[@]
}
"
build
--pull
-q
-t
"
${
docker_image_tag
}
"
${
docker_build_path
}
>
/dev/null
...
@@ -307,13 +310,16 @@ function kube::release::create_docker_images_for_server() {
...
@@ -307,13 +310,16 @@ function kube::release::create_docker_images_for_server() {
rm
-rf
${
docker_build_path
}
rm
-rf
${
docker_build_path
}
# If we are building an official/alpha/beta release we want to keep
docker images
# If we are building an official/alpha/beta release we want to keep
# and tag them appropriately.
#
docker images
and tag them appropriately.
if
[[
-n
"
${
KUBE_DOCKER_IMAGE_TAG
-
}
"
&&
-n
"
${
KUBE_DOCKER_REGISTRY
-
}
"
]]
;
then
if
[[
-n
"
${
KUBE_DOCKER_IMAGE_TAG
-
}
"
&&
-n
"
${
KUBE_DOCKER_REGISTRY
-
}
"
]]
;
then
local
release_docker_image_tag
=
"
${
KUBE_DOCKER_REGISTRY
}
/
${
binary_name
}
-
${
arch
}
:
${
KUBE_DOCKER_IMAGE_TAG
}
"
local
release_docker_image_tag
=
"
${
KUBE_DOCKER_REGISTRY
}
/
${
binary_name
}
-
${
arch
}
:
${
KUBE_DOCKER_IMAGE_TAG
}
"
kube::log::status
"Tagging docker image
${
docker_image_tag
}
as
${
release_docker_image_tag
}
"
# Only rmi and tag if name is different
"
${
DOCKER
[@]
}
"
rmi
"
${
release_docker_image_tag
}
"
2>/dev/null
||
true
if
[[
$docker_image_tag
!=
$release_docker_image_tag
]]
;
then
"
${
DOCKER
[@]
}
"
tag
"
${
docker_image_tag
}
"
"
${
release_docker_image_tag
}
"
2>/dev/null
kube::log::status
"Tagging docker image
${
docker_image_tag
}
as
${
release_docker_image_tag
}
"
"
${
DOCKER
[@]
}
"
rmi
"
${
release_docker_image_tag
}
"
2>/dev/null
||
true
"
${
DOCKER
[@]
}
"
tag
"
${
docker_image_tag
}
"
"
${
release_docker_image_tag
}
"
2>/dev/null
fi
fi
fi
kube::log::status
"Deleting docker image
${
docker_image_tag
}
"
kube::log::status
"Deleting docker image
${
docker_image_tag
}
"
...
...
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