-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (40 loc) · 1.22 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
BINARY_NAME := tmpnotes
GITSHA := $(shell git rev-parse HEAD)
GITTAG := $(shell git describe --tags)
.PHONY: test
test:
go test -v ./...
.PHONY: lint
lint:
@go fmt
@if test -z $(gofmt -l .); then \
echo "All golang files formatted correctly 👍️"; \
else \
echo "❗️ Golang formatting issues:"; gofmt -l .; \
fi
.PHONY: build
build:
go build -o ${BINARY_NAME} -ldflags "-s -w -X 'tmpnotes/internal/version.version=${GITTAG}' -X 'tmpnotes/internal/version.gitSHA=${GITSHA}'"
.PHONY: local-env
local-env:
docker-compose up
# just run a redis container for local development
.PHONY: dev
dev:
docker run -d --rm -p 6379:6379 --name tmpnotes_local redis
.PHONY: dev-down
dev-down:
docker stop tmpnotes_local
# Build a container image locally for development
.PHONY: container-dev
container-dev:
docker-compose -f docker-compose-dev.yaml build --build-arg VERSION=${GITTAG} --build-arg GITSHA=${GITSHA}
docker-compose -f docker-compose-dev.yaml up
.PHONY: container-dev-down
container-dev-down:
docker-compose -f docker-compose-dev.yaml down
.PHONY: deploy-heroku
deploy-heroku:
heroku container:login
heroku container:push web --arg VERSION=${GITTAG},GITSHA=${GITSHA} -a tmpnotes
heroku container:release web -a tmpnotes