Adding Makefile for easier builds and ci 01/31101/3
authorKiran <kiran.k.kamineni@intel.com>
Fri, 9 Feb 2018 18:01:22 +0000 (10:01 -0800)
committerKiran <kiran.k.kamineni@intel.com>
Fri, 9 Feb 2018 20:56:26 +0000 (12:56 -0800)
Adding a Makefile to allow easier builds and for jenkins integration
jenkins jjb will call make build, make deploy and so on
Makefile resides along with the main application go file

Issue-ID: AAF-117

Change-Id: Ibf4413a26d5572703bea122d3d0db83f4c35ae88
Signed-off-by: Kiran <kiran.k.kamineni@intel.com>
sms-service/src/sms/Makefile [new file with mode: 0644]

diff --git a/sms-service/src/sms/Makefile b/sms-service/src/sms/Makefile
new file mode 100644 (file)
index 0000000..a206c55
--- /dev/null
@@ -0,0 +1,25 @@
+GOPATH := $(shell realpath "$(PWD)/../../")
+BINARY := sms
+DEPENDENCIES := github.com/golang/dep/cmd/dep
+
+export GOPATH ...
+
+all: build test
+deploy: build test
+
+build: deps format
+       $(GOPATH)/bin/dep ensure
+       go build -o $(GOPATH)/target/$(BINARY) -v sms.go
+
+clean:
+       go clean
+       rm -f $(GOPATH)/target/$(BINARY)
+
+test:
+       go test -v ./...
+
+format:
+       go fmt ./...
+
+deps:
+       go get -u $(DEPENDENCIES)
\ No newline at end of file