将 Jenkins CI 部署到 Heroku

Ale*_*ber 5 java heroku jenkins

有没有办法将Jenkins CI作为 Heroku 应用程序运行?

可以在 heroku上运行Java 应用程序,但我找不到有关如何让 Jenkins 在任何地方在 Heroku 上运行的描述。

非常感谢提示。

小智 0

很容易将 Jenkins 加载为 Heroku 应用程序

1)pom.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Just need a plain and mostly empty pom.xml for Orchard to detect that this is a Java application
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <version>1.0-SNAPSHOT</version>
    <artifactId>helloworld</artifactId>
</project>
Run Code Online (Sandbox Code Playgroud)
  1. Procfile 看起来像这样:

只监听http;禁用 ajp 和 https

网络:java -jar jenkins.war --httpPort=$PORT --ajp13Port=-1 --httpsPort=-1

  1. jenkins.war 文件。

真正的问题是 jenkins 使用本地文件系统进行存储,而本地存储在 Heroku 环境中并不持久,因此您必须定期管理您的配置或使用 github 存储插件。