0

i have a bitbucket classic build pipeline and i need to have the ability to set the build clean option at queue time. it seems like this used to be possible via the Build.Clean variable but that has since been deprecated.

When editing a build pipeline the Clean option uses an editable drop down but anytime you try and type something, it erases what you just wrote. i would like to set this option to a variable like $(CleanBuild)

enter image description here

josh
  • 1,231
  • 1
  • 12
  • 28

1 Answers1

1

Assign build clean option at queue time

Indeed, the variable Build.Clean is already deprecated. But the document Use predefined variables provided another variable Build.Repository.Clean, which will help us to clean the Sources:

enter image description here

Besides, if you want to clean other options fields, like All build directories:

enter image description here

I do not believe there is a way to assign the clean options at queue-time. Even if we use deprecated Build.Clean variable, we still can clear Sources only.

You could check the similar thread for some more details.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • 1
    Thanks. The docs make it seem like that is a read-only variable that tells you what the setting is in the pipeline. it should be made clear that `Build.Repository.Clean` is a direct successor to `Build.Clean`. I tested it by setting the pipeline setting to False and then set `Build.Repository.Clean` at queue time. this caused `git clean -ffdx` and `git reset --hard HEAD` to be ran – josh Apr 21 '20 at 05:49