How to run jenkins as a different user

前端 未结 5 1420
眼角桃花
眼角桃花 2020-11-28 22:26

I have been trying to follow tutorials and this one: Deploy as Jenkins User or Allow Jenkins To Run As Different User?

but I still can\'t for the love of the computi

5条回答
  •  庸人自扰
    2020-11-28 22:44

    On Mac OS X, the way I enabled Jenkins to pull from my (private) Github repo is:

    First, ensure that your user owns the Jenkins directory

    sudo chown -R me:me /Users/Shared/Jenkins
    

    Then edit the LaunchDaemon plist for Jenkins (at /Library/LaunchDaemons/org.jenkins-ci.plist) so that your user is the GroupName and the UserName:

        GroupName
        me
    ...
        UserName
        me
    

    Then reload Jenkins:

    sudo launchctl unload -w /Library/LaunchDaemons/org.jenkins-ci.plist
    sudo launchctl load -w /Library/LaunchDaemons/org.jenkins-ci.plist
    

    Then Jenkins, since it's running as you, has access to your ~/.ssh directory which has your keys.

提交回复
热议问题