-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
105 lines (92 loc) · 2.37 KB
/
Taskfile.yml
File metadata and controls
105 lines (92 loc) · 2.37 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
version: '3'
env:
DOCKER_REPO: bjd145
tasks:
default:
cmds:
- task --list
db:
desc: Apply EF Core migrations to the SQLite database
dir: src/api
cmds:
- dotnet ef migrations add Initial --project ./WatchTracker.Api.csproj
- dotnet ef database update --project ./WatchTracker.Api.csproj
build-api:
desc: Build the .NET API project
dir: src/api
cmds:
- dotnet build
build-web:
desc: Build the React frontend
dir: src/web
cmds:
- npm install
- npm run build
run-api:
desc: Run the .NET API server
dir: src/api
cmds:
- dotnet run
env:
ASPNETCORE_ENVIRONMENT: Development
run-web:
desc: Run the Vite dev server
dir: src/web
cmds:
- npm install
- npm run dev
build:
desc: Build both API and web
deps:
- db
- build-api
- build-web
run:
desc: Run both API and web servers in parallel
deps:
- run-api
- run-web
silent: true
docker-build:
desc: Build the Docker container image
vars:
COMMIT_SHA:
sh: git rev-parse --short HEAD
cmds:
- docker build -t {{.DOCKER_REPO}}/watch-tracker-app:{{.COMMIT_SHA}} -t {{.DOCKER_REPO}}/watch-tracker-app:latest .
docker-push:
desc: Build the Docker container image
vars:
COMMIT_SHA:
sh: git rev-parse --short HEAD
cmds:
- docker push {{.DOCKER_REPO}}/watch-tracker-app:{{.COMMIT_SHA}}
- docker push {{.DOCKER_REPO}}/watch-tracker-app:latest
docker-run:
desc: Run the Docker container locally
dotenv: ['.env']
vars:
COMMIT_SHA:
sh: git rev-parse --short HEAD
cmds:
- docker stop watch-tracker-app && docker rm watch-tracker-app || true
- docker run -p 8080:8080 -d
-e Jwt__Key=${JWT_KEY}
-e Jwt__Issuer=Horologium
-e Jwt__Audience=Solis
-e Anthropic__ApiKey=${ANTHROPIC_API_KEY:-}
-v watch-tracker-data:/app/data
-v watch-tracker-uploads:/app/uploads
--name watch-tracker-app
{{.DOCKER_REPO}}/watch-tracker-app:{{.COMMIT_SHA}}
init:
desc: Generate a .env file with a random JWT key
status:
- test -f .env
cmds:
- |
cat > .env <<EOF
JWT_KEY=$(openssl rand -base64 48)
ANTHROPIC_API_KEY=
EOF
- echo ".env file created with a generated JWT key."