2023-04-20 13:30:10 +02:00
|
|
|
# run tailwindcss tool in watch mode.
|
2023-04-13 00:07:08 +02:00
|
|
|
watch-tw:
|
2023-04-20 13:30:10 +02:00
|
|
|
npm i
|
2023-04-26 22:44:18 +02:00
|
|
|
npx tailwindcss -i ./assets/input.css -o ./assets/pcmt.css --watch
|
2023-04-13 00:07:08 +02:00
|
|
|
|
2023-04-20 13:30:10 +02:00
|
|
|
# start browser-sync.
|
2023-04-13 00:07:08 +02:00
|
|
|
watch-brs:
|
2023-04-20 13:30:10 +02:00
|
|
|
npm i
|
2023-04-13 00:07:08 +02:00
|
|
|
npx browser-sync start --config bs.js
|
|
|
|
|
2023-04-20 13:30:10 +02:00
|
|
|
# build app stylesheets using the tailwindcss cli tool.
|
2023-04-13 00:07:08 +02:00
|
|
|
tw:
|
2023-04-20 13:30:10 +02:00
|
|
|
npm i
|
2023-04-26 22:44:18 +02:00
|
|
|
npx tailwindcss -i ./assets/input.css -o ./assets/pcmt.css --minify
|
2023-04-13 00:07:08 +02:00
|
|
|
|
2023-04-20 13:30:10 +02:00
|
|
|
# build the application.
|
2023-04-13 00:07:08 +02:00
|
|
|
build:
|
2023-04-20 13:30:10 +02:00
|
|
|
go mod tidy
|
2023-04-13 00:07:08 +02:00
|
|
|
go build -v -ldflags="-X main.version=$(git rev-parse --short HEAD)" .
|
|
|
|
|
2023-04-20 13:30:10 +02:00
|
|
|
# run the application.
|
2023-04-13 00:07:08 +02:00
|
|
|
run:
|
|
|
|
./pcmt -devel
|
|
|
|
|
2023-04-20 13:30:10 +02:00
|
|
|
# build and run the application
|
2023-04-13 00:07:08 +02:00
|
|
|
dev: build run
|
|
|
|
|
2023-05-03 23:58:40 +02:00
|
|
|
# prepare the app for production.
|
|
|
|
prod: tw build
|
|
|
|
|
2023-04-13 00:07:08 +02:00
|
|
|
# generate code based on ent schemas.
|
|
|
|
gen:
|
|
|
|
go generate -v ./ent
|
2023-05-03 23:58:23 +02:00
|
|
|
|
|
|
|
# start pg.
|
|
|
|
dbstart:
|
|
|
|
podman run \
|
|
|
|
--name pg \
|
|
|
|
--rm \
|
|
|
|
-it \
|
|
|
|
-e POSTGRES_PASSWORD=postgres \
|
2023-05-04 00:12:14 +02:00
|
|
|
-v $PWD/tmp/db:/var/lib/postgresql/data \
|
2023-05-03 23:58:23 +02:00
|
|
|
-p 127.0.0.1:5432:5432 \
|
|
|
|
docker.io/library/postgres:15.2-alpine3.17
|
|
|
|
|
|
|
|
# stop pg.
|
|
|
|
dbstop:
|
|
|
|
podman stop pg
|