forked from unicef/etools-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (36 loc) · 1.73 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
BUILDDIR=build
PATTERN=etools
DOCKER_CONTAINERS=$(shell docker ps -a -f "name=${PATTERN}")
DOCKER_IMAGES=$(shell docker images|grep '${PATTERN}')
DOCKER = docker
help:
@echo ' '
@echo 'Usage: '
@echo ' make info gives information regarding images and containers '
@echo ' make ssh ssh into backend container '
@echo ' make migrations run backend migrations '
@echo ' make init initialize the environment '
@echo ' make devup run the environment '
@echo ' make clean get rid of images and containers '
@echo ' '
info:
@echo 'DOCKER CONTAINERS'
@docker ps -a -f name=${PATTERN}infra
@echo ' '
@echo '-------------------------------------------------------------------------------'
@echo ' '
@echo 'DOCKER IMAGES'
@docker images "etoolsdev/${PATTERN}*"
ssh:
@docker exec -it etoolsinfra_backend /bin/bash
migrations:
@docker exec -it etoolsinfra_backend python /code/manage.py migrate --noinput
init:
@docker-compose up --force-recreate --build
build:
@docker-compose up --force-recreate
devup:
@docker-compose up
clean:
docker rm $$(docker ps -a -f name=${PATTERN}infra -q)
docker rmi $$(docker images "etoolsdev/${PATTERN}*" -q)