{"action":"created","issue":{"url":"https://api.github.com/repos/widdix/aws-cf-templates/issues/24","repository_url":"https://api.github.com/repos/widdix/aws-cf-templates","labels_url":"https://api.github.com/repos/widdix/aws-cf-templates/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/widdix/aws-cf-templates/issues/24/comments","events_url":"https://api.github.com/repos/widdix/aws-cf-templates/issues/24/events","html_url":"https://github.com/widdix/aws-cf-templates/issues/24","id":177389107,"number":24,"title":"Configuring $PATH for Jenkins?","user":{"login":"matsev","id":234505,"avatar_url":"https://avatars.githubusercontent.com/u/234505?v=3","gravatar_id":"","url":"https://api.github.com/users/matsev","html_url":"https://github.com/matsev","followers_url":"https://api.github.com/users/matsev/followers","following_url":"https://api.github.com/users/matsev/following{/other_user}","gists_url":"https://api.github.com/users/matsev/gists{/gist_id}","starred_url":"https://api.github.com/users/matsev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matsev/subscriptions","organizations_url":"https://api.github.com/users/matsev/orgs","repos_url":"https://api.github.com/users/matsev/repos","events_url":"https://api.github.com/users/matsev/events{/privacy}","received_events_url":"https://api.github.com/users/matsev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-16T10:10:55Z","updated_at":"2016-09-16T10:39:24Z","closed_at":null,"body":"What is the preferred way of modifying the `$PATH` variable for the Jenkins user in the CloudFormation template?\r\n\r\nI have setup a Jenkins environment based on the `jenkins2-ha.json` template. Now, I have added [asciidoctor](http://asciidoctor.org/)\r\n by configuring the `install` part of the template:\r\n\r\n```\r\n\"rubygems\" : {\r\n  \"asciidoctor\" : []\r\n},\r\n```\r\n\r\nWhen I login to the instance I can verify that it has been installed:\r\n```\r\n$ asciidoctor --version\r\nAsciidoctor 1.5.4 [http://asciidoctor.org]\r\nRuntime Environment (ruby 2.0.0p648 (2015-12-16) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)\r\n```\r\n\r\nHowever when I try to execute a bash command from Jenkins I find that\r\n```\r\nRunning shell script\r\n+ asciidoctor --version\r\n[...]: asciidoctor: command not found\r\n```\r\n\r\nSome more investigation revealed that the `asciidoctor` has been installed to `/usr/local/bin/asciidoctor`, but the `$PATH` used by Jenkins is `/sbin:/usr/sbin:/bin:/usr/bin`. Consequently, what is the preferred way of adding `/usr/local/bin/` to Jenkins' `$PATH` in the CloudFormation template?"},"comment":{"url":"https://api.github.com/repos/widdix/aws-cf-templates/issues/comments/247570322","html_url":"https://github.com/widdix/aws-cf-templates/issues/24#issuecomment-247570322","issue_url":"https://api.github.com/repos/widdix/aws-cf-templates/issues/24","id":247570322,"user":{"login":"michaelwittig","id":950078,"avatar_url":"https://avatars.githubusercontent.com/u/950078?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelwittig","html_url":"https://github.com/michaelwittig","followers_url":"https://api.github.com/users/michaelwittig/followers","following_url":"https://api.github.com/users/michaelwittig/following{/other_user}","gists_url":"https://api.github.com/users/michaelwittig/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelwittig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelwittig/subscriptions","organizations_url":"https://api.github.com/users/michaelwittig/orgs","repos_url":"https://api.github.com/users/michaelwittig/repos","events_url":"https://api.github.com/users/michaelwittig/events{/privacy}","received_events_url":"https://api.github.com/users/michaelwittig/received_events","type":"User","site_admin":false},"created_at":"2016-09-16T10:39:24Z","updated_at":"2016-09-16T10:39:24Z","body":"@matsev I see. I don't know exactly where jenkins stores that information but you can have a look at /var/lib/jenkins/config.xml . If you find it there you can modify the file on startup. another way could be the provide the PATH in your job directly. \r\n\r\nSo your bash job could look like this\r\n```\r\nexport PATH=/usr/local/bin:$PATH\r\nasciidoctor --version\r\n```\r\n\r\nI guess you could also add /usr/local/bin to the PATH when jenkins starts up. Should be somewhere in the init script."}}
{"actor":{"display_login":"michaelwittig"}}