【发布时间】:2015-08-13 21:49:32
【问题描述】:
我的一个 jenkins 版本有问题。
我已经在我的全局凭据中配置了一个 keystore 用于我的一个 android 版本。例如,当我必须签署我的 apk 以便在 Google Play 上分发我的应用程序时,需要此密钥库。
所以在工作中,我配置了一个 秘密文件绑定 以允许 jenkins 将密钥库文件复制到一个临时位置并设置一个变量,我们称之为 SECRET_PATH,到该位置。然后,当调用 gradle 脚本(在开关部分)时,我可以在命令行上为 gradle 提供此变量的值。
但是每次构建都会失败:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':myapp:packageRelease'.
> Failed to read key ******** from store "/home/jenkins/slave/secretFiles/3607aab3-6e27-497a-b198-7d9a3aeb2913/keystore": Keystore was tampered with, or password was incorrect
就好像位置 /home/jenkins/slave/secretFiles/3607aab3-6e27-497a-b198-7d9a3aeb2913/keystore 根本不存在。
在作业配置中,绑定部分的帮助提示也提到了这一点:
Warning: if the master or slave node has multiple executors, any other build running concurrently on the same node will be able to read the contents of this file.
就好像另一个并发构建正在运行并删除了密钥库所在的位置。这真的很奇怪。
还有一件事,我使用的是主/从拓扑,其中所有内容都被 dockerized。不确定码头工人本身是否参与其中。我认为这纯粹是 Jenkins 的问题,但我提供这些信息是为了让你们了解一些背景信息。
你们有没有遇到过这种奇怪的行为,jenkins 似乎无法“解决”秘密文件绑定? 任何帮助将不胜感激。
提前致谢,
【问题讨论】:
标签: android jenkins binding gradle continuous-integration