且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

linux中同一个tomcat服务器上的多个Jenkins

更新时间:2023-11-22 19:20:04

设置 JENKINS_HOME 参数有三种方式(参见 Jenkins Wiki):

There are three ways to set the JENKINS_HOME parameter (cf. Jenkins Wiki):

  • 作为系统环境变量,
  • 作为系统属性,
  • 作为 JNDI 环境条目.
  • as a system environment variable,
  • as a system property,
  • as a JNDI environment entry.

前两个选项将适用于整个Tomcat服务器,因此需要使用JNDI.创建一个描述符文件 $CATALINA_BASE/conf/Catalina/localhost/jen-dev.xml 内容:

The first two options will apply to the entire Tomcat server, so you need to use JNDI. Create a descriptor file $CATALINA_BASE/conf/Catalina/localhost/jen-dev.xml with content:

<Context>
    <Environment type="java.lang.String" override="false"
                 name="JENKINS_HOME" value="/opt/jen-dev" />
</Context>

并为另一个 Jenkins 实例定义一个类似的描述符.

and define a similar descriptor for the other Jenkins instance.