Release script fails with "/bin/sh: 1: ./release-tasks.sh: Permission denied"

Viewed 746

I followed article

to configure to run a script during release step.

unfortunately the release results in the following error (Release Log):

/bin/sh: 1: ./release-tasks.sh: Permission denied

how can I fix this?


my Procfile:

release: ./release-tasks.sh
web: gunicorn ph.wsgi --preload --log-file -

release-tasks.sh (simplified):

#!/bin/bash
python manage.py migrate --noinput
1 Answers

Git ignores most file permissions, but it does track the executable bit. Make your script executable and check it in, e.g.

chmod +x release-tasks.sh
git add release-tasks.sh
git commit -m "Make release-tasks.sh executable"

Then deploy as normal.


On Windows, you won't have chmod. Use the --chmod option to git add instead:

git add --chmod=+x release-tasks.sh
git commit -m "Make release-tasks.sh executable"
Related