forked from cllunsford/aws-signing-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (34 loc) · 1013 Bytes
/
Makefile
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
40
name=aws-signing-proxy
registry=cllunsford
gitrepo=github.com/cllunsford
tag=latest
go_ver=1.7
default:
@echo ""
@echo "make build:"
@echo " compiles the aws-signing-proxy app and builds the docker image"
@echo "make gobuild:"
@echo " compiles the aws-signing-proxy app (binary located in ./_bin)"
@echo "make dockbuild:"
@echo " builds the docker image"
@echo "make clean:"
@echo " removes all temporary files and build artifacts"
build: gobuild dockbuild
dockbuild:
[ -e ca-certificates.crt ] || wget https://curl.haxx.se/ca/cacert.pem -O ca-certificates.crt
docker build -t ${registry}/${name}:${tag} .
gobuild:
# copy src
mkdir -p _src/${gitrepo}/${name}
cp -r main.go _src/${gitrepo}/${name}
# compile
docker run \
-v `pwd`/_pkg:/go/pkg \
-v `pwd`/_bin:/go/bin \
-v `pwd`/_src:/go/src \
-e CGO_ENABLED=0 \
-e GOOS=linux \
golang:${go_ver} \
bash -c "go get ./src/${gitrepo}/${name}/...; chown -R $$(id -u):$$(id -g) ./"
clean:
rm -rf ./_* ca-certificates.crt aws-signing-proxy