Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Runners for Windows pipeline - 'If statement' does not execute?


#- if [ $Env:CHANGEBUILDNUMBER == 'Yes' ]; then ./ChangeBuildVersion2.bat $Env:BITBUCKET_BRANCH $Env:BUILDVERSIONNUMBER $Env:BITBUCKET_CLONE_DIR\eLookCommon > $Env:BITBUCKET_CLONE_DIR\Buildlogs\ChangeBuildVersion2.log; fi
The above commented out "if [" line fails because it is looking for an '(' after the if.
So, went to PowerShell format....
- if($Env:CHANGEBUILDNUMBER -eq "Yes") {
echo "CHANGEBUILDNUMBER Variable was Yes, so the build number will be changed."
./ChangeBuildVersion2.bat $Env:BITBUCKET_BRANCH $Env:BUILDVERSIONNUMBER $Env:BITBUCKET_CLONE_DIR\eLookCommon > $Env:BITBUCKET_CLONE_DIR\Buildlogs\ChangeBuildVersion2.log
# {
# echo "CHANGEBUILDNUMBER was NOT Yes, so the build number will NOT be changed."
# }
The  'if' line that you see above (and the commented out else code), do not execute and do not give any errors.  This is what the output look like, basically it is just showing the entire if statement...
Is anyone using Bitbucket 'Runners for windows'?  There is absolutely no examples (that I can find).

1 answer

This works (using '()', and ';'...

- if ($Env:BUILDVERSIONNUMBER) {git add $Env:BITBUCKET_CLONE_DIR\eLookCommon\CommonAssemblyInfo.cs; git commit -m "Committing new build version number."; git push origin $Env:BITBUCKET_BRANCH}

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events