I have a build script that I want to run some build steps for code on master
, features/*
and releases/*
, and then some publishing features only on master
and releases/*
branches.
I can't seem to locate any documentation for sectioning out the build script by branches. Here's a rough overview of my build script (just the tasks, leaving off params for brevity)
trigger:
- master
- releases/*
- features/*
pool:
vmImage: 'windows-latest'
name: $(Major).$(Minor).$(rev:r)
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
Major: 1
Minor: 1
steps:
- task: NuGetCommand@2
- task: VSBuild@1
- task: VSTest@2
## I would like everything below this line to only be run on releases/* or master
- task: WhiteSource Bolt@20
- task: NuGetCommand@2
- task: PublishBuildArtifacts@1
The second half would need to run conditionally, and only if the top half is successful. I am open to splitting these out into two scripts in it makes it easier.