1

I am using TeamCity as my CI server.I am currently generating apk's for two different branches. Now I need to upload these apk's to hockey-app for two different teams.But I cannot understand whether build is coming from the default branch or release branch.I tried

#!/bin/sh    
branch=%teamcity.build.branch%   
echo $branch    
if [ $branch = "default" ]    
then   
echo "got the answer"   
else    
echo "None of the condition met"   
fi

Now I am building default branch.But line 3 is printing %teamcity.build.branch% instead of default.Please give me a solution.

Nevin Raj Victor
  • 2,924
  • 3
  • 23
  • 37

1 Answers1

0
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

If build is from any branch which contains the string release or default in it's name ,it will get uploaded to hockeyapp respectively .

Nevin Raj Victor
  • 2,924
  • 3
  • 23
  • 37