For some reason jenkins cannot execute sudo related command when the build is invoked from the "Build now" button on the browser or when triggered by a git push. I get errors like
"jenkins is not in the sudoers file. This incident will be reported."
However I ssh into the instance and do
sudo usermod -a -G sudo jenkins
I verified it by
groups jenkins
where the output is
jenkins : jenkins sudo
I also attempted to execute the command myself in the console and it works without a problem
su jenkins
cd /var/lib/jenkins/workspace/myrepo/build/
sudo make install
I also doubled checked
sudo visudo
and there is
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
What am I doing wrong?