I am super new at this. I want to build an artifact based on a branch in my azure devops repository i.e An artifact from development branch and use that artifact to release to my dev environment in release pipeline. I am using this to only move around code for my databricks workspaces. Any help or direction is appreciated. Thank you
trigger:
branches:
include:
- development
stages:
- stage: build
displayName: Build
variables:
databricksSourceFolder: $(Build.SourcesDirectory)/$(code_build_path)
jobs:
- job: builddb
displayName: Build Databricks
steps:
- publish: $(databricksSourceFolder)
artifact: Databricks
Tried this but this still builds from the main branch and not development
To run build for the
developmentbranch, you need to check with the following things:As you have configured in the YAML file of the build pipeline, ensure the branch filters on the CI trigger include the
developmentbranch.Ensure the YAML file with above configurations is existing in the
developmentbranch.After above steps, when new commits pushed to the
developmentbranch, a new run of the build pipeline will be triggered. This new run will use the new commits on thedevelopmentbranch to build.If you manually trigger the build pipeline, on the pop-up window, you can select which git ref (branch, tag or commit) the pipeline will run for. Then the new run will use the latest commit on the selected ref to build.
After the build task (such as
DotNetCoreCLI,VSBuild, etc..), don't forget to use thePublishPipelineArtifacttask to publish the build artifacts so that the subsequent release pipeline can get the artifacts to release.In the classic release pipeline, you can configure like as below:
Add the build pipeline as the Source artifact.
Set the CD trigger (Continuous deployment trigger). If you want the release pipeline can be triggered only when the build runs for the
developmentbranch, you can set the branch filters to only include thedevelopmentbranch.Add the stage to release the artifact to the
devenvironment.On the
Pre-deployment conditionssettings of the stage, you can add the Artifact filters to let the stage be triggered only when the build artifacts are from the specifieddevelopmentbranch.