当应用程序由 CI bot 构建而不是由 dev 构建时,可以执行脚本吗? [英] Possible to execute script when app built by CI bot but not by dev?

查看:19
本文介绍了当应用程序由 CI bot 构建而不是由 dev 构建时,可以执行脚本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序在 CI 机器机器人上构建时运行 perl 脚本,但如果在开发机器上构建应用程序时手动构建应用程序,我不希望运行该脚本.

I would like to run a perl script when my app is being built a a CI machine bot, but I do not want the script to be run if the app is being built manually when being built on a dev machine.

除了复制目标并使一个目标包含脚本构建阶段而另一个目标不包含脚本构建阶段之外,还有其他方法可以实现吗?

Is there any way of achieving this other than duplicating the targets and having one target containing a script build phase and another target not containing the script build phase?

推荐答案

刚刚将此回答发布到了类似问题:Xcode 持续集成:检测动作后脚本期间的 CI 环境

Just posted this answer to a similar question at: Xcode Continuous Integration: detecting the CI environment during a post-action script

这里是,如果有帮助:

if [[ "$USER" == "_teamsserver" ]]
then
    # do something
else
    # do something else
fi

[由于您的问题被标记为Xcode",因此此解决方案特定于 Xcode.它不适用于任何 C.I.]

[Since your question is tagged as 'Xcode', this solution is particular to Xcode. It won't work for just any C.I. system.]

这篇关于当应用程序由 CI bot 构建而不是由 dev 构建时,可以执行脚本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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