I'm new to Azure DevOps and am looking to create the correct pipeline/release structures for my projects. I'm struggling to get to the point of how I'd build my code passing in the correct value for my build configs.
I have created my repo and branches:
main (main branch for released/to be released code)
feature/add_new_customer (feature branches per piece of work)
uat (a branch merging in multiple features commits specifically for testing prior to releases)
I created a build pipeline and this has created me an "azure-pipelines.yaml" file that I have used to build and publish the build files. This is triggered from my branches:
trigger:
- main
- feature/*
- uat
All good up to now. But this was by specifying the build config statically/hardcoded in yaml
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
**buildConfiguration: 'Release'**
I have now added a variable to my pipeline, BuildConfig, and set to "UAT" so I can reference in my yaml like so:
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
**buildConfiguration: '$(BuildConfig)'**
and this lets me set the build config "dynamically", but if I create another pipeline, say to build my release build from the main branch this creates an azure-pipelines-1.yaml which must be wrong as I'd then have to duplicate these files just to change the trigger branch?
Is there a "proper" way to create builds for different environments based on the branch I am checking in? I've seen the Environments but they just seem to offer me VM's or Kubernetes? I'm simply looking to build a .net framework legacy web form application so don't need anything fancy.
I've not started on the deployment process yet!!! :D