-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (59 loc) · 1.93 KB
/
Makefile
File metadata and controls
70 lines (59 loc) · 1.93 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
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
70
# 기본 목표
.DEFAULT_GOAL := help
# 도움말 출력
.PHONY: help
help:
@echo "Usage:"
@echo " make <target>"
@echo ""
@echo "Targets:"
@echo " help Show this help message."
@echo " add-init Make __init__ files in python dirs."
@echo " venv Create venv and activate venv."
@echo " install Install dependencies."
@echo " tree Display the project directory structure."
@echo " lint Run code linters."
@echo " clean Clean build files."
@echo " zip Make zip file for project"
@echo " preview Run Pulumi preview."
@echo " up Deploy infrastructure with Pulumi."
@echo " destroy Destroy infrastructure with Pulumi."
# 가상환경 생성 및 활성화
.PHONY: venv
venv:
python -m venv venv && source venv/bin/activate
# 종속성 설치
.PHONY: install
install:
pyenv exec python -m venv venv && bash -c 'source venv/bin/activate && \
pip install --upgrade pip && pip install -e ".[dev]" --config-settings editable_mode=compat && \
([ ! -d .git ] && git init || echo "Git repository already initialized") && \
pre-commit install --install-hooks && pre-commit autoupdate'
# 프로젝트 디렉토리 구조 출력
.PHONY: tree
tree:
tree -I '__pycache__|*.pyc|*.pyo|venv|*.egg-info|build|*.md' > .tree
# lint 실행
.PHONY: lint
lint:
pre-commit run --all-files
# 빌드 파일 정리
.PHONY: clean
clean:
find . -type d -name '__pycache__' -exec rm -r {} + && \
find . -type f -name '*.pyc' -delete && \
rm -rf venv .mypy_cache .pytest_cache .tree
# 압축
.PHONY: zip clean
zip: clean
zip -r ziped_project.zip . -x "*/__pycache__/*" -x ".git/*" -x "*/.DS_Store" -x "auto_diagrams/*" -x "codelab_oci_pulumi.egg-info/*" -x "docs/*"
# Pulumi 명령어 실행
.PHONY: preview
preview:
pulumi preview
.PHONY: up
up:
pulumi up --yes
.PHONY: destroy
destroy:
pulumi destroy --yes