forked from tkestack/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvagrant.sh
More file actions
executable file
·32 lines (26 loc) · 760 Bytes
/
Copy pathvagrant.sh
File metadata and controls
executable file
·32 lines (26 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
set -e
cur_dir=`pwd`
export package=${cur_dir#*$GOPATH/src/}
export go_folder=${GO_FOLDER:-/tmp/golang}
function download_go() {
if [ ! -f $go_folder/go1.10.3.linux-amd64.tar.gz ]; then
echo golang package not exist in $go_floder, will download
mkdir -p $go_folder
wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz -O $go_folder/go1.10.3.linux-amd64.tar.gz
fi
}
action=${1}
case $action in
up)
download_go
vagrant up
;;
destroy|halt|resume|ssh|suspend|status|validate)
vagrant $action
;;
*)
echo "Usage: GO_FOLDER=xxx $0 [vagrant_action]"
echo " GO_FOLDER is folder where go1.10.3.linux-amd64.tar.gz exist"
;;
esac