Android 使用Fastlane上传apk的未定义方法
gitlab ci服务器使用Fastlane部署/上传apk到结构时出错。奇怪的是,如果我从本地运行任务,它就会工作。Fastlane在这两种情况下都是相同的版本2.123.0 失败任务的方法是:Android 使用Fastlane上传apk的未定义方法,android,gitlab-ci,google-fabric,fastlane,Android,Gitlab Ci,Google Fabric,Fastlane,gitlab ci服务器使用Fastlane部署/上传apk到结构时出错。奇怪的是,如果我从本地运行任务,它就会工作。Fastlane在这两种情况下都是相同的版本2.123.0 失败任务的方法是: 31 desc "Generate QA release notes" 32 private_lane :qa_release_notes do 33 commit = last_git_commit 34 short_hash = commit[:abbreviated_commit_hash]
31 desc "Generate QA release notes"
32 private_lane :qa_release_notes do
33 commit = last_git_commit
34 short_hash = commit[:abbreviated_commit_hash]
35 author = commit[:author]
36 message = commit[:message]
37 "Release notes of commit " + short_hash + " by " + author +":\n " + message
38 end
ci日志中打印的错误为:
[15:43:34]: Error in your Fastfile at line 34
[15:43:34]: 32: private_lane :qa_release_notes do
[15:43:34]: 33: commit = last_git_commit
[15:43:34]: => 34: short_hash = commit[:abbreviated_commit_hash]
[15:43:34]: 35: author = commit[:author]
[15:43:34]: 36: message = commit[:message]
(……)
问题似乎出在方法commit[:缩写的\u commit\u hash]
但是我不知道问题是什么……有什么想法吗?我认为错误消息告诉您,
commit=last\u git\u commit
实际上没有将commit
设置为任何内容,因此对其使用[…]
会为nil:NilClass(NoMethodError)引发[!]未定义的方法[]
您可以尝试通过在第33行和第34行之间简单地输出commit
进行调试:put(commit)
。使用--verbose
运行通道还可能提供一些额外的、希望有用的输出,以了解正在发生的事情
在后台执行的代码实际上是空的,但我看不出gitlab CI失败的明显原因。错误是上次提交的结果是空的(正如@janpio所说),因为出于某种原因,git
在Docker映像中丢失了。是的,似乎上次提交的last\u git\u commit
工作不正常。。。我会调查原因的。谢谢.IDK为什么Docker图像中缺少git
。
Fastfile:34:in block (2 levels) in parsing_binding': [!] undefined method []' for nil:NilClass (NoMethodError)
from /var/lib/gems/2.3.0/gems/fastlane-2.123.0/fastlane/lib/fastlane/lane.rb:33:in `call'