Skip to content

Commit 19afb47

Browse files
committed
add some missing targets for deployment
1 parent 8d313fe commit 19afb47

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
# Welcome! :)
2+
3+
# Test/Dev
14
DEV_CMD=cd intbot && DJANGO_ENV="dev" uv run --env-file .env -- ./manage.py
25
TEST_CMD=cd intbot && DJANGO_SETTINGS_MODULE="intbot.settings" DJANGO_ENV="test" uv run pytest --nomigrations
36

7+
# Docker
48
DOCKER_RUN_WITH_PORT=docker run -p 4672:4672 --add-host=host.internal:host-gateway -e DJANGO_ENV="local_container" -it intbot:$(V)
9+
MANAGE=cd intbot && ./manage.py
510

11+
# Deployment
12+
DEPLOY_CMD=cd deploy && uvx --from "ansible-core" ansible-playbook -i hosts.yml
613

714
# mostly useful for docker and deployment
815
current_git_hash=$(shell git rev-parse HEAD)
@@ -48,9 +55,25 @@ in-container/gunicorn:
4855
in-container/bot:
4956
$(MANAGE) run_bot
5057

58+
in-container/migrate:
59+
$(MANAGE) migrate
60+
61+
62+
# Docker management targets
5163

5264
docker/build:
5365
docker build . -t intbot:$(current_git_hash)
5466

5567
docker/run/gunicorn:
5668
$(DOCKER_RUN_WITH_PORT) make in-container/gunicorn
69+
70+
71+
# Deploymenet targets
72+
#
73+
deploy/provision:
74+
$(DEPLOY_CMD) playbooks/01_setup.yml
75+
$(DEPLOY_CMD) playbooks/02_nginx.yml
76+
77+
deploy/app:
78+
@echo "Deploying version $(V) to a remote server"
79+
$(DEPLOY_CMD) playbooks/03_app.yml --extra-vars "app_version=$(V)"

0 commit comments

Comments
 (0)