我目前正在使用Jenkins创建自动化。我已设置我的工作区,同时添加“源代码管理”;我的github信息和凭据。
Manifest.yml
applications:
- name: TestingApp
memory: 1G
random-route: false
path: target/TestingApp-0.0.1-SNAPSHOT.jar
timeout: 180
buildpack: java_buildpack_offline
services:
- Database
- ELK Logger
在“构建”下
我输入'clean package'作为mvn构建步骤。 (此代码正常运行)。
问题在于
构建后操作
推向Cloud Foundry
CF凭证
-ticked从清单文件中读取配置
Manifest file manifest.yml.
我的清单文件在我的github仓库中。但是我每次建立时都会收到错误。
Cloud Foundry Plugin:
11:02:07 WARNING: No manifest value for hostname. Using app name: Test-Test
11:02:07 java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
11:02:07 at com.hpe.cloudfoundryjenkins.DeploymentInfo.expandTokenMacros(DeploymentInfo.java:304)
11:02:07 at com.hpe.cloudfoundryjenkins.DeploymentInfo.<init>(DeploymentInfo.java:57)
11:02:07 at com.hpe.cloudfoundryjenkins.CloudFoundryPushPublisher.perform(CloudFoundryPushPublisher.java:175)
11:02:07 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
11:02:07 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
11:02:07 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
11:02:07 at hudson.model.Build$BuildExecution.post2(Build.java:186)
11:02:07 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
11:02:07 at hudson.model.Run.execute(Run.java:1753)
11:02:07 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
11:02:07 at hudson.model.ResourceController.execute(ResourceController.java:98)
11:02:07 at hudson.model.Executor.run(Executor.java:405)
11:02:07 Build step 'Push to Cloud Foundry' marked build as failure
11:02:07 Finished: FAILURE
发现类似问题here
替代
解决此问题的方法是在Jenkins UI中手动输入配置。但这不是我真正想做的事情。
另一个例子here
备选方案2
而不是使用云代工插件。当我在上面添加命令shell提示符时,它工作正常。我假设配置没有拿起我的manifest.yml文件