forked from Azure/Guest-Configuration-Extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (37 loc) · 1.27 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
BUNDLEDIR=bundle
BINDIR=bin
BIN=guest-configuration-extension
BUNDLE=guest-configuration-extension.zip
bundle: clean binary
@mkdir -p $(BUNDLEDIR)
zip ./$(BUNDLEDIR)/$(BUNDLE) ./$(BINDIR)/$(BIN)
zip ./$(BUNDLEDIR)/$(BUNDLE) ./agent/GC_*.zip
zip ./$(BUNDLEDIR)/$(BUNDLE) ./$(BINDIR)/guest-configuration-shim
zip -j ./$(BUNDLEDIR)/$(BUNDLE) ./misc/HandlerManifest.json
zip -j ./$(BUNDLEDIR)/$(BUNDLE) ./misc/manifest.xml
build: binary
binary: clean
if [ -z "$$GOPATH" ]; then \
echo "GOPATH is not set"; \
exit 1; \
fi
go get github.com/ahmetalpbalkan/govvv
go get github.com/tools/godep
$$GOPATH/bin/godep restore
go list ./... | grep -v '/vendor/' | xargs go test -cover
GOOS=linux GOARCH=amd64 govvv build -v \
-ldflags "-X main.Version=`grep -E -m 1 -o '<Version>(.*)</Version>' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \
-o $(BINDIR)/$(BIN) ./main
cp ./misc/guest-configuration-shim ./$(BINDIR)
test: clean
go list ./... | grep -v '/vendor/' | xargs go test -cover
sanity: clean prereqs
golint ./main/ ./pkg/
gofmt -w -s ./main/ ./pkg/
go vet -v ./main/
go list ./... | grep -v '/vendor/' | xargs go test -cover
prereqs: clean
go get golang.org/x/lint/golint
clean:
rm -rf "$(BINDIR)" "$(BUNDLEDIR)"
.PHONY: clean binary test