0

I am trying to hook in jenkins into my currently configured site.

My current site is located at /var/www/aaronlote.com/checkout/ - jenkins is building into /var/lib/jenkins/workspace/aaronlote.com/

If I update my vhost to point to /var/lib/jenkins/workspace/aaronlote.com/ I get a 403 error, the directory is unreadable.

So I tried adding this as a build script in side the job:

rm -rf /var/www/aaronlote.com/checkout/
cp /var/lib/jenkins/workspace/aaronlote.com/ /var/www/aaronlote.com/checkout/

This runs but I have permission errors, e.g.

rm: cannot remove `/var/www/aaronlote.com/checkout/public/js/router.js': Permission denied
rm: cannot remove `/var/www/aaronlote.com/checkout/public/js/main.js': Permission denied
rm: cannot remove `/var/www/aaronlote.com/checkout/public/js/text.js': Permission denied

I then looked as using sudo su inside the jobs build but got errors and didn't think it was a great idea having jenkins running super user commands.

Am I doing something obviously wrong or is there a way to get around this current set up issue I have?

  • Try changing the permissions of /var/lib/jenkins/workspace/aaronlote.com/ so that jenkins is the user (I'm assuming Jenkins is running under the jenkins user name) and www-data as the group (or whatever Apache is running under). – saiarcot895 Aug 4 '14 at 17:57
  • I've fixed this by removing the bash completely and making /var/www/aaronlote.com/checkout a symbolic link to /var/lib/jenkins/workspace/aaronlote.com/ – azz0r Aug 4 '14 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.