-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
166 lines (126 loc) · 4.72 KB
/
justfile
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
default:
@just --choose
#
# Docker
#
start *params='-d':
docker-compose up {{params}}
stop:
docker-compose down
build *params:
docker-compose build {{params}}
logs service *params:
docker-compose logs {{params}} {{service}}
follow service: (logs service '-f')
restart *services:
docker-compose restart {{services}}
exec service +command:
docker-compose exec {{service}} {{command}}
ports:
docker-compose ps --format json | jq -r '.[] | .Service, .Publishers[]?.PublishedPort'
docker-prune *params:
docker system prune --filter label=com.docker.compose.project=$COMPOSE_PROJECT_NAME {{params}}
prune: docker-prune (docker-prune '--volumes')
purge-pg:
docker volume rm ${COMPOSE_PROJECT_NAME}_pg-data
#
# Development
#
leaks:
gitleaks detect --baseline-path gitleaks-report.json --redact --report-path gitleaks-findings.json
temporal *args:
docker-compose exec temporal-admin-tools temporal {{args}}
gateway-db-push:
docker-compose exec gateway npm run prisma:db:push
gateway-db-reset:
docker-compose exec gateway npm run prisma:migrate:reset
docker-compose restart postgres
gateway-prisma-generate:
docker-compose exec gateway npm run prisma:migrate:dev
gateway-es-push-mappings:
docker-compose exec gateway npm run es:push-mappings
gateway-migrate-dev:
docker-compose exec gateway npm run prisma:migrate:dev
cd services/gateway; npm run prisma:generate
gateway-schedule:
just temporal workflow execute --task-queue background --type updateDailySaltWorkflow --workflow-id update-daily-salt
-just temporal schedule create --schedule-id update-daily-salt --cron @daily --overlap-policy skip --task-queue background --workflow-type updateDailySaltWorkflow --workflow-id update-daily-salt
-just temporal schedule create --schedule-id update-upload-scores --interval 5m --overlap-policy skip --task-queue background --workflow-type updateUploadScoresWorkflow --workflow-id update-upload-scores
-just temporal schedule create --schedule-id update-comment-scores --interval 5m --overlap-policy skip --task-queue background --workflow-type updateCommentScoresWorkflow --workflow-id update-comment-scores
gateway-schedule-delete:
just temporal schedule delete --schedule-id update-daily-salt
just temporal schedule delete --schedule-id update-upload-scores
just temporal schedule delete --schedule-id update-comment-scores
gateway-init: gateway-migrate-dev gateway-es-push-mappings gateway-schedule
s3-prune-multipart-uploads:
cd scripts; S3_BUCKET=${S3_INGEST_BUCKET} npm run s3:prune-multipart-uploads
init: gateway-init
reset:
just stop
docker volume prune --all --force
just start
sleep 10
just init seed
npmi-host-scripts:
cd scripts; npm i
npmi-host-gateway:
cd services/gateway; npm i
npmi-host-web-next:
cd apps/web-next; npm i
npmi-host-web-qwik:
cd apps/web-qwik; npm i
npmi-host-web:
cd apps/web; npm i
npmi-host: npmi-host-gateway npmi-host-web npmi-host-web-next npmi-host-web-qwik npmi-host-scripts
npmi-gateway: (exec 'gateway' 'npm' 'i')
npmi-web: (exec 'web' 'npm' 'i')
npmi-web-next: (exec 'web-next' 'npm' 'i')
npmi-web-qwik: (exec 'web-qwik' 'npm' 'i')
npmi: npmi-gateway npmi-web npmi-web-next npmi-web-qwik
# npmci scripts always run on host (except during docker build)
npmci-scripts:
cd scripts; npm ci
npmci-gateway:
cd services/gateway; npm ci
npmci-web:
cd apps/web; npm ci
npmci-web-next:
cd apps/web-next; npm ci
npmci-web-qwik:
cd apps/web-qwik; npm ci
npmci: npmci-gateway npmci-web npmci-web-next npmci-web-qwik npmci-scripts
seed-db:
docker-compose exec gateway npm run prisma:db:seed
seed-s3-ingest:
rclone sync --fast-list --checksum -P ./seed-data/lcdevs3/letschurch-dev-ingest lcdevs3:letschurch-dev-ingest
seed-s3-public:
rclone sync --fast-list --checksum -P ./seed-data/lcdevs3/letschurch-dev-public lcdevs3:letschurch-dev-public
seed-s3: seed-s3-ingest seed-s3-public
seed: seed-s3 seed-db
truncate:
docker-compose exec gateway npm run prisma:db:truncate
check-gateway:
cd services/gateway; npm run check
check-scripts:
cd scripts; npm run check
check-web:
cd apps/web; npm run check
check: check-gateway check-scripts check-web
export CI := "1"
test-gateway:
cd services/gateway; npm test
test: test-gateway
transcribe file:
docker-compose run --rm -v $PWD:/host -w /host transcribe-worker /bin/bash -c 'ffmpeg -i {{file}} -ar 16000 -ac 1 {{file}}.wav'
docker-compose run --rm -v $PWD:/host -w /host transcribe-worker /bin/bash -c 'whisper-ctranslate2 --model large-v2 --vad_filter True {{file}}.wav'
rm {{file}}.wav
transcribe-dir dir:
fd . {{dir}} | xargs -o -n1 just transcribe
tf *params:
just infra/tf {{params}}
deploy env:
just infra/deploy {{env}}
dash:
sampler -c ./infra/sampler.yml
pv-usage *flags='-h':
./infra/pv-usage.sh {{flags}}