-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathTiltfile
More file actions
84 lines (78 loc) · 1.62 KB
/
Tiltfile
File metadata and controls
84 lines (78 loc) · 1.62 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
load('ext://pulumi', 'pulumi_resource')
load('ext://uibutton', 'cmd_button', 'location')
docker_build(
'api-image',
context='.',
dockerfile='./Dockerfile.dev',
ignore=[
'./node_modules',
'./.infra',
'__tests__',
'./seeds',
'./build',
],
live_update=[
sync('./src', '/opt/app/src'),
sync('./bin', '/opt/app/bin'),
run(
'pnpm install',
trigger=['./package.json', './pnpm-lock.yaml']
)
])
pulumi_resource(
'api',
stack='adhoc',
dir='.infra/',
deps=[
'.infra/index.ts',
'.infra/workers.ts',
'.infra/.env',
],
image_deps=['api-image'],
image_configs=['image'],
)
# Add a button to API to run pulumi up
cmd_button(
name='api_pulumi_up',
resource='api',
text='Run pulumi up',
icon_name='arrow_circle_up',
requires_confirmation=True,
dir='./.infra',
argv=[
'pulumi', 'up',
'--stack', 'adhoc',
'--yes',
'--skip-preview',
],
)
# Add a button to API to seed the database
cmd_button(
name="db_seed",
resource="api",
text="Seed Database",
icon_name="repartition",
requires_confirmation=True,
dir="./",
argv=["npm", "run", "db:seed:import"],
)
# Add a button to API to run db migrations
cmd_button(
name="db_migrate",
resource="api",
text="Run database migrations",
icon_name="dns",
requires_confirmation=True,
dir="./",
argv=["npm", "run", "db:migrate:latest"],
)
# Add a button to API to run db rollback
cmd_button(
name="db_rollback",
resource="api",
text="Run database rollback",
icon_name="settings_backup_restore",
requires_confirmation=True,
dir="./",
argv=["npm", "run", "db:migrate:rollback"],
)