Git push to heroku fails but exit code is 0

Viewed 127

faced with the following issue: whenever I do the deploy on heroku through circleCI and something goes wrong on release step, the build does not fail.

Details: to push django app on heroku I use the Procfile,

web: daphne mysite.asgi:channel_layer --port $PORT --bind 0.0.0.0 -v2
release: python manage.py makemigrations currencies
release: python manage.py migrate --no-input
...

when I(or CI) run the git push git@heroku.com:bnbstaff-testing.git HEAD:master the Procfile is processed. And when smth fails, the exit code is 0.

(bnbstaff) ir@mc ~/Projects/bnb (testing) $ git push  git@heroku.com:bnbstaff-testing.git HEAD:master
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 4 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 479 bytes | 239.00 KiB/s, done.
Total 5 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
.....
remote:     django.setup()
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
remote:     apps.populate(settings.INSTALLED_APPS)
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 116, in populate
remote:     app_config.ready()
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/admin/apps.py", line 23, in ready
remote:     self.module.autodiscover()
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover
remote:     autodiscover_modules('admin', register_to=site)
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django/utils/module_loading.py", line 50, in autodiscover_modules
remote:     import_module('%s.%s' % (app_config.name, module_to_search))
remote:   File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
remote:     return _bootstrap._gcd_import(name[level:], package, level)
remote:   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
remote:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
remote:   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
remote:   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
remote:   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
remote:   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
remote:   File "/app/authentification/admin.py", line 19, in <module>
remote:     from .forms import (ProprietaireFormAdmin, UserChangeFormAdmin,
remote:   File "/app/authentification/forms.py", line 19, in <module>
remote:     from django_select2.forms import ModelSelect2Widget
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/django_select2/forms.py", line 54, in <module>
remote:     from django.contrib.admin.widgets import SELECT2_TRANSLATIONS
remote: ImportError: cannot import name 'SELECT2_TRANSLATIONS'
remote: Waiting for release... failed.
To heroku.com:bnbstaff-testing.git
   486addbec..289126a37  HEAD -> master
(bnbstaff) ir@mc ~/Projects/bnb (testing) $ echo $?
0

Any thoughts how to return not-zero exit code on fail?

0 Answers
Related