Skip to content

Commit

Permalink
Add basic make file
Browse files Browse the repository at this point in the history
  • Loading branch information
hamidfzm committed Aug 16, 2018
1 parent 8db8d4f commit 21b0ff9
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
BINARY = timechi
SOURCES = $(*.go)
LD_FLAGS = "-X github.com/hamidfzm/timechi-server/cmd.versionPatch=`git rev-list HEAD --count`"
BRANCH=`git rev-parse --abbrev-ref HEAD`

build:
go build -ldflags $(LD_FLAGS) -o $(BINARY)

build-static:
CGO_ENABLED=0 GOOS=linux go build -ldflags $(LD_FLAGS) -a -installsuffix cgo -o $(BINARY)

install:
go install

vendor:
glide install

clean:
go clean
rm -rf $(BINARY)

pull:
git pull origin $(BRANCH)

push: pull
git push origin $(BRANCH)

docker-image: push vendor build-static
docker build -t hamidfzm/timechi-server:$(BRANCH) --rm .

docker: docker-image clean

0 comments on commit 21b0ff9

Please sign in to comment.