Skip to content

Commit

Permalink
Merge pull request #10 from livekit-examples/update-task-file
Browse files Browse the repository at this point in the history
Refactor taskfile.yaml
  • Loading branch information
Ocupe authored Sep 30, 2024
2 parents a5e9629 + 40c14d0 commit 2118da4
Showing 1 changed file with 5 additions and 62 deletions.
67 changes: 5 additions & 62 deletions taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,79 +1,22 @@
version: "3"

output: interleaved

dotenv:
- "frontend/.env.local"
- "agent/.env.local"
dotenv: [".env.local"]

tasks:
post_create:
desc: "Runs after this template is instantiated as a Sandbox or Bootstrap"
cmds:
- task: post_create_sandbox
- task: post_create_frontend

post_create_sandbox:
silent: true
cmds:
- echo -e "To setup and run the agent:\n"
- echo -e " cd {{.ROOT_DIR}}/agent"
- echo -e " python3 -m venv venv"
- platforms: [darwin, linux]
cmd: echo -e " source venv/bin/activate"
- platforms: [windows]
cmd: echo -e " powershell venv/Scripts/Activate.ps1"
- echo -e " python3 -m pip install -r requirements.txt"
- echo -e " python3 agent.py start\n"

post_create_frontend:
silent: true
cmds:
- echo -e "To setup and run the frontend:\n"
- echo -e " cd {{.USER_WORKING_DIR}}/frontend"
- echo -e " pnpm install"
- echo -e " pnpm dev\n"
- echo -e "To setup and run the frontend:\r\n"
- echo -e "\tcd {{.ROOT_DIR}}\r"
- echo -e "\tpnpm install\r"
- echo -e "\tpnpm dev\r\n"

install:
desc: "Bootstrap application for local development"
deps:
- install_sandbox
- install_frontend

install_sandbox:
dir: "agent"
cmds:
- "python3 -m venv venv"
- platforms: [darwin, linux]
cmd: "source venv/bin/activate"
- platforms: [windows]
cmd: "powershell venv/Scripts/Activate.ps1"
- "python3 -m pip install -r requirements.txt"

install_frontend:
dir: "frontend"
interactive: true
cmds:
- "pnpm install"

dev:
interactive: true
deps:
- dev_sandbox
- dev_frontend

dev_sandbox:
dir: "agent"
interactive: true
cmds:
- platforms: [darwin, linux]
cmd: "source venv/bin/activate"
- platforms: [windows]
cmd: "powershell venv/Scripts/Activate.ps1"
- "python3 agent.py start"

dev_frontend:
dir: "frontend"
interactive: true
cmds:
- "pnpm dev"

0 comments on commit 2118da4

Please sign in to comment.