2024-02-10 17:05:11 +00:00
|
|
|
# Always use devbox environment to run commands.
|
|
|
|
set shell := ["devbox", "run"]
|
2024-02-11 19:28:00 +00:00
|
|
|
# Load dotenv
|
|
|
|
set dotenv-load
|
2024-02-10 17:05:11 +00:00
|
|
|
|
2024-02-12 08:25:11 +00:00
|
|
|
STATIC_DIR := "./web/static"
|
2024-02-10 11:59:58 +00:00
|
|
|
|
2024-02-16 21:31:00 +00:00
|
|
|
# Build the application
|
|
|
|
build:
|
|
|
|
docker build -f build/Dockerfile -t ghcr.io/mentos1386/zdravko:latest .
|
|
|
|
|
2024-02-11 10:56:21 +00:00
|
|
|
# Run full development environment
|
|
|
|
run:
|
|
|
|
devbox services up
|
2024-02-10 11:59:58 +00:00
|
|
|
|
2024-02-16 21:31:00 +00:00
|
|
|
# Start zdravko
|
|
|
|
run-zdravko:
|
|
|
|
go build -o dist/zdravko cmd/zdravko/main.go
|
|
|
|
./dist/zdravko
|
2024-02-10 11:59:58 +00:00
|
|
|
|
2024-02-11 09:15:00 +00:00
|
|
|
# Deploy the application to fly.io
|
|
|
|
deploy:
|
2024-02-17 20:31:09 +00:00
|
|
|
fly deploy --ha=false -c deploy/fly.toml
|
2024-02-11 10:56:21 +00:00
|
|
|
|
|
|
|
# Start devbox shell
|
|
|
|
shell:
|
|
|
|
devbox shell
|
|
|
|
|
|
|
|
# Generate and download all external dependencies.
|
|
|
|
generate:
|
2024-02-15 22:47:56 +00:00
|
|
|
rm -rf internal/models/query/*
|
2024-02-11 10:56:21 +00:00
|
|
|
go generate ./...
|
|
|
|
|
|
|
|
_tailwindcss-build:
|
2024-02-16 21:31:00 +00:00
|
|
|
tailwindcss build -c build/tailwind.config.js -i {{STATIC_DIR}}/css/main.css -o {{STATIC_DIR}}/css/tailwind.css
|
2024-02-11 10:56:21 +00:00
|
|
|
|
|
|
|
_htmx-download:
|
|
|
|
mkdir -p {{STATIC_DIR}}/js
|
|
|
|
curl -sLo {{STATIC_DIR}}/js/htmx.min.js https://unpkg.com/htmx.org/dist/htmx.min.js
|
|
|
|
|
|
|
|
_feather-icons-download:
|
|
|
|
mkdir -p {{STATIC_DIR}}/icons
|
|
|
|
curl -sLo {{STATIC_DIR}}/icons/feather-sprite.svg https://unpkg.com/feather-icons/dist/feather-sprite.svg
|
|
|
|
|
|
|
|
_generate-gorm:
|
2024-02-11 19:28:00 +00:00
|
|
|
go run tools/generate/main.go
|