forked from aliyun/aliyun-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (42 loc) · 1.74 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
export VERSION=3.0.0
all: build
publish: build build_mac build_linux build_windows
deps:
-go get github.com/aliyun/aliyun-openapi-meta
go get gopkg.in/ini.v1
go get github.com/droundy/goopt
go get github.com/alyu/configparser
go get github.com/syndtr/goleveldb/leveldb
go get github.com/aliyun/aliyun-oss-go-sdk/oss
go get -u github.com/jteeuwen/go-bindata/...
go get github.com/jmespath/go-jmespath
go get github.com/aliyun/alibaba-cloud-sdk-go/sdk
go get github.com/posener/complete
go get github.com/aliyun/ossutil/lib
testdeps:
go get -v github.com/onsi/ginkgo/ginkgo
go get -v github.com/onsi/gomega
go install github.com/onsi/ginkgo/ginkgo
go get gopkg.in/check.v1
metas:
go-bindata -o resource/metas.go -pkg resource -prefix ../aliyun-openapi-meta ../aliyun-openapi-meta/**/* ../aliyun-openapi-meta/products.json
clean:
rm -f resource/metas.go
rm -rf out/*
build: metas
go build -ldflags "-X 'github.com/aliyun/aliyun-cli/cli.Version=${VERSION}'" -o out/aliyun main/main.go
install: build
cp out/aliyun /usr/local/bin
build_mac:
GOOS=darwin GOARCH=amd64 go build -o out/aliyun main/main.go
tar zcvf out/aliyun-cli-macosx-${VERSION}-amd64.tgz -C out aliyun
aliyun oss cp out/aliyun-cli-macosx-${VERSION}-amd64.tgz oss://aliyun-cli --force --profile oss
build_linux:
GOOS=linux GOARCH=amd64 go build -o out/aliyun main/main.go
tar zcvf out/aliyun-cli-linux-${VERSION}-amd64.tgz -C out aliyun
aliyun oss cp out/aliyun-cli-linux-${VERSION}-amd64.tgz oss://aliyun-cli --force --profile oss
build_windows:
GOOS=windows GOARCH=amd64 go build -o aliyun.exe main/main.go
zip -r out/aliyun-cli-windows-${VERSION}-amd64.zip aliyun.exe
aliyun oss cp out/aliyun-cli-windows-${VERSION}-amd64.zip oss://aliyun-cli --force --profile oss
rm aliyun.exe