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 development
branch, 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 development
branch.
trigger:
branches:
include:
- development
Ensure the YAML file with above configurations is existing in the development
branch.
After above steps, when new commits pushed to the development
branch, a new run of the build pipeline will be triggered. This new run will use the new commits on the development
branch 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 the PublishPipelineArtifact
task 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 development
branch, you can set the branch filters to only include the development
branch.
Add the stage to release the artifact to the dev
environment.
On the Pre-deployment conditions
settings of the stage, you can add the Artifact filters to let the stage be triggered only when the build artifacts are from the specified development
branch.