覆盖Openshift Maven脚本(Jenkins Gear) [英] Overriding openshift maven script (jenkins gear)

查看:352
本文介绍了覆盖Openshift Maven脚本(Jenkins Gear)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Openshift上有Jenkins实例

I have Jenkins instance on Openshift

我已启用Openshift应用程序的Jenkins构建 这里是Jenkins Shell脚本的一部分,并记录它们产生的内容:

I've enabled Jenkins build of my Openshift application Here part of Jenkins shell script parts and logs what they produce :

# Sync any libraries
rsync $upstream_ssh:~/.m2/ ~/.m2/

# Build/update libs and run user pre_build and build
gear build

上面的

命令触发了此类操作

command above triggers such action

+ gear build
Found pom.xml... attempting to build with 'mvn -e clean package -Popenshift -DskipTests'
Apache Maven 3.0.3 (r1075437; 2011-06-20 13:22:37-0400)
Maven home: /etc/alternatives/maven-3.0

我想自定义Maven选项(在这种情况下,可以通过删除-DskipTests part来运行测试) 此外,在脚本中,我尝试添加一些步骤并结合禁用此gear build命令

I want to customize maven options (in this case allow to run test by deleting -DskipTests part ) Further in script I tried to add some steps combining with disabling this gear build command

# Run tests here
mvn -e clean package -Popenshfit

以上运行mvn clean package,但不会更新上一次成功的工件,并且显示日志

Above run mvn clean package but doesn't update last successful artifact, and logs shows

[WARNING] The requested profile "openshfit" could not be activated because it does not exist.

我在pom.xml中拥有该个人资料,所以我不知道发生了什么

I have that profile in my pom.xml so I don't know what happening

 <profiles>
    <profile>
        <id>openshift</id>

这不起作用:

 mvn --global-settings $OPENSHIFT_MAVEN_MIRROR clean package -Popenshift

上面可能是一些老职员(摘自 https://www .openshift.com/blogs/jenkins-polyglot-persistence-part-2 )

Probably above is some old staff (taken from https://www.openshift.com/blogs/jenkins-polyglot-persistence-part-2)

欢迎任何关于自定义此gear build或在Openshift上覆盖Maven选项的想法:)我可以直接在机器(jenkins,jenkins-build)上进行更改(到目前为止,免费的openshift帐户允许我:))

Any idea about customizing this gear build or overriding maven options on Openshift are welcome :) I can make changes directly on machines (jenkins, jenkins-build) (as far free openshift account allow me :))

修改

一些解决方法要运行 gear build然后是mvn clean package,因此我两次运行构建,并且满足所有测试目标,并且将战争部署在上游实例上,此外,Cobertura报告可以很好地在我的Jbehave测试中正常工作,但这是不雅观的资源消耗解决方案.

Some workaround is to run gear build and then mvn clean package so I get build run twice and all test goals are meet and war is deployed on upstream instance and additionally Cobertura reports work fine with my Jbehave tests but this is inelegant, resources consuming solution.

推荐答案

我在做作业"时发现了有关OpenShift中有关Maven的另一个问题的问题-关于OpenShift在构建过程中如何使用Maven配置文件广泛地讲,是为了在使用"jbossas"盒的应用程序中安装提供Liferay门户的定制"第三方.war文件以及一些模块"自定义项.

I found this question while "Doing my homework" with regards to another question about Maven in OpenShift -- as to how OpenShift uses the Maven profile during the build process, broadly, as towards a goal of installing a "customized" third-party .war file providing the Liferay portal, along with some 'module' customizations, in an app using the 'jbossas' cartridge.

尽管我的portal-gproj应用程序在其构建中未使用Jenkins -因为我希望它最初不会为Jenkins提供一个备用齿轮,因此可以从三个免费齿轮"开始.不过,这是一个可扩展的应用程序.但是,我找到了一个参考项目,作为Bill DeCoste的博客条目,至少提及了Jenkins的两个配置功能,以及在Jenkins中定制OpenShift Maven构建的相关信息:

Although my portal-gproj app doesn't use Jenkins in its build -- as I expect that it won't have a spare gear available for Jenkins, initially, of the three "free gears" available to start with. It's a scalable app, though. However, I've found a reference item, as a blog entry by Bill DeCoste such that at least mentions two configuration features about Jenkins, as with regards to customization of OpenShift Maven builds in Jenkins: http://blog-judcon.rhcloud.com/?p=16 To summarize, the article mentions, with regards to Jenkins: One "Build/Execute shell section of the Job configuration."

尽管我本人还没有使用过詹金斯,但是我看到了它的使用,但是,我认为它已在 eXo平台.我假设詹金斯会为工作配置提供一种基于Web的界面? (我个人更倾向于将Shell/文件系统接口置于Maven之上)

Though I've not used Jenkins, myself, but I've seen it in use, however -- I think it's used in the eXo Platform for instance. I assume that Jenkins would have a sort of web-based interface for job configuration? (I tend to prefer the shell/filesystem interface onto Maven, personally)

或者,还有 OpenShift Origin Server源代码jenkins和jenkins-client OpenShift起源下的墨盒.当然,这些墨盒中的任何一个所使用的处理细节都将从其源代码中显而易见.

Alternately, there is the OpenShift Origin Server source code, and an OpenShift Origin System Architecture Guide corresponding, as in reference to the OpenShift Origin baseline, on which (I assume) OpenShift Online is running, in its layer on the Amazon EC2 cloud. "If all else fails, there's the source code," just like in so many things Red Hat, LOL. It seems that there are both jenkins and jenkins-client cartridges under OpenShift Origin. Certainly, the details of the process used by either of those cartridges would be apparent from its source code.

希望这会有所帮助!咖啡助威.

Hope this helps! Coffee cheers.

这篇关于覆盖Openshift Maven脚本(Jenkins Gear)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆