-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (53 loc) · 1.92 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
#!/usr/bin/env make -f
# -*- makefile -*-
SHELL = bash -e
all_ps_hashes = $(shell docker ps -q)
img_hash = $(shell docker images -q luisalejandro/agoras-actions:latest)
exec_on_docker = docker compose \
-p agoras-actions -f docker-compose.yml exec \
--user agoras app
image:
@docker compose -p agoras-actions -f docker-compose.yml build \
--build-arg UID=$(shell id -u) \
--build-arg GID=$(shell id -g)
start:
@if [ -z "$(img_hash)" ]; then\
make image;\
fi
@docker compose -p agoras-actions -f docker-compose.yml up \
--remove-orphans --no-build --detach
console: start
@$(exec_on_docker) bash
functional-test: start
@$(exec_on_docker) bash test.sh
virtualenv: start
@python3 -m venv --clear ./virtualenv
@./virtualenv/bin/python3 -m pip install --upgrade pip
@./virtualenv/bin/python3 -m pip install --upgrade setuptools
@./virtualenv/bin/python3 -m pip install --upgrade wheel
@./virtualenv/bin/python3 -m pip install https://github.com/LuisAlejandro/agoras/archive/develop.zip
stop:
@docker-compose -p agoras-actions -f docker-compose.yml stop app
down:
@docker-compose -p agoras-actions -f docker-compose.yml down \
--remove-orphans
destroy:
@echo
@echo "WARNING!!!"
@echo "This will stop and delete all containers, images and volumes related to this project."
@echo
@read -p "Press ctrl+c to abort or enter to continue." -n 1 -r
@docker compose -p agoras-actions -f docker-compose.yml down \
--rmi all --remove-orphans --volumes
cataplum:
@echo
@echo "WARNING!!!"
@echo "This will stop and delete all containers, images and volumes present in your system."
@echo
@read -p "Press ctrl+c to abort or enter to continue." -n 1 -r
@if [ -n "$(all_ps_hashes)" ]; then\
docker kill $(shell docker ps -q);\
fi
@docker compose -p agoras-actions -f docker-compose.yml down \
--rmi all --remove-orphans --volumes
@docker system prune -a -f --volumes