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
4b94829c
Commit
4b94829c
authored
Jan 06, 2015
by
Joe Beda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make 'make clean' work with Docker not installed.
Fixes #1959.
parent
22a241aa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
common.sh
build/common.sh
+15
-0
make-clean.sh
build/make-clean.sh
+1
-1
No files found.
build/common.sh
View file @
4b94829c
...
@@ -95,6 +95,10 @@ readonly RELEASE_DIR="${LOCAL_OUTPUT_ROOT}/release-tars"
...
@@ -95,6 +95,10 @@ readonly RELEASE_DIR="${LOCAL_OUTPUT_ROOT}/release-tars"
# Verify that the right utilities and such are installed for building Kube. Set
# Verify that the right utilities and such are installed for building Kube. Set
# up some dynamic constants.
# up some dynamic constants.
#
#
# Args:
# $1 The type of operation to verify for. Only 'clean' is supported in which
# case we don't verify docker.
#
# Vars set:
# Vars set:
# KUBE_ROOT_HASH
# KUBE_ROOT_HASH
# KUBE_BUILD_IMAGE_TAG
# KUBE_BUILD_IMAGE_TAG
...
@@ -104,6 +108,8 @@ readonly RELEASE_DIR="${LOCAL_OUTPUT_ROOT}/release-tars"
...
@@ -104,6 +108,8 @@ readonly RELEASE_DIR="${LOCAL_OUTPUT_ROOT}/release-tars"
# DOCKER_MOUNT_ARGS
# DOCKER_MOUNT_ARGS
function
kube::build::verify_prereqs
()
{
function
kube::build::verify_prereqs
()
{
echo
"+++ Verifying Prerequisites...."
echo
"+++ Verifying Prerequisites...."
if
[[
"
${
1
-
}
"
!=
"clean"
]]
;
then
if
[[
-z
"
$(
which docker
)
"
]]
;
then
if
[[
-z
"
$(
which docker
)
"
]]
;
then
echo
"Can't find 'docker' in PATH, please fix and retry."
>
&2
echo
"Can't find 'docker' in PATH, please fix and retry."
>
&2
echo
"See https://docs.docker.com/installation/#installation for installation instructions."
>
&2
echo
"See https://docs.docker.com/installation/#installation for installation instructions."
>
&2
...
@@ -143,6 +149,7 @@ function kube::build::verify_prereqs() {
...
@@ -143,6 +149,7 @@ function kube::build::verify_prereqs() {
}
>
&2
}
>
&2
exit
1
exit
1
fi
fi
fi
KUBE_ROOT_HASH
=
$(
kube::build::short_hash
"
$KUBE_ROOT
"
)
KUBE_ROOT_HASH
=
$(
kube::build::short_hash
"
$KUBE_ROOT
"
)
KUBE_BUILD_IMAGE_TAG
=
"build-
${
KUBE_ROOT_HASH
}
"
KUBE_BUILD_IMAGE_TAG
=
"build-
${
KUBE_ROOT_HASH
}
"
...
@@ -161,6 +168,7 @@ function kube::build::is_osx() {
...
@@ -161,6 +168,7 @@ function kube::build::is_osx() {
function
kube::build::clean_output
()
{
function
kube::build::clean_output
()
{
# Clean out the output directory if it exists.
# Clean out the output directory if it exists.
if
kube::build::has_docker
;
then
if
kube::build::build_image_built
;
then
if
kube::build::build_image_built
;
then
echo
"+++ Cleaning out _output/dockerized/bin/ via docker build image"
echo
"+++ Cleaning out _output/dockerized/bin/ via docker build image"
kube::build::run_build_command bash
-c
"rm -rf '
${
REMOTE_OUTPUT_BINPATH
}
'/*"
kube::build::run_build_command bash
-c
"rm -rf '
${
REMOTE_OUTPUT_BINPATH
}
'/*"
...
@@ -170,6 +178,7 @@ function kube::build::clean_output() {
...
@@ -170,6 +178,7 @@ function kube::build::clean_output() {
echo
"+++ Removing data container"
echo
"+++ Removing data container"
"
${
DOCKER
[@]
}
"
rm
-v
"
${
KUBE_BUILD_DATA_CONTAINER_NAME
}
"
>
/dev/null 2>&1
||
true
"
${
DOCKER
[@]
}
"
rm
-v
"
${
KUBE_BUILD_DATA_CONTAINER_NAME
}
"
>
/dev/null 2>&1
||
true
fi
echo
"+++ Cleaning out local _output directory"
echo
"+++ Cleaning out local _output directory"
rm
-rf
"
${
LOCAL_OUTPUT_ROOT
}
"
rm
-rf
"
${
LOCAL_OUTPUT_ROOT
}
"
...
@@ -197,6 +206,10 @@ function kube::build::prepare_output() {
...
@@ -197,6 +206,10 @@ function kube::build::prepare_output() {
}
}
function
kube::build::has_docker
()
{
which docker &> /dev/null
}
# Detect if a specific image exists
# Detect if a specific image exists
#
#
# $1 - image repo name
# $1 - image repo name
...
@@ -337,6 +350,8 @@ function kube::build::clean_image() {
...
@@ -337,6 +350,8 @@ function kube::build::clean_image() {
}
}
function
kube::build::clean_images
()
{
function
kube::build::clean_images
()
{
kube::build::has_docker
||
return
0
kube::build::clean_image
"
${
KUBE_BUILD_IMAGE
}
"
kube::build::clean_image
"
${
KUBE_BUILD_IMAGE
}
"
echo
"+++ Cleaning all other untagged docker images"
echo
"+++ Cleaning all other untagged docker images"
...
...
build/make-clean.sh
View file @
4b94829c
...
@@ -22,6 +22,6 @@ set -o pipefail
...
@@ -22,6 +22,6 @@ set -o pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
$KUBE_ROOT
/build/common.sh"
source
"
$KUBE_ROOT
/build/common.sh"
kube::build::verify_prereqs
kube::build::verify_prereqs
clean
kube::build::clean_output
kube::build::clean_output
kube::build::clean_images
kube::build::clean_images
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