Add cleanup function to make the build.sh more robust

pull/6/head
wizard 2015-03-06 12:04:42 +08:00
parent c80ef5de60
commit ca16a57b54
2 changed files with 9 additions and 3 deletions

View File

@ -17,9 +17,15 @@
# Download the etcd, flannel, and K8s binaries automatically
# Run as root only
# author @resouer
# author @resouer @WIZARD-CXY
set -e
function cleanup {
# cleanup work
rm -rf flannel kubernetes* etcd* binaries
}
trap cleanup SIGHUP SIGINT SIGTERM
# check root
if [ "$(id -u)" != "0" ]; then
echo >&2 "Please run as root"

View File

@ -11,7 +11,7 @@ This document describes how to deploy kubernetes on multiple ubuntu nodes, inclu
*3 These guide is tested OK on Ubuntu 14.04 LTS 64bit server, but it should also work on most Ubuntu versions*
*4 Dependences of this guide: etcd-2.0.0, flannel-0.2.0, k8s-0.10.1, but it should also work on higher versions*
*4 Dependences of this guide: etcd-2.0.0, flannel-0.2.0, k8s-0.12.0, but it may work with higher versions*
### **Main Steps**
@ -21,7 +21,7 @@ On your laptop, copy `cluster/ubuntu-cluster` directory to your workspace.
The `build.sh` will download and build all the needed binaries into `./binaries`.
You can customize your etcd version or K8s version in the build.sh by changing variable `ETCD_V` and `K8S_V`, default etcd version is 2.0.0 and K8s version is 0.12.0.
You can customize your etcd version or K8s version in the build.sh by changing variable `ETCD_V` and `K8S_V` in build.sh, default etcd version is 2.0.0 and K8s version is 0.12.0.
```