feat: port verified messenger from lab 6
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
include Makefile
|
||||
|
||||
CLEANUP_ARGS ?= --dry-run
|
||||
SERVICES ?=
|
||||
JOB_ID ?=
|
||||
ATTACHMENT_ID ?=
|
||||
REASON ?=
|
||||
export JOB_ID ATTACHMENT_ID REASON
|
||||
|
||||
COMPOSE = docker compose --project-name highload-lab7 --env-file .env -f compose.yml
|
||||
|
||||
.PHONY: app-init app-build app-up app-start app-stop app-down app-restart app-logs app-status
|
||||
.PHONY: app-migrate app-s3-bootstrap worker-start worker-stop queue-status attachments-cleanup
|
||||
.PHONY: jobs-failed jobs-replay jobs-upgrade jobs-cleanup-staging
|
||||
.PHONY: test-backend test-pipeline frontend-build
|
||||
|
||||
|
||||
app-init:
|
||||
$(PYTHON) scripts/init_env.py
|
||||
|
||||
app-build: app-init
|
||||
$(COMPOSE) build
|
||||
|
||||
app-up: app-init
|
||||
$(COMPOSE) up -d --build --wait
|
||||
|
||||
app-start: app-init
|
||||
$(COMPOSE) up -d --no-build --wait
|
||||
|
||||
app-stop:
|
||||
$(COMPOSE) stop
|
||||
|
||||
app-down:
|
||||
$(COMPOSE) down
|
||||
|
||||
app-restart: app-init
|
||||
./scripts/restart.sh
|
||||
|
||||
app-logs:
|
||||
$(COMPOSE) logs -f --tail=100 $(SERVICES)
|
||||
|
||||
app-status:
|
||||
$(COMPOSE) ps --all
|
||||
|
||||
app-migrate: app-init
|
||||
$(COMPOSE) run --rm migrate
|
||||
|
||||
app-s3-bootstrap: app-init
|
||||
$(COMPOSE) run --rm s3-bootstrap
|
||||
|
||||
worker-start:
|
||||
$(COMPOSE) start worker
|
||||
|
||||
worker-stop:
|
||||
$(COMPOSE) stop worker
|
||||
|
||||
queue-status:
|
||||
$(COMPOSE) exec -T broker rabbitmqctl -q list_queues name messages_ready messages_unacknowledged --formatter json
|
||||
|
||||
attachments-cleanup:
|
||||
$(COMPOSE) run --rm --no-deps upload-cleanup ./messenger attachments-cleanup $(CLEANUP_ARGS)
|
||||
|
||||
jobs-failed:
|
||||
$(COMPOSE) exec -T dispatcher ./messenger jobs list-failed
|
||||
|
||||
jobs-replay:
|
||||
@test -n "$$JOB_ID" && test -n "$$REASON" || { echo "Set JOB_ID=... REASON='...'"; exit 2; }
|
||||
$(COMPOSE) exec -T dispatcher ./messenger jobs replay "$$JOB_ID" "$$REASON"
|
||||
|
||||
jobs-upgrade:
|
||||
@test -n "$$ATTACHMENT_ID" && test -n "$$REASON" || { echo "Set ATTACHMENT_ID=... REASON='...'"; exit 2; }
|
||||
$(COMPOSE) exec -T dispatcher ./messenger jobs upgrade "$$ATTACHMENT_ID" 2 "$$REASON"
|
||||
|
||||
jobs-cleanup-staging:
|
||||
@test -n "$$JOB_ID" || { echo "Set JOB_ID=..."; exit 2; }
|
||||
$(COMPOSE) exec -T dispatcher ./messenger jobs cleanup-staging "$$JOB_ID"
|
||||
|
||||
test-backend: app-init
|
||||
$(COMPOSE) --profile test run --rm --build backend-tests
|
||||
|
||||
test-pipeline: app-init
|
||||
$(COMPOSE) --profile test run --rm --build backend-tests go test -race -count=1 -v ./backend/tests ./backend/workers -run 'TestPipeline|TestVersionedRendering|TestThumbnail|TestOptimized'
|
||||
|
||||
frontend-build:
|
||||
$(COMPOSE) exec -T frontend npm run build
|
||||
Reference in New Issue
Block a user