我们公司使用Bamboo为我们的所有项目进行自动构建,这是我们第一次尝试进行iOS构建。
在iOS项目中(应用程序是使用Ionic + Cordova构建的),我们使用Gulp编写了一个iOS构建脚本,它通过创建一个钥匙串并将.p12文件导入到钥匙串中来开始构建过程。不幸的是,此步骤失败并且稍后导致xcodebuild命令抛出有关供应配置文件未找到的公钥/私钥对的错误:
build 16-Oct-2015 21:22:07 [18:22:07] Finished 'ionic-build-ios' after 7.98 s
build 16-Oct-2015 21:22:07 [18:22:07] Starting 'clean-ipa'...
build 16-Oct-2015 21:22:07 [18:22:07] Finished 'clean-ipa' after 1.66 ms
build 16-Oct-2015 21:22:07 [18:22:07] Starting 'build-ipa'...
error 16-Oct-2015 21:22:07 create-keychain "-p" "bhabani" "TriNetMobileNextGen.keychain"
error 16-Oct-2015 21:22:07 unlock-keychain "-p" "bhabani" "TriNetMobileNextGen.keychain"
error 16-Oct-2015 21:22:07 list-keychains "-s" "/Users/bamboo/Library/Keychains/TriNetMobileNextGen.keychain"
error 16-Oct-2015 21:22:07 import "signing/debug/ios/TriNetMobileNextGen.p12" "-k" "/Users/bamboo/Library/Keychains/TriNetMobileNextGen.keychain" "-P" "bhabani" "-A" "/usr/bin/codesign"
build 16-Oct-2015 21:22:07 2 identities imported.
build 16-Oct-2015 21:22:07 User defaults from command line:
build 16-Oct-2015 21:22:07 IDEArchivePathOverride = /Users/bamboo/bamboo-agent-home/xml-data/build-dir/APD-MOB2-JOB1/platforms/ios/build/TriNet.xcarchive
build 16-Oct-2015 21:22:07
build 16-Oct-2015 21:22:07 Build settings from command line:
build 16-Oct-2015 21:22:07 CODE_SIGN_IDENTITY = iPhone Distribution: TriNet Group, Inc.
build 16-Oct-2015 21:22:07 ENABLE_BITCODE = NO
build 16-Oct-2015 21:22:07 PROVISIONING_PROFILE = 17664eed-3044-49fc-9ad1-141b520f4da9
build 16-Oct-2015 21:22:07
build 16-Oct-2015 21:22:08 === CLEAN TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===
创建,解锁,列出和导入钥匙串都会引发错误。
有趣的是,当我通过SSH连接到Bamboo服务器并手动运行构建脚本命令(gulp build-ios)时,一切都运行良好,并生成.ipa文件。
这是我尝试过的:
我没有想法。