I’ve had Jenkins up and running for a while now on several websites, but there’s one site where I still have to log in every other day to change file ownership. This site has a WordPress blog running under www.somesite.com/blog
, while the rest of the site is non-WP.
WordPress needs the directory to be owned by Apache to self-update, install plugins, clear cache, etc. But the site has a custom theme that’s included in the general repo, so Jenkins also needs directory ownership or the build will fail.
Right now, I’m thinking of having Jenkins change file ownership every deployment, but I don’t know how to go about doing that. Another idea that occurs to me is that we could spin the WordPress theme into its own repo and install it like any other WordPress theme (is that possible? I’ve never used WP before).
Any insight is appreciated!
You can run shell scripts from Jenkins. So you can use chown to change owner of the file or assign it to different group.
Take a look at Jenkins docs.
EDIT:
You are right chown may need to be run under root.
I believe you have few options: