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-05-08 00:13:33 +02:00
|
|
|
npx tailwindcss -i ./assets/input/css/tailwind.css -o ./assets/public/css/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-05-08 00:13:33 +02:00
|
|
|
npx tailwindcss -i ./assets/input/css/tailwind.css -o ./assets/public/css/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 \
|
2023-05-04 00:12:39 +02:00
|
|
|
--userns=keep-id \
|
2023-05-03 23:58:23 +02:00
|
|
|
--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
|
2023-05-08 23:42:27 +02:00
|
|
|
|
|
|
|
# process svg template assets.
|
|
|
|
svgo:
|
2023-05-11 14:26:27 +02:00
|
|
|
svgo -i templates/svg-*.tmpl
|
2023-05-08 23:42:27 +02:00
|
|
|
|
|
|
|
# vim: set ts=2 ft=just syntax=make fenc=utf-8 ff=unix :
|