runAs plugin

I assume this plugin is still supported,since it's listed as so by the TeamCity docs. I'm trying to get a buildAgent to run as something other than root. My gulp build run from gradle is complaining about bower install being run as sudo during the running of ngdocs (Linux system obviously). We specify --allow-root on our bower install, but either it's not getting picked up or some other part of the gulp build is running it for us (and without the --allow-root option). So, I figured that running the buildAgent as something other than root was the shortest path to victory here.

Perhaps not though. I've been futzing around with this for the better part of a day. The documentation on the plugin is pretty sparse. I think we have it all configured correctly, but the biggest unknown to me is what to specify for the {start_build_script} option. The doc (in the Windows section) says "{start_build_script} - path to a script (.cmd on Windows or .sh on Unix) generated by this plugin which contains command line to start build process". I've no idea what to put here. My build does generate a .sh file in agentTmp directory, but a different one each time. Certainly it can't be that one. If I put the contents of that file in my own .sh file and specify that for the {start_build_script}, I get other errors, primary a null exception in init.gradle trying to "split" the environment variable value for TEAMCITY_BUILD_INIT_PATH.

What am I missing? We're running the latest version of TeamCity on Ubuntu Linux.

Please sign in to leave a comment.