无法获取在 Team City 中完成构建的分支
Can't get the branch from which build is done in Team City
我正在使用 TeamCity,因为我的 CI server.I 目前正在为两个不同的分支生成 apk。现在我需要将这些 apk 上传到两个不同的曲棍球应用程序 teams.But 我无法理解构建是来自默认分支还是发布 branch.I 已尝试
#!/bin/sh
branch=%teamcity.build.branch%
echo $branch
if [ $branch = "default" ]
then
echo "got the answer"
else
echo "None of the condition met"
fi
现在我正在构建默认 branch.But 第 3 行 正在打印 %teamcity.build.branch% 而不是 默认。请给我一个解决方案。
branch=%teamcity.build.branch%
echo $branch
branch1=release
branch2=default
if [[ "$branch" =~ "$branch1" ]];
then
API_FOR_HOCKEY_APP
elif [[ "$branch" =~ "$branch2" ]];
then
API_FOR_HOCKEY_APP
else
echo "Build is not from any of the branches"
fi
如果构建来自名称中包含字符串 release 或 default 的任何分支,它将分别上传到 hockeyapp。
我正在使用 TeamCity,因为我的 CI server.I 目前正在为两个不同的分支生成 apk。现在我需要将这些 apk 上传到两个不同的曲棍球应用程序 teams.But 我无法理解构建是来自默认分支还是发布 branch.I 已尝试
#!/bin/sh
branch=%teamcity.build.branch%
echo $branch
if [ $branch = "default" ]
then
echo "got the answer"
else
echo "None of the condition met"
fi
现在我正在构建默认 branch.But 第 3 行 正在打印 %teamcity.build.branch% 而不是 默认。请给我一个解决方案。
branch=%teamcity.build.branch%
echo $branch
branch1=release
branch2=default
if [[ "$branch" =~ "$branch1" ]];
then
API_FOR_HOCKEY_APP
elif [[ "$branch" =~ "$branch2" ]];
then
API_FOR_HOCKEY_APP
else
echo "Build is not from any of the branches"
fi
如果构建来自名称中包含字符串 release 或 default 的任何分支,它将分别上传到 hockeyapp。