【发布时间】:2020-02-20 23:16:40
【问题描述】:
我有一堆脚本在调用 appcenter-pre-build.sh 时被调用。例如,其中之一是简单检查当前分支标记是否已存在于存储库中。
#!/usr/bin/env bash
set -e # Exit immediately if a command exits with a non-zero status (failure)
# 1 Fetch tags
git fetch --tags
# See if the tag exists
if git tag --list | egrep -q "^$VERSION_TAG$"
then
echo "Error: Found tag. Exiting."
exit 1
else
git tag $VERSION_TAG
git push origin $VERSION_TAG
fi
如果找到标记,我想中止 AppCenter 中的构建并使其失败。当我通过 Xcode Server 运行所有内容时,这工作得非常好,但由于某种原因,我无法弄清楚如何在脚本失败时中止构建。我没有看到太多关于这个特定主题的文档,微软的 AppCenter 人员正在花时间回复我。
任何人都有这方面的经验和/或知道如何通过他们的脚本使 AppCenter 构建失败?提前感谢您的想法!
【问题讨论】:
-
据我所知,非零状态代码应该可以解决问题。将运行并通知您!
-
感谢您的检查。我也是这么想的。
标签: ios swift continuous-integration cd visual-studio-app-center