-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (32 loc) · 1 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
REQUIREMENTS_CONTAINER = mwaaas/django-sample-packages
env=development
NAME=mwaaas/django-sample-app
VERSION = $(env)_$(v)
build_package_app:
docker build --tag=$(REQUIREMENTS_CONTAINER):$(v) devops/app_container
push_packaged_app:
docker push mwaaas/django-sample-packages:$(v)
push_build_packaged_app: build_package_app push_packaged_app
configure:
chmod u+x app_server.sh
deploy:
ifeq (development , $(env))
docker-compose build
docker-compose up
else
@make deploy_to_cloud
endif
deploy_to_cloud: configure_docker_aws build_app push_app redeploy
@echo "done deploying"
configure_docker_aws:
ansible-playbook -c local -i devops/app_container/inventory.ini devops/app_container/configure_docker_aws.yml --extra-vars='env=$(env) version=$(VERSION) name=$(NAME)'
build_app:
docker build --tag=$(NAME):$(VERSION) .
push_app:
docker push $(NAME):$(VERSION)
redeploy:
eb deploy sample-app-staging
# export amazon credentials
credentials:
export AWS_ACCESS_KEY_ID=$(id)
export AWS_SECRET_ACCESS_KEY=$(key)