Skip to content

Commit

Permalink
add Version via ldflags (as unix timestamp)
Browse files Browse the repository at this point in the history
  • Loading branch information
apparentorder committed Mar 3, 2021
1 parent 1adf213 commit d4c90f8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
NAME = reweb
REPO = public.ecr.aws/g2o8x4n0/reweb
VERSION = latest
REPO = public.ecr.aws/apparentorder/reweb
TAG = $(shell date +%s)

all: build deploy

build:
go build -o reweb -tags netgo -ldflags -s
go build -o reweb -tags netgo -ldflags "-s -X main.Version=$(TAG)"

TAG = $(shell date +%s)
deploy:
docker build -t $(NAME) .
docker tag $(NAME) $(REPO):$(TAG)
docker tag $(NAME) $(REPO):latest
docker tag $(NAME) $(REPO):$(VERSION)
docker push $(REPO):$(TAG)
docker push $(REPO):latest
docker push $(REPO):$(VERSION)

0 comments on commit d4c90f8

Please sign in to comment.