File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ [tools ]
2+ dotnet = ' 9'
3+
4+ [env ]
5+ PROJECT = " ./api/api.csproj"
6+ # Use 'container' on macOS, 'docker' elsewhere. Override with CONTAINER_CMD env var.
7+ CONTAINER_CMD = " {% if env.CONTAINER_CMD %}{{ env.CONTAINER_CMD }}{% elif os() == 'macos' %}container{% else %}docker{% endif %}"
8+
9+ [tasks .build ]
10+ description = " Build the project"
11+ run = " dotnet build --project $PROJECT"
12+
13+ [tasks .run ]
14+ description = " Run the development server"
15+ run = " dotnet run --project $PROJECT"
16+
17+ [tasks .clean ]
18+ description = " Clean build objects"
19+ run = """
20+ rm -rf ./api/bin/* ./api/obj/*
21+ rm -rf './Data Helper/bin/'* './Data Helper/obj/'*
22+ """
23+
24+ [tasks .docker-build ]
25+ description = " Build and tag the container image"
26+ run = " $CONTAINER_CMD build -f api/Dockerfile api -t pfapi:latest"
27+
28+ [tasks .docker-run ]
29+ description = " Build, tag, and run the container image binding to :8080"
30+ depends = [" docker-build" ]
31+ run = " $CONTAINER_CMD run -it --rm -d -p 8080:80 pfapi:latest"
32+
33+ [tasks .migratedb ]
34+ description = " Add and run migrations (usage: mise run migratedb <name>)"
35+ run = """
36+ #!/usr/bin/env bash
37+ if [ -z "$1" ]; then
38+ echo "Usage: mise run migratedb <migration_name>"
39+ exit 1
40+ fi
41+ dotnet ef migrations add "$1" --project $PROJECT
42+ dotnet ef database update --project $PROJECT
43+ """
You can’t perform that action at this time.
0 commit comments