I am trying to build iOS app using Jenkins and Fastlane. Jenkins master is a Linux machine and slave is a macOS machine, both running on AWS.
Project repository is hosted on Gitlab.
When the pipeline is run through Jenkins, it gives the following error:
The following build commands failed: 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
The contents of my fasyfile are:
node('macos') {
{
stage('Checkout') {
checkout scm
}
stage('Resolve packages') {
sh 'bash resolvePackages'
}
stage('Build Store') {
sh 'fastlane store'
}
}
}
Fastfile is as follows:-
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 is run through Jenkins. When fastlane commands are run locally on macOS slave node, build succeeds.
Versions:-
- macOS: 11.5.1
- xocde version: 12.5.1
- fastlane: 2.192.0
I have already tried some of the solutions such as unlocking the keychain before gym, running set-key-partition-list command, none of them solved the issue.