How can I point Jenkins to another .jenkins home directory?

后端 未结 7 1619
攒了一身酷
攒了一身酷 2020-12-29 07:17

I have the working /.jenkins folder under a specific user in home on Linux. I want to start Jenkins with another user, but re-use the .jenkins folder of the other user. How

7条回答
  •  忘掉有多难
    2020-12-29 07:50

    I think this can help you out.

    Set an Environment Variable JENKINS_HOME pointing to the .jenkins folder and run the Jenkins command.


    The shell should be like

    export JENKINS_HOME=/usr/jhon/.jenkins
    
    java -jar jenkins.war
    


    The batch should be like

      SET JENKINS_HOME=C:\users\jhon\.jenkins
    
     java -jar jenkins.war
    


    The Powershell should be like

    [Environment]::SetEnvironmentVariable("JENKINS_HOME", "${PWD}\.jenkins")
    java -jar jenkins.war
    

    This will set your home directory to the current-working-directory + './jenkins'

提交回复
热议问题