-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (55 loc) · 1.52 KB
/
Makefile
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
.PHONY: all
all: vet build
.PHONY: build
build:
go build ./cmd/intake-invoke
go build ./cmd/intake-pull
go build ./cmd/outlet-failure
go build ./cmd/outlet-success
.PHONY: vet
vet:
go vet ./...
.PHONY: test
test:
go test -v -count=1 ./...
.PHONY: lint
lint:
golangci-lint run
.PHONY: clean
clean:
rm -f intake-invoke intake-pull outlet-failure outlet-success
.PHONY: tf-init
tf-init:
docker compose run terraform init -upgrade
.PHONY: tf-apply
tf-apply:
docker compose run terraform apply -auto-approve
.PHONY: db
db:
docker compose run psql ./setup.sh
docker compose run -e PGDATABASE=qtr_test psql ./setup.sh
.PHONY: psql
psql:
docker compose run psql 'psql -h db -U qtr'
.PHONY: restart
restart:
docker compose restart -t 0 intake-invoke intake-pull outlet-failure outlet-success lambda-tailf pgweb
.PHONY: message
message:
docker compose run \
awscli sqs send-message --region us-east-1 --endpoint-url http://localstack:4566 \
--queue-url qtr-intake \
--message-attributes "FunctionName={StringValue=qtr-job,DataType=String}" \
--message-body '{"date":"$(shell date)","_fail":"$(JOB_FAIL)"}'
.PHONY: failure
failure: JOB_FAIL:=true
failure: message
.PHONY: message-for-aws
message-for-aws:
aws sqs send-message \
--queue-url $(shell aws sqs get-queue-url --queue-name qtr-intake --output text) \
--message-attributes "FunctionName={StringValue=qtr-job,DataType=String}" \
--message-body '{"date":"$(shell date)","_fail":"$(JOB_FAIL)"}'
.PHONY: failure-for-aws
failure-for-aws: JOB_FAIL:=true
failure-for-aws: