Reputation: 1087
Currently attempting to execute a shell script via Jenkins using a pipeline job but receiving the following error:
/var/lib/jenkins/workspace/Warehouse_Tests/src/test/java/runners/sql.sh: Permission denied
I have configured:
visudo -f /etc/sudoers
to contain:
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
jenkins ALL= NOPASSWD: ALL
Any ideas?
Upvotes: 0
Views: 3172
Reputation: 1638
change the permission of files to jenkins:jenkins & 755 .
in the build only you can mentioned it .
also try to run with sudo
sudo sh /var/lib/jenkins/workspace/Warehouse_Tests/src/test/java/runners/sql.sh
suggestion - use Jenkins environment variable rather giving an actual path of your script.
Upvotes: 0
Reputation: 1087
Resolved by executing: sh chmod +x
against the .sh script prior to triggering the scripts.
Upvotes: 1