Xcode Bot:如何在触发触发器后的脚本上获取.ipa路径? [英] Xcode Bot: how to get .ipa path on a post trigger script?

查看:139
本文介绍了Xcode Bot:如何在触发触发器后的脚本上获取.ipa路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用漫游器来存档iOS应用,并且我需要获取.ipa产品路径才能将其发布到我们的分发系统中.

I'm using a bot to archive an iOS app, and I need to get the .ipa product path in order to publish it into our distribution system.

Bot设置:

并使用脚本来打印所有env变量,其中所有都不包含指向ipa文件的路径.另外,某些变量指向不存在的目录,即:XCS_OUTPUT_DIR

And using a script to print all env variables, non of them contains a path to the ipa file. In addition, some of the variables are pointed to directory that does not exist, i.e: XCS_OUTPUT_DIR

这里是env变量输出:

Here the env variable output:

XCS=1
XCS_ANALYZER_WARNING_CHANGE=-31
XCS_ANALYZER_WARNING_COUNT=0
XCS_ARCHIVE=/Library/Developer/XcodeServer/Integrations/Integration-771867708dfac45bba10a1998c118912/MyApp.xcarchive
XCS_BOT_ID=771867708dfac45bba10a1998c007d43
XCS_BOT_NAME='MyApp Distribution'
XCS_BOT_TINY_ID=DBB85BD
XCS_DERIVED_DATA_DIR=/Library/Developer/XcodeServer/Integrations/Caches/771867708dfac45bba10a1998c007d43/DerivedData
XCS_ERROR_CHANGE=-1
XCS_ERROR_COUNT=0
XCS_INTEGRATION_ID=771867708dfac45bba10a1998c118912
XCS_INTEGRATION_NUMBER=19
XCS_INTEGRATION_RESULT=warnings
XCS_INTEGRATION_TINY_ID=F7D4469
XCS_OUTPUT_DIR=/Library/Developer/XcodeServer/Integrations/Integration-771867708dfac45bba10a1998c118912
XCS_SOURCE_DIR=/Library/Developer/XcodeServer/Integrations/Caches/771867708dfac45bba10a1998c007d43/Source
XCS_TESTS_CHANGE=0
XCS_TESTS_COUNT=0
XCS_TEST_FAILURE_CHANGE=0
XCS_TEST_FAILURE_COUNT=0
XCS_WARNING_CHANGE=0
XCS_WARNING_COUNT=26
XCS_XCODEBUILD_LOG=/Library/Developer/XcodeServer/Integrations/Integration-771867708dfac45bba10a1998c118912/xcodebuild.log
XPC_FLAGS=0x0
XPC_SERVICE_NAME=com.apple.xcsbuildd

除此之外,我能够确认在另一个文件夹(<path to server>/IntegrationAssets/<integration id>/<integration number>/)中正在创建.ipa文件,但是无法从env变量访问该路径.

In addition to that, I was able to confirm that .ipa files are being created in another folder (<path to server>/IntegrationAssets/<integration id>/<integration number>/), but that path is not accessible from an env variable.

有什么想法吗?

推荐答案

好吧,经过大量的研究和测试以及所有发现,最新的Xcode(7.2)+ Server版本(5.0.15)的机器人显然出了点问题. )没有加载正确的环境变量.

Well, after a lot of research and testing and all, apparently there is something wrong with bots in the latest Xcode (7.2) + Server version (5.0.15) not loading the correct environment variables.

我当前的解决方案是根据现有的env变量手动创建路径:

My current solution was to create the path manually based on existing env variables:

ARCHIVE_PATH="${XCS_ARCHIVE}"
ARCHIVE_NAME="${ARCHIVE_PATH##*/}"
IPA_NAME="${ARCHIVE_NAME%.*}.ipa"
IPA_PATH="${XCS_OUTPUT_DIR}/ExportedProduct/Apps/${IPA_NAME}"

我这样做的依据是: 未设置触发器$ XCS_PRODUCT后的持续集成Xcode服务器

Which I did based on: Continuous integration Xcode Server after trigger $XCS_PRODUCT not set

这篇关于Xcode Bot:如何在触发触发器后的脚本上获取.ipa路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆