-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (36 loc) · 1.53 KB
/
Copy pathMakefile
File metadata and controls
43 lines (36 loc) · 1.53 KB
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
.PHONY: help install test deploy destroy clean upload-test-data
help:
@echo "Available commands:"
@echo " make install - Install Python dependencies"
@echo " make test - Run unit tests"
@echo " make deploy - Deploy infrastructure with Terraform"
@echo " make destroy - Destroy infrastructure"
@echo " make upload-test-data - Upload example CSV files to S3"
@echo " make clean - Clean up generated files"
install:
pip install -r requirements.txt
test:
pytest tests/ -v --cov=src --cov-report=html --cov-report=term
deploy:
cd infrastructure && terraform init && terraform apply
destroy:
cd infrastructure && terraform destroy
clean:
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
rm -rf htmlcov .coverage
rm -f infrastructure/*.zip
upload-test-data:
@cd infrastructure && BUCKET=$$(terraform output -raw s3_bucket_name 2>/dev/null); \
if [ -z "$$BUCKET" ]; then \
echo "Error: Could not get bucket name. Have you deployed the infrastructure?"; \
exit 1; \
fi; \
cd .. && \
echo "Uploading test data to bucket: $$BUCKET" && \
aws s3 cp example_data/clients_20200130.csv s3://$$BUCKET/ && \
aws s3 cp example_data/portfolios_20200130.csv s3://$$BUCKET/ && \
aws s3 cp example_data/accounts_20200130.csv s3://$$BUCKET/ && \
aws s3 cp example_data/transactions_20200130.csv s3://$$BUCKET/ && \
echo "✅ Test data uploaded successfully!"