-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (42 loc) · 2 KB
/
Makefile
File metadata and controls
54 lines (42 loc) · 2 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
local := http:\/\/127.0.0.1:8879\/charts
remote := https:\/\/raw.githubusercontent.com\/olmax99\/treesnqsweb\/master\/helmdist
AWS_REGION := eu-central-1
PROJECT_NAME := treesnqsweb-dev
all: help
.PHONY: help ## Help
help:
@grep '^.PHONY:.*' Makefile | sed 's/\.PHONY:[ \t]\+\(.*\)[ \t]\+##[ \t]*\(.*\)/\1 \2/' | expand -t20
.PHONY: templates ## Sync local data with AWS (s3 files and cloudformation)
templates:
aws s3 cp --recursive media s3://${PROJECT_NAME}-djangoapp-mediastore-${AWS_REGION}
.PHONY: runserver ## Run local Django development server
runserver:
cd djangoapp/ && \
PYTHONPATH=$(pwd) python -m pipenv run python manage.py runserver 8081 --settings=app.settings.local
.PHONY: makemigrations ## Make migrations for local Django sqlite3 db
makemigrations:
cd djangoapp/ && \
PYTHONPATH=$(pwd) python -m pipenv run python manage.py makemigrations --settings=app.settings.local
.PHONY: migrate ## Migrate local Django sqlite3 db
migrate: makemigrations
cd djangoapp/ && \
PYTHONPATH=$(pwd) python -m pipenv run python manage.py migrate --settings=app.settings.local
.PHONY: charts ## w/o make: helm fetch --untar -d djangohelm/charts/ stable/postgresql
charts:
cd djangohelm/ && \
helm dep update && \
cd ..
.PHONY: dev ## Continuous local development in Minikube
dev: charts
aws cloudformation --region ${AWS_REGION} create-stack --stack-name ${PROJECT_NAME} \
--template-body file://cloudformation/development/cloudformation.dev.mediastore.yml \
--parameters ParameterKey="ProjectNamePrefix",ParameterValue="${PROJECT_NAME}"
skaffold dev
.PHONY: dist ## Update and build packages locally. Ensure that local helm server is up.
package:
for x in */requirements.*; do sed -i -e "s/${remote}/${local}/g" $$x; done
for x in */Chart.yaml; do helm lint $$(dirname $$x) && helm package -u -d helmdist $$(dirname $$x); done
for x in */requirements.*; do sed -i -e "s/${local}/${remote}/g" $$x; done
.PHONY: index ## Generate the YAML index to serve the available packages.
dist: package
helm repo index ./helmdist