-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathTaskfile.yml
More file actions
86 lines (77 loc) · 2.54 KB
/
Taskfile.yml
File metadata and controls
86 lines (77 loc) · 2.54 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
# SPDX-License-Identifier: Apache-2.0
version: '3'
includes:
api: ./modules/odr_api/Taskfile.api.yml
api-test: ./modules/odr_api/tests/Taskfile.api.test.yml
core: ./modules/odr_core/Taskfile.core.yml
frontend: ./modules/odr_frontend/Taskfile.frontend.yml
dotenv: ['.env', '{{.ENV}}/.env', '{{.HOME}}/.env']
vars:
ROOT_DIR:
sh: echo ${ROOT_DIR}
ENV_FILE:
sh: echo ${ROOT_DIR}/.env
tasks:
default:
desc: List all the tasks
cmds:
- task --list
setup:
desc: Setup the project
cmds:
- cmd: powershell -ExecutionPolicy ByPass -File ./scripts/setup.ps1
platforms: [windows]
- cmd: ./scripts/setup.sh
platforms: [linux, darwin]
- cmd: docker network inspect omi-network >/dev/null 2>&1 || docker network create omi-network
- task: reload-env
- cmd: task setup-venv
- cmd: task frontend:install-dev
reload-env:
cmds:
- echo "Reloading environment variables"
vars:
ROOT_DIR:
sh: echo ${ROOT_DIR}
ENV_FILE:
sh: echo ${ROOT_DIR}/.env
DOTENV:
sh: |
if [ -f ${ROOT_DIR}/.env ]; then
set -o allexport
source ${ROOT_DIR}/.env
set +o allexport
echo "Sourced .env file"
else
echo "No .env file found"
fi
setup-venv:
desc: Setup the virtual environment
cmds:
- cmd: ./scripts/setup_virt_env.sh
platforms: [linux, darwin]
- cmd: powershell -ExecutionPolicy ByPass -File ./scripts/setup_virt_env.ps1
platforms: [windows]
dev:
desc: Start development environment with odr-api in watch mode and databases headless
cmds:
- docker compose up --watch --build
dev:migrate:
desc: Start development environment with database migrations enabled
cmds:
- |
export VITE_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "local-dev")
export VITE_GIT_COMMIT=$(git rev-parse HEAD 2>/dev/null || echo "unknown")
export VITE_BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
export VITE_APP_VERSION=$(node -p "require('./modules/odr_frontend/package.json').version" 2>/dev/null || echo "dev")
RUN_MIGRATIONS=true docker compose up --watch --build
test-all:
desc: Run all tests against the running docker container setup
cmds:
- echo "Starting all tests ..."
- task: core:test
# - task: api:test-all
# - task: api-test:test-all
- task: frontend:test-unit
- task: frontend:test-integration
- echo "All testing complete"