forked from turnerlabs/antiope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (48 loc) · 1.71 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
ifndef env
# $(error env is not set)
env ?= dev
endif
ifdef CONFIG
include $(CONFIG)
export
else
include config.$(env)
export
endif
ifndef STACK_PREFIX
$(error STACK_PREFIX is not set)
endif
ifndef BUCKET
$(error BUCKET is not set)
endif
everything: cognito-deploy inventory-deploy search-deploy
library:
cd lambda_layer && $(MAKE) layer
cognito-deploy:
cd cognito && $(MAKE) deploy
inventory-deploy:
cd aws-inventory && $(MAKE) deploy
inventory-update:
cd aws-inventory && $(MAKE) update
search-deploy:
cd search-cluster && $(MAKE) deploy-all
search-update:
cd search-cluster && $(MAKE) update
clean:
cd aws-inventory && $(MAKE) clean
cd search-cluster && $(MAKE) clean
# cd cognito && $(MAKE) clean
trigger-inventory:
./bin/trigger_inventory.sh $(STACK_PREFIX)-$(env)-aws-inventory
sync-resources:
aws s3 sync s3://$(BUCKET)/Resources/$(type) Scratch/Resources/$(env)/$(type)
open Scratch/Resources/$(env)/$(type)
sync-reports:
aws s3 sync s3://$(BUCKET)/Reports Scratch/Reports/$(STACK_PREFIX)-$(env)
open Scratch/Reports/$(STACK_PREFIX)-$(env)
disable-inventory:
$(eval EVENT := $(shell aws cloudformation describe-stacks --stack-name $(STACK_PREFIX)-$(env)-aws-inventory --query 'Stacks[0].Outputs[?OutputKey==`TriggerEventName`].OutputValue' --output text --region $(AWS_DEFAULT_REGION)))
aws events disable-rule --name $(EVENT) --output text --region $(AWS_DEFAULT_REGION)
enable-inventory:
$(eval EVENT := $(shell aws cloudformation describe-stacks --stack-name $(STACK_PREFIX)-$(env)-aws-inventory --query 'Stacks[0].Outputs[?OutputKey==`TriggerEventName`].OutputValue' --output text --region $(AWS_DEFAULT_REGION)))
aws events enable-rule --name $(EVENT) --output text --region $(AWS_DEFAULT_REGION)