Files

172 lines
5.4 KiB
YAML
Raw Permalink Normal View History

2025-01-10 11:12:03 +00:00
---
2024-12-19 11:38:57 +00:00
# https://taskfile.dev
2025-02-28 13:11:53 +00:00
version: "3"
2024-12-19 11:38:57 +00:00
vars:
LOCAL_COMPOSE_FILE: "deployments/compose.local.yaml"
TEST_COMPOSE_FILE: "deployments/compose.test.yaml"
GENERATE_COMPOSE_FILE: "deployments/compose.generate.yaml"
AWS_COMPOSE_FILE: "deployments/compose.aws.yaml"
2024-12-19 11:38:57 +00:00
tasks:
build:test:
desc: "Build containers using compose.test.yaml"
cmds:
- task: build
vars:
2025-02-28 13:11:53 +00:00
COMPOSE_FILE: "{{.TEST_COMPOSE_FILE}}"
build:generate:
desc: "Build containers using compose.generate.yaml (used by code generation)"
cmds:
- task: build
vars:
2025-02-28 13:11:53 +00:00
COMPOSE_FILE: "{{.GENERATE_COMPOSE_FILE}}"
2024-12-19 11:38:57 +00:00
build:
desc: "Build containers for the local compose stack (default: compose.local.yaml)"
vars:
2025-02-28 13:11:53 +00:00
COMPOSE_FILE: "{{.COMPOSE_FILE | default .LOCAL_COMPOSE_FILE}}"
2024-12-19 11:38:57 +00:00
cmds:
2025-01-07 13:06:43 +00:00
- docker compose -f {{.COMPOSE_FILE}} build
up:cmd:
internal: true
vars:
2025-02-28 13:11:53 +00:00
COMPOSE_FILE: "{{.COMPOSE_FILE | default .LOCAL_COMPOSE_FILE}}"
cmds:
- docker compose -f {{.COMPOSE_FILE}} up --no-recreate --wait -d
up:infra:
desc: "Start only infrastructure containers (localstack, db, prometheus)"
internal: true
vars:
COMPOSE_FILE: "{{.COMPOSE_FILE | default .LOCAL_COMPOSE_FILE}}"
cmds:
- docker compose -f {{.COMPOSE_FILE}} up localstack db prometheus -d --wait
up:test:
desc: "Bring up the test compose stack in the background"
cmds:
- task: up:cmd
vars:
2025-02-28 13:11:53 +00:00
COMPOSE_FILE: "{{.TEST_COMPOSE_FILE}}"
up:generate:
desc: "Bring up the generate compose stack (postgres used by db:generate)"
run: once
cmd: |
docker compose -f {{.GENERATE_COMPOSE_FILE}} up \
2025-05-08 16:04:45 +00:00
--wait -d
2025-04-22 19:57:35 +00:00
up:aws:
desc: "Build and start the local AWS-services compose stack (localstack-backed)"
2025-04-22 19:57:35 +00:00
cmds:
- task deps:tidy
- task docker:build
- task: build
- task: up:cmd
vars:
COMPOSE_FILE: "{{.AWS_COMPOSE_FILE}}"
- task: init
up:
desc: "Tidy deps, build images, and bring up the full local compose stack"
cmds:
2025-04-22 19:57:35 +00:00
- task deps:tidy
- task docker:build
- task: build
- task: up:infra
- task: init
- task: up:cmd
refresh:
desc: "Rebuild images and recycle the local stack (down then up:infra + services)"
2025-01-10 11:12:03 +00:00
cmds:
2025-04-22 19:57:35 +00:00
- task deps:tidy
- task docker:build
2025-08-05 07:03:35 -07:00
- task docker:build:debug
- task: build
- task: down
- task: up:infra
- task: init
- task: up:cmd
init:
internal: true
cmds:
- aws s3 mb s3://$BUCKET_IN
- aws sqs create-queue --queue-name $QNAME_STORE_EVENT
- aws sqs create-queue --queue-name $QNAME_DOCUMENT_INIT
- aws sqs create-queue --queue-name $QNAME_DOCUMENT_SYNC
- aws sqs create-queue --queue-name $QNAME_DOCUMENT_CLEAN
- aws sqs create-queue --queue-name $QNAME_DOCUMENT_TEXT
- aws sqs create-queue --queue-name $QNAME_QUERY_SYNC
- aws sqs create-queue --queue-name $QNAME_QUERY_RUNNER
- aws sqs create-queue --queue-name $QNAME_CLIENT_SYNC
- aws sqs create-queue --queue-name $QNAME_QUERY_VERSION_SYNC
- |
aws s3api put-bucket-notification-configuration \
--bucket $BUCKET_IN \
--notification-configuration '{
"QueueConfigurations": [{
"QueueArn": "arn:aws:sqs:us-east-1:000000000000:store_event",
2025-04-22 19:57:35 +00:00
"Events": ["s3:ObjectCreated:*"]
}]
}'
down:test:
desc: "Stop containers from the test compose stack"
cmds:
- task: down
vars:
2025-02-28 13:11:53 +00:00
COMPOSE_FILE: "{{.TEST_COMPOSE_FILE}}"
2025-04-22 19:57:35 +00:00
down:aws:
desc: "Stop containers from the AWS-services compose stack"
2025-04-22 19:57:35 +00:00
cmds:
- task: down
vars:
COMPOSE_FILE: "{{.AWS_COMPOSE_FILE}}"
2025-01-10 11:12:03 +00:00
down:
desc: "Stop containers for the local compose stack (run before fullsuite:ci)"
vars:
2025-02-28 13:11:53 +00:00
COMPOSE_FILE: "{{.COMPOSE_FILE | default .LOCAL_COMPOSE_FILE}}"
2025-01-10 11:12:03 +00:00
cmds:
- docker compose -f {{.COMPOSE_FILE}} down
clean:
desc: "Stop and remove containers AND volumes for the local compose stack"
vars:
COMPOSE_FILE: "{{.COMPOSE_FILE | default .LOCAL_COMPOSE_FILE}}"
cmds:
- docker compose -f {{.COMPOSE_FILE}} down -v
clean:test:
desc: "Stop and remove containers AND volumes for the test compose stack"
cmds:
- task: clean
vars:
COMPOSE_FILE: "{{.TEST_COMPOSE_FILE}}"
2025-04-22 19:57:35 +00:00
clean:aws:
desc: "Stop and remove containers AND volumes for the AWS compose stack"
2025-04-22 19:57:35 +00:00
run: once
cmds:
- task: clean
vars:
COMPOSE_FILE: "{{.AWS_COMPOSE_FILE}}"
lint:cmd:
internal: true
vars:
COMPOSE_FILE: "{{.COMPOSE_FILE | default .LOCAL_COMPOSE_FILE}}"
cmds:
- docker compose -f {{.COMPOSE_FILE}} config -q
2024-12-19 11:38:57 +00:00
lint:
desc: "Validate all compose files (local, test, generate, aws) with `compose config`"
deps:
- task: lint:cmd
vars:
COMPOSE_FILE: "{{.AWS_COMPOSE_FILE}}"
- task: lint:cmd
vars:
COMPOSE_FILE: "{{.LOCAL_COMPOSE_FILE}}"
- task: lint:cmd
vars:
COMPOSE_FILE: "{{.GENERATE_COMPOSE_FILE}}"
- task: lint:cmd
vars:
COMPOSE_FILE: "{{.TEST_COMPOSE_FILE}}"
2025-08-05 07:03:35 -07:00
rebuild:
desc: "Force complete rebuild of all containers (use when build cache causes issues)"
cmds:
- go clean -cache
- docker rmi {{.IMAGE_NAME}}:latest {{.IMAGE_NAME}}:debug || true
- task: refresh