针对Android项目CI的Openshift Jenkins设置

时间:2015-08-23 21:16:15

标签: android jenkins gradle openshift

我有3个齿轮的免费Openshift帐户,我已经建立了一个装备作为Jenkins服务器,并按照此处说明的步骤将DIY盒式磁带配置为从属节点:

https://developer.jboss.org/people/lkrzyzanek/blog/2012/12/12/jenkins-on-openshift-with-own-slaves?_sscc=t

主节点和从节点之间的ssh连接正常。我已按照此处发布的说明修复了slave.jar上的jenkins缓存问题:

Change user.home system property

我已经在slave上传了android-sdk,只下载了构建工具。这个简化版本的sdk,在我的本地机器上成功构建android-studio项目,它会生成相应的APK。

当我创建指向git存储库的新jenkins作业时,代码将被下载并且./gradlew assembleRelease将启动。所有步骤都可以正常工作,直到gradle到达任务应用程序:preDexRelease,jenkins变得不可用。

我还尝试手动运行gradlew对从机执行ssh,虽然ssh超时(未设置的TMOUT)被禁用,但是当达到构建步骤preDexRelease时,ssh会话突然断开连接。 Gradle日志(--debug)不会给出任何正在发生的事情的暗示。

有没有人经历过类似的行为?

Gradle debug:

...
processing android/support/annotation/Keep.class...
processing android/support/annotation/FractionRes.class...
processing android/support/annotation/DimenRes.class...
processing android/support/annotation/BoolRes.class...
processing android/support/annotation/BinderThread.class...
processing android/support/annotation/CallSuper.class...
processing android/support/annotation/MenuRes.class...
processing android/support/annotation/RequiresPermission$Read.class...
processing android/support/annotation/AnimRes.class...
processing android/support/annotation/Nullable.class...
processing android/support/annotation/ColorRes.class...
processing android/support/annotation/RequiresPermission$Write.class...
processing android/support/annotation/CheckResult.class...
processing android/support/annotation/InterpolatorRes.class...
processing android/support/annotation/LayoutRes.class...
processing android/support/annotation/TransitionRes.class...
processing android/support/annotation/IntRange.class...
processing android/support/annotation/RequiresPermission.class...
processing android/support/annotation/Size.class...
processing android/support/annotation/StringDef.class...
processing android/support/annotation/NonNull.class...
processing android/support/annotation/MainThread.class...
processing android/support/annotation/ArrayRes.class...
processing android/support/annotation/ColorInt.class...
processing android/support/annotation/IntegerRes.class...
processing android/support/annotation/StyleRes.class...
processing android/support/annotation/VisibleForTesting.class...
writing classes.dex; size 6576...

> Building 85% > :app:preDexReleaseConnection to xxxxxxxx.rhcloud.com closed by remote host.
Connection to xxxxxxxx.rhcloud.com closed.

作为测试,我使用简单的一个活动Android Studio项目。

感谢您的帮助和建议。

2 个答案:

答案 0 :(得分:1)

请注意,我已打开包含Android SDK的Openshift Jenkins Cartridge的功能请求,请在此处投票:https://openshift.uservoice.com/forums/258655-ideas/suggestions/10128225-include-use-of-android-sdk-in-jenkins-catridge

答案 1 :(得分:0)

由于您使用的是小型齿轮(512MB内存,其中256MB分配给jvm),因此可能内存不足。你应该检查内存限制违规(https://help.openshift.com/hc/en-us/articles/202399600-How-to-check-for-memory-limit-violations),你也可以使用这些指令(https://developers.openshift.com/en/jbossas-jvm-memory.html)为JVM提供更多内存,这些指令适用于JBoss服务器,但它也适用于你的案件。确保在正在进行实际构建的从节点上执行此操作。