-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
executable file
·50 lines (36 loc) · 1.12 KB
/
build.sh
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
41
42
43
44
45
46
47
48
49
#!/bin/sh
VERSION=0.2.1
TAG=b1ce9ed6e5b6178fbfa73d3764d25a6e1f20fc82
CADDY_TAG=37b291f82c2083a378b698577640389686b0baf4
if [ "$1" = "" ]; then
docker run --rm \
-v $(pwd):/go/src/github.com/wadahiro/coredns-amazondns \
-v $(pwd)/.tmp:/go \
-w /go/src/github.com/wadahiro/coredns-amazondns \
golang:1.9 ./build.sh $TAG $CADDY_TAG
else
echo "Building CoreDNS:$1 with amazondns..."
go get github.com/coredns/coredns
cd /go/src/github.com/mholt/caddy
git checkout $2
cd /go/src/github.com/coredns/coredns
git reset --hard HEAD
git clean -f
git checkout $1
if [ "$?" -ne 0 ]; then
echo "Invalid tag: $1"
exit 1
fi
sed -i -e "/^route53:route53$/i amazondns:github.com/wadahiro/coredns-amazondns" plugin.cfg
if [ "$?" -ne 0 ]; then
echo "Failed"
exit 1
fi
cat plugin.cfg
go generate
#make
go build
cp coredns /go/src/github.com/wadahiro/coredns-amazondns/
tar cvzf coredns-amazondns_${VERSION}_linux-amd64.tgz coredns
mv coredns-*.tgz /go/src/github.com/wadahiro/coredns-amazondns/
fi