-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
92 lines (76 loc) · 2.55 KB
/
Taskfile.yml
File metadata and controls
92 lines (76 loc) · 2.55 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
version: "3"
vars:
BATS: tests/bats-core/bin/bats
BATS_ARGS: --recursive --timing
# Enable the Docker socket overlay with: WITH_DOCKER=true task up
DOCKER_COMPOSE:
sh: |
if [ "{{.WITH_DOCKER | default "false"}}" = "true" ]; then
printf '%s\n' 'docker compose -f docker-compose.yml -f docker-compose.docker.yml'
else
printf '%s\n' 'docker compose -f docker-compose.yml'
fi
tasks:
config:
desc: Render the Docker Compose configuration
cmds:
- "{{.DOCKER_COMPOSE}} config"
migrate-env:
desc: Migrate .env names and add missing entries from .env.example
cmds:
- scripts/migrate-env.sh '{{.ENV_FILE | default ".env"}}' '{{.ENV_EXAMPLE | default ".env.example"}}'
build:
desc: Build the opencode image
cmds:
- DOCKER_BUILDKIT=1 {{.DOCKER_COMPOSE}} build
up:
desc: Start the opencode stack in the background
cmds:
- "{{.DOCKER_COMPOSE}} up -d"
logs:
desc: Follow opencode container logs
cmds:
- "{{.DOCKER_COMPOSE}} logs -f opencode"
shell:
desc: Open a bash shell in the running opencode container
cmds:
- "{{.DOCKER_COMPOSE}} exec opencode bash"
opencode:
desc: Run opencode in the running container (optional args after --)
cmds:
- "{{.DOCKER_COMPOSE}} exec opencode opencode {{.CLI_ARGS}}"
test-unit:
desc: Run the unit Bats suite
cmds:
- "{{.BATS}} {{.BATS_ARGS}} tests/unit/"
test-integration:
desc: Run the integration Bats suite in single-threaded mode
cmds:
- "{{.BATS}} --jobs 1 {{.BATS_ARGS}} tests/integration/"
test-lint:
desc: Run the lint/structure Bats suite
cmds:
- "{{.BATS}} {{.BATS_ARGS}} tests/lint/"
test-all:
desc: Run all Bats suites
cmds:
- task test-unit
- task test-integration
- task test-lint
test:
desc: Alias for test-all
cmds:
- task test-all
tunnel-quick:
desc: Start Cloudflare quick tunnel (random URL, no account)
cmds:
- "{{.DOCKER_COMPOSE}} -f docker-compose.tunnel.yml --profile quick up -d"
tunnel-managed:
desc: Start Cloudflare managed tunnel (stable domain, requires CF_TUNNEL_TOKEN)
cmds:
- "{{.DOCKER_COMPOSE}} -f docker-compose.tunnel.yml --profile managed up -d"
tunnel-down:
desc: Stop Cloudflare tunnel services without affecting the main stack
cmds:
- "{{.DOCKER_COMPOSE}} -f docker-compose.tunnel.yml stop cloudflared cloudflared-managed || true"
- "{{.DOCKER_COMPOSE}} -f docker-compose.tunnel.yml rm -f cloudflared cloudflared-managed || true"