generated from cds-snc/project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
55 lines (39 loc) · 1.7 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
.PHONY: fmt fmt-ci install install-dev lint lint-ci test build up shell down
fmt:
black .
fmt-ci:
black --check .
install:
pip3 install --user -r requirements.txt
install-dev:
pip3 install --user -r requirements_dev.txt
lint:
flake8 .
lint-ci: lint
test:
pytest -s -vv .
build:
docker-compose -f images/cloud_asset_inventory/dev/docker-compose.yml build
build-prod: # Local build of prod image
docker build \
-t cloud_asset_inventory:latest \
images/cloud_asset_inventory/cloudquery
start:
export AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID); \
export AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY); \
export AWS_SESSION_TOKEN=$(AWS_SESSION_TOKEN); \
docker-compose -f images/cloud_asset_inventory/dev/docker-compose.yml up -d
start-logging:
docker-compose -f images/cloud_asset_inventory/dev/docker-compose.yml exec -d app /usr/local/bin/log_connections.sh
attach:
docker-compose -f images/cloud_asset_inventory/dev/docker-compose.yml exec app bash
stop:
docker-compose -f images/cloud_asset_inventory/dev/docker-compose.yml down
copy-logs:
-docker cp $(shell docker-compose -f images/cloud_asset_inventory/dev/docker-compose.yml ps -q app):/var/log/connection_logs.txt ./tools/logs-analyzer/connection_logs.txt
-docker cp $(shell docker-compose -f images/cloud_asset_inventory/dev/docker-compose.yml ps -q app):/var/log/cloudquery.log ./tools/logs-analyzer/cloudquery.log
copy-data:
mkdir -p ./tools/logs-analyzer/cloudquery/data
docker cp $(shell docker-compose -f images/cloud_asset_inventory/dev/docker-compose.yml ps -q app):/cloudquery/data/. ./tools/logs-analyzer/cloudquery/data/
delete-logs:
docker-compose -f images/cloud_asset_inventory/dev/docker-compose.yml exec app rm /var/log/connection_logs.txt