chore: include a setup and secrets generation command in taskfile
This commit is contained in:
parent
280cb93648
commit
36a3d6f962
1 changed files with 15 additions and 0 deletions
15
Taskfile.yml
15
Taskfile.yml
|
|
@ -48,3 +48,18 @@ tasks:
|
|||
- go tool templ generate
|
||||
- mkdir -p ./dist
|
||||
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X main.version={{.VERSION}}" -o ./dist/budgit ./cmd/server/main.go
|
||||
setup:
|
||||
desc: Sets up the local development environment
|
||||
cmds:
|
||||
- cp .env.include.example .env
|
||||
- go-task generate-secrets
|
||||
generate-secrets:
|
||||
desc: Generates a random GOSHOP_APP_KEY and sets it in .env
|
||||
cmds:
|
||||
- |
|
||||
KEY=$(openssl rand -hex 32)
|
||||
sed -i "s/^JWT_SECRET=.*/JWT_SECRET=${KEY}/" .env
|
||||
echo "JWT_SECRET set in .env"
|
||||
silent: true
|
||||
preconditions:
|
||||
- test -f .env
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue