-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
64 lines (59 loc) · 1.83 KB
/
Taskfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
version: 3
# User by --watch
interval: '500ms'
dotenv: ['.env']
vars:
DATABASE_PATH: $DATABASE_PATH
COMMIT_ID:
sh: git rev-parse --short HEAD || echo "unknown"
tasks:
dev:
desc: Run the application in development mode with hot reload
cmds:
- air
test:
desc: Run tests
cmds:
- go test ./... -v
upgrade:
desc: Upgrade dependencies
cmds:
- go get -u ./...
generate:
desc: Run go generate
cmds:
- go generate ./...
- sqlboiler sqlite3
migrate:
desc: generate migrations
cmd: atlas migrate hash --dir "file://internal/database/migrations" && atlas migrate diff {{.CLI_ARGS}} --dir "file://internal/database/migrations" --to file://schema.hcl --dev-url "sqlite://file?mode=memory&_fk=1"
migrate-apply:
desc: apply migrations using atlas
cmds:
# variables will be pulled from global vars declaration unless overwritten in the task call
- echo "Applying migrations to {{.DATABASE_PATH}}"
- atlas migrate apply --allow-dirty --dir "file://internal/database/migrations" --tx-mode all --url "sqlite://{{.DATABASE_PATH}}?_fk=1"
- task: generate
build:fast:
desc: Build the application without go generate
env:
BUILD_MODE: true
CGO_ENABLED: 0
GOOS: linux
cmds:
- go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o {{ .CLI_ARGS | default "app" }} .
build:full:
desc: Build the application with go generate
aliases: [build]
deps: [generate]
cmds:
- task: build:fast
build:docker:
desc: Build the application without generating styles
deps: [generate]
cmds:
- task: build:fast
build:image:
desc: Build the Docker image
cmds:
- docker build --progress=plain --platform linux/amd64 -t {{ .CLI_ARGS | default "github.com/cufee/feedlr-yt" }} .