Skip to content

Commit

Permalink
#953 Create makefile recipes for celery stop/start (#958)
Browse files Browse the repository at this point in the history
* #952  Create makefile recipes for celery stop/start

* #952  Add max_lines=80 rule to the .editorconfig

* #952  Optimize the final deploy's recipe start/stop action

* #953  Review#1 fixes
  • Loading branch information
duker33 committed Sep 18, 2019
1 parent 2877085 commit c656ae3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.py]
# it's slightly differs from the same
# .coafile linter value because it's recommended value,
# while linter's value is the strict barrier
max_line_length = 80

[*.{js,es6}]
indent_size = 2

Expand Down
15 changes: 12 additions & 3 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ lint:
upd-dev:
$(dc) up -d app

stop-prod-celery:
$(dcp) stop celery-beat celery-command-worker celery-default-worker celery-mail-worker

upd-prod-celery:
$(dcp) up -d celery-beat celery-command-worker celery-default-worker celery-mail-worker

upd-prod: upd-prod-celery
$(dcp) up -d app nginx

deploy-dev:
$(MAKE) create-env
$(MAKE) create-config
Expand Down Expand Up @@ -129,14 +138,14 @@ prepare-deploy:
$(dcb) push python-dev python-prod

deploy:
$(dcp) pull
$(dcp) stop
# to flush nginx's inner static caches
$(dcp) rm -f app nginx && $(dcp) up -d app nginx
$(dcp) rm -f app nginx && $(MAKE) upd-prod
$(MAKE) stop-prod-celery
$(dcp) exec app python manage.py migrate
$(dcp) exec app python manage.py custom_pages
$(MAKE) -j generate-production-static-data
# Launch "collectstatic" not in static recipe because ManifestStaticStorage writes to db
$(dcp) exec app python manage.py collectstatic --noinput
# to make fresh collected static visible immediately
$(dcp) stop && $(dcp) up -d
$(dcp) stop app nginx && $(dcp) up -d app nginx

0 comments on commit c656ae3

Please sign in to comment.