-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (36 loc) · 1.08 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
# Load environment variables from .env file
ifneq (,$(wildcard ./.env))
include .env
export
endif
IMAGE_NAME=shave
# Simple helper to create secrets
# I always forget the command
new_secret:
openssl rand -base64 64
init:
sh init.sh
templ:
@templ generate --watch
# Uses the rules in .air.toml file to run
server:
@air
css:
@npx tailwindcss -i ./public/css/input.css -o ./public/css/style.css --watch
dev:
@make -j3 css templ server
test:
go test ./...
update-mocks:
@mockgen -source=./internal/database/querierExtended.go -destination=mocks/db/querierExtended.go
@mockgen -source=./pkg/aws/aws.go -destination=mocks/aws/aws.go
prod:
@VERSION=$(shell git describe --tags --always --dirty) && \
echo "Building Docker image with tag: $$VERSION" && \
docker build -t $(IMAGE_NAME):$$VERSION .
db-up:
@GOOSE_MIGRATION_DIR=$(MIGRATION_DIR) GOOSE_DBSTRING=$(SQL_URL) goose turso up
db-down:
@GOOSE_MIGRATION_DIR=$(MIGRATION_DIR) GOOSE_DBSTRING=$(SQL_URL) goose turso down
db-down-all:
@GOOSE_MIGRATION_DIR=$(MIGRATION_DIR) GOOSE_DBSTRING=$(SQL_URL) goose turso down-to 0