Openshift Jenkins安装Android项目CI



我有一个免费的Openshift帐户,有3个齿轮,我已经建立了一个齿轮作为詹金斯服务器,并按照下面解释的步骤配置了一个DIY卡带作为从属节点:

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

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

改变用户。主系统属性

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

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

我还尝试手动运行gradlew对从机执行ssh,尽管ssh超时(unset TMOUT)被禁用,但当到达构建步骤preDexRelease时,ssh会话突然断开。Gradle日志(——debug)不会提示发生了什么。

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

Gradle调试:

...
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项目。

感谢您的帮助和建议

请注意,我已经打开了Openshift Jenkins墨盒的功能请求,包括Android SDK,请在这里投票:https://openshift.uservoice.com/forums/258655-ideas/suggestions/10128225-include-use-of-android-sdk-in-jenkins-catridge

由于您使用的是小内存(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服务器的,但它也适用于您的情况。请确保在实际构建发生的从节点上执行此操作。

最新更新