-bash: ./deploy.sh: Permission denied , ERROR: script returned exit code 126 -bash: ./deploy.sh: Permission denied , ERROR: script returned exit code 126 jenkins jenkins

-bash: ./deploy.sh: Permission denied , ERROR: script returned exit code 126


It looks like your deploy.sh isn't executable, as you can see with the error code 126 “command not executable".

ls -l path/to/

the output should be similar to:

-rw-r--r--    1 user  staff      402 Aug  1 10:55 deploy.sh

If your file hasn't the executable flag, you should change the access right with chmod, something like:

chmod +x path/to/deploy.sh

the result should be then something like (notice the 4th char x):

-rwxr--r--    1 user  staff      402 Aug  1 10:55 deploy.sh

If your script is committed to git, you can also do:

git update-index --chmod=+x path/to/deploy.sh