-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (36 loc) · 1.04 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
50
# Your Makefile rules
all:
@echo "This is the main Makefile."
clean:
rm -rf bin tmp
build:
CGO_ENABLED=0 GOOS=linux go build -o bin/htemplx main.go
serve: build
./bin/htemplx serve
DB_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable
migrate-up:
go run main.go migrate up --db_url=${DB_URL}
migrate-down:
go run main.go migrate down --db_url=${DB_URL}
templ-install:
go install github.com/a-h/templ/cmd/templ@latest
templ-generate:
templ generate
air-install:
go install github.com/air-verse/air@latest
run:
air -c .air.toml
tailwind-gen:
npx tailwindcss -i ./public/assets/css/input.css -o ./public/assets/css/output.css
# Docker Compose File
COMPOSE_FILE=distribution/compose/docker-compose.yml
COMPOSE_FILE_DEV=distribution/compose/docker-compose-dev.yml
# Build the Go binary and Docker image
docker-build:
docker build -f ./distribution/docker/Dockerfile -t htemplx .
# Start the services
docker-up:
docker-compose -f $(COMPOSE_FILE) up
# Start the services
docker-up-dev:
docker-compose -f $(COMPOSE_FILE_DEV) up