当我执行 git commit 时,在提交消息中我将指定 test class name 并且在 junkins post-build 步骤中我正在运行一个需要 class name 的 shell 命令(spoon)参数,在 git commit 消息中。
我有 6 个测试类,具体取决于应运行的提交消息特定命令。
示例提交消息:- git commit 'update [coreTest.java]'
运行命令
java -jar spoon-runner-1.1.9-jar-with-dependencies.jar \
--apk example-app.apk \
--test-apk example-tests.apk
--class-name coreTest.java
coreTest.java 是应根据提交消息放置的类名。
最佳答案
一个想法是在 git 服务器端有 post-receive Hook ,这将:
- 分析推送的 git 提交的提交消息(如 this answer 或 this one )
- call a jenkins job (取决于提交消息的 6 个作业之一)
关于android - jenkins 如何根据 git commit 消息中的关键字执行特定命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29845933/