安装 Jenkins 作为服务或 运行 它在 Apache 后面

Install Jenkins as a Service or Run it behind Apatche

我了解到安装Jenkins有两种方式:

1) 运行 Apache 背后的 Jenkins(使用 War 文件)

2) 将 Jenkins 安装为 Windows 服务(使用 windows 安装程序)

我正在为我的项目创建 CI、自动部署和计划自动化运行。那么在这种情况下应该采用哪种安装方式比较好。我只是不想选错一个,结果又重新创造了另一种工作。

我有几个问题:

1) 如果我选择安装为 Windows 服务(使用 windows 安装程序),我是否仍需要安装像 IIS 或 Apatche 这样的 Web 服务器来访问我的 Jenkins URL,或者 Jenkins 是否有内置的东西,我不必添加 Web 服务器来访问 Jenkins?

2) 如果 Jenkins 作为 Windows 服务(使用 windows 安装程序)需要 IIS,我在我的项目中有一些步骤需要手动重启 IIS 以生成 NCover 报告。在这种情况下,Jenkins 是否也会宕机?

3) Jenkins 网站声明如下:"In situations where you have existing web sites on your server, you may find it useful to run Jenkins (or the servlet container that Jenkins runs in) behind Apache, so that you can bind Jenkins to the part of a bigger website that you may have."。 我会使用 IIS 在本地托管我们的应用程序,在这种情况下,我是否应该选择使用 WAR 安装程序而不是 windows 安装程序。

我不 运行 Jenkin 在 Windows 但我相信它和其他平台一样...

  1. 否,如果使用安装程序安装 Jenkins,则不需要 IIS 或 Apache

  2. 参见1的答案,如果你不使用IIS来运行Jenkins重启它不会让Jenkins崩溃

  3. 听起来您想要 运行 IIS 下的现有站点,而让 Jenkins 运行ning 自行其是。我认为 Jenkins 的 windows 安装程序可以做到这一点。

我在 Windows 和 Unix 环境上有 运行 Jenkins。

只想对 Ben 的回答进行补充:

Windows 如果您安装为 windows 服务,您将不需要任何东西,对于此以下 wiki 应该绰绰有余: https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+as+a+Windows+service

补充第三点: 通常网站托管在 Apache httpd 服务器后面。如果您使用的是一个,那么您可以相应地配置 IIS Web 服务器和 Jenkins。

在我以前的公司,我们是运行Jenkins即服务(上面Vinay提出的解决方案)。

它运行良好,您不必安装像 Apache 这样的应用程序服务器。

您唯一需要注意的是启动 Windows 服务的用户。

如果您的 Jenkins 服务器需要访问网络上的一些资源,也许您必须使用 LDAP 用户来启动您的服务,而不是使用 "local system account"。