Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

heroku

I followed article

  • https://devcenter.heroku.com/articles/release-phase#specifying-release-phase-tasks

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
like image 776
udo Avatar asked Sep 14 '25 16:09

udo


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"
like image 180
Chris Avatar answered Sep 17 '25 20:09

Chris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!