-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |