繁体   English   中英

通过 Jenkins 和 Fastlane 构建 iOS 管道时出现 CodeSign 错误

[英]CodeSign Error while building iOS pipeline through Jenkins and Fastlane

我正在尝试使用 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

我的 fasyfile 的内容是:

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

Build only fails on CodeSign when it runs through Jenkins.当fastlane命令在macOS从节点本地运行时,build成功。

版本:-

  • macOS:11.5.1
  • xocde 版本:12.5.1
  • 快车道:2.192.0

我已经尝试了一些解决方案,例如在健身房之前解锁钥匙串,运行 set-key-partition-list 命令,都没有解决问题。

任何人遇到同样的错误,我们发现 iOS 不允许您通过 SSH 访问钥匙串。由于 Jenkins 主节点使用 SSH 访问 Jenkins 从节点,因此拒绝访问钥匙串导致代码签名错误。

在花了将近一周的时间试图解决这个问题后,我们转移到 Gitlab CI/CD 而不是 Jenkins 并实现了我们的目标。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM