-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (55 loc) · 2.5 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
python = python2.7
SHELL=/bin/bash
DOCKER_HELPER := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/docker_helper.sh
ROLE_VERSION=$(shell cat $(PWD)/../version.txt)
ROLE_NAME=$(shell . $(DOCKER_HELPER) ; getUpDirLevel2)
REGISTRY_HOST=docker.io
USERNAME=softasap
all: clean_build
clean_build: clean initialize build
build: p-env/bin/ansible-container
@echo p-env/bin/ansible-container --debug --project-name $(ROLE_NAME) build --roles-path ./roles/ -- -vvv
@p-env/bin/ansible-container --debug --project-name $(ROLE_NAME) build --roles-path ./roles/ -- -vvv
@echo "Application docker image was build"
run: p-env/bin/ansible-container
@echo p-env/bin/ansible-container --debug --project-name $(ROLE_NAME) run --roles-path ./roles/ -- -vvv
@p-env/bin/ansible-container --debug --project-name $(ROLE_NAME) run --roles-path ./roles/ -- -vvv
@echo "Application environment was started"
stop: p-env/bin/ansible-container
@echo p-env/bin/ansible-container --debug --project-name $(ROLE_NAME) stop
@p-env/bin/ansible-container --debug --project-name $(ROLE_NAME) stop
@echo "Application environment was stopped"
p-env/bin/pip: p-env/bin/python
p-env/bin/pip install -r requirements.txt
p-env/bin/python:
virtualenv -p $(python) --no-site-packages p-env
@touch $@
p-env/bin/ansible-container: p-env/bin/pip
@touch $@
clean:
@rm -rf .Python p-env roles
initialize:
@init_quick.sh
tag:
@docker tag $(ROLE_NAME)-api:latest softasap/sa-container-box-examples:$(ROLE_NAME).api.$(ROLE_VERSION)
@docker tag $(ROLE_NAME)-api:latest softasap/sa-container-box-examples:$(ROLE_NAME).api.latest
@docker tag $(ROLE_NAME)-nginx:latest softasap/sa-container-box-examples:$(ROLE_NAME).nginx.$(ROLE_VERSION)
@docker tag $(ROLE_NAME)-nginx:latest softasap/sa-container-box-examples:$(ROLE_NAME).nginx.latest
push:
@docker push softasap/sa-container-box-examples:$(ROLE_NAME).api.$(ROLE_VERSION)
@docker push softasap/sa-container-box-examples:$(ROLE_NAME).api.latest
@docker push softasap/sa-container-box-examples:$(ROLE_NAME).nginx.$(ROLE_VERSION)
@docker push softasap/sa-container-box-examples:$(ROLE_NAME).nginx.latest
sh-conductor:
until [ "`/usr/bin/docker inspect -f {{.State.Running}} $(ROLE_NAME)_conductor`"=="true" ]; do \
sleep 0.1; \
echo "Waiting for $(ROLE_NAME)..." \
done; \
docker exec -it $(ROLE_NAME)_conductor /bin/sh
compose-up:
@docker-compose up --no-recreate
compose-stop:
@docker-compose stop
compose-down: compose-stop
@docker-compose rm --force
.PHONY: all clean initialize build run stop