saasitone/Makefile

57 lines
906 B
Makefile
Raw Normal View History

# Connect to the primary database
2021-12-14 18:16:48 -08:00
.PHONY: db
db:
psql postgresql://admin:admin@localhost:5432/app
# Connect to the test database
2021-12-14 18:16:48 -08:00
.PHONY: db-test
db-test:
psql postgresql://admin:admin@localhost:5432/app_test
2021-12-13 09:51:00 -08:00
# Connect to the primary cache
2021-12-27 14:36:18 -08:00
.PHONY: cache
cache:
redis-cli
# Connect to the test cache
.PHONY: cache-test
cache-test:
redis-cli -n 1
2021-12-27 14:36:18 -08:00
# Install Ent code-generation module
.PHONY: ent-install
ent-install:
go get -d entgo.io/ent/cmd/ent
# Generate Ent code
2021-12-11 10:46:01 -08:00
.PHONY: ent-gen
ent-gen:
go generate ./ent
# Create a new Ent entity
2021-12-11 10:46:01 -08:00
.PHONY: ent-new
ent-new:
go run entgo.io/ent/cmd/ent init $(name)
# Start the Docker containers
2021-12-11 11:00:10 -08:00
.PHONY: up
up:
docker-compose up -d
sleep 3
# Rebuild Docker containers to wipe all data
.PHONY: reset
reset:
docker-compose down
make up
# Run the application
2021-12-11 11:00:10 -08:00
.PHONY: run
run:
2021-12-11 13:06:28 -08:00
clear
go run main.go
# Run all tests
.PHONY: test
2021-12-17 18:14:43 -08:00
test:
2021-12-19 10:22:44 -08:00
go test -p 1 ./...