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

0 votes

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
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,085 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you