-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevtools-golang.bash
executable file
·39 lines (32 loc) · 1.23 KB
/
devtools-golang.bash
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
33
34
35
36
37
38
39
#!/bin/bash
go-shell() {
project=`basename $(pwd)`
docker run -it --rm -v ${local_dir}:/go/src/github.com/poddworks/${project} -w /go/src/github.com/poddworks/${project} golang:1-devtools bash
}
make() {
project=`basename $(pwd)`
docker run -it --rm -v ${local_dir}:/go/src/github.com/poddworks/${project} -w /go/src/github.com/poddworks/${project} golang:1-devtools make ${@}
}
dep() {
project=`basename $(pwd)`
docker run -it --rm -v ${local_dir}:/go/src/github.com/poddworks/${project} -w /go/src/github.com/poddworks/${project} golang:1-devtools dep ${@}
}
go() {
project=`basename $(pwd)`
docker run -it --rm -v ${local_dir}:/go/src/github.com/poddworks/${project} -w /go/src/github.com/poddworks/${project} golang:1-devtools go ${@}
}
case $1 in
init)
docker build -t golang:1-devtools . -f-<<EOF
FROM golang:1
RUN curl -fsSL -o /usr/local/bin/confd https://github.com/kelseyhightower/confd/releases/download/v0.16.0/confd-0.16.0-linux-amd64 && \
chmod +x /usr/local/bin/confd
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && \
chmod +x /usr/local/bin/dep
EOF
;;
*)
export local_dir=${1:-$(pwd)}
# Do nothing, loading as build tool
;;
esac