Files
query-orchestration/scripts/local-deployments.yml
T

148 lines
3.9 KiB
YAML
Raw 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:
cmds:
- task: build
vars:
2025-02-28 13:11:53 +00:00
COMPOSE_FILE: "{{.TEST_COMPOSE_FILE}}"
build:generate:
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:
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:test:
cmds:
- task: up:cmd
vars:
2025-02-28 13:11:53 +00:00
COMPOSE_FILE: "{{.TEST_COMPOSE_FILE}}"
up: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:
cmds:
- task deps:tidy
- task docker:build
- task: build
- task: up:cmd
vars:
COMPOSE_FILE: "{{.AWS_COMPOSE_FILE}}"
- task: init
up:
cmds:
2025-04-22 19:57:35 +00:00
- task deps:tidy
- task docker:build
- task: build
- task: up:cmd
- task: init
refresh:
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:cmd
- task: init
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:
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:
cmds:
- task: down
vars:
COMPOSE_FILE: "{{.AWS_COMPOSE_FILE}}"
2025-01-10 11:12:03 +00:00
down:
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:
vars:
COMPOSE_FILE: "{{.COMPOSE_FILE | default .LOCAL_COMPOSE_FILE}}"
cmds:
- docker compose -f {{.COMPOSE_FILE}} down -v
clean:test:
cmds:
- task: clean
vars:
COMPOSE_FILE: "{{.TEST_COMPOSE_FILE}}"
2025-04-22 19:57:35 +00:00
clean:aws:
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:
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