ios - 通过 Jenkins 和 Fastlane 构建 iOS 管道时出现 CodeSign 错误
问题描述
我正在尝试使用 Jenkins 和 Fastlane 构建 iOS 应用程序。Jenkins master 是一台 Linux 机器,slave 是一台 macOS 机器,两者都在 AWS 上运行。
项目存储库托管在 Gitlab 上。
当管道通过 Jenkins 运行时,会出现以下错误:
以下构建命令失败:CompileSwift normal arm64 CodeSign /Users/ec2-user/Library/Developer/Xcode/DerivedData/AssociatedPress-fccudiwnsqoxlobymusvrmoonnxe/Build/Intermediates.noindex/ArchiveIntermediates/AssociatedPress/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AssociatedPress\ Notification\ Extension .appex
我的 fsyfile 的内容是:
node('macos') {
{
stage('Checkout') {
checkout scm
}
stage('Resolve packages') {
sh 'bash resolvePackages'
}
stage('Build Store') {
sh 'fastlane store'
}
}
}
Fastfile如下:-
default_platform :ios
platform :ios do
desc "Build Store"
lane :store do
gym(workspace: "AssociatedPress.xcworkspace",
scheme: "AssociatedPress",
clean: true,
output_directory: "./fastlane/Store",
archive_path: "./fastlane/Store/AssociatedPressStore.xcarchive",
buildlog_path: "./fastlane/Store/build_log",
export_method: "app-store",
export_options: {
provisioningProfiles: {
"com.apnews.ipad.mobilenewsdevel" => "AP News Store",
"com.apnews.ipad.mobilenewsdevel.watchkitapp" => "AP News WatchApp Store",
"com.apnews.ipad.mobilenewsdevel.watchkitapp.watchkitextension" => "AP News WatchExtension Store",
"com.apnews.ipad.mobilenewsdevel.notificationextension" => "AP News Notification Store",
},
uploadBitcode: false,
compileBitcode: false
})
end
end
只有在通过 Jenkins 运行 CodeSign 时,构建才会失败。在 macOS 从节点上本地运行 fastlane 命令时,构建成功。
版本:-
- macOS:11.5.1
- xocde 版本:12.5.1
- 快车道:2.192.0
我已经尝试了一些解决方案,例如在健身房之前解锁钥匙串,运行 set-key-partition-list 命令,但都没有解决问题。
解决方案
推荐阅读
- php - 表格无法识别
- apache-spark - Apache Beam java.lang.IllegalArgumentException:无效的 lambda 反序列化
- sql - 仅选择新更新/受影响行的触发器
- sql-server - 如何找到 Azure 数据资源管理器数据库 (Playfab) 的 SQL Server 连接
- python - 使用 lambda 生成字典
- dns - 多少 DNS SRV 记录太多了?
- javascript - JS 组件不会显示在页面上?
- c# - Tablix:在每个页面上重复标题行不起作用
- c# - 在 int 方法中带有布尔变量的 while 循环
- node.js - 即使 npm i node-pre-gyp -g 也无法 npm 重建 @tensorflow/tfjs-node --build-from-source