Posts

Showing posts with the label Azure Pipelines

Checkout Part Of A Branch In Azure DevOps Pipelines (GetSources)

Answer : In Azure DevOps you don't have option to get only part of the repository, but there is a workaround: Disable the "Get sources" step and get only the source you want by manually executing the according git commands in a script. To disable the default "Get Sources" just specify none in the checkout statement: - checkout: none In the pipeline add a CMD/PowerShell task to get the sources manually with one of the following 2 options: 1. Get only part of the repo with git sparse-checkout. For example, get only the directories src_1 and src_2 within the test folder (lines starting with REM ### are just the usual batch comments): - script: | REM ### this will create a 'root' directory for your repo and cd into it mkdir myRepo cd myRepo REM ### initialize Git in the current directory git init REM ### set Git sparsecheckout to TRUE git config core.sparsecheckout true REM ### write the directories that y...

Azure Pipeline To Trigger Pipeline Using YAML

Image
Answer : For trigger of one pipeline from another azure official docs suggest this below solution. i.e. use pipeline triggers resources: pipelines: - pipeline: RELEASE_PIPELINE // any arbitrary name source: PIPELINE_NAME. // name of the pipeline shown on azure UI portal trigger: branches: include: - dummy_branch // name of branch on which pipeline need to trigger But actually what happens, is that it triggers two pipelines. Take an example, let suppose we have two pipelines A and B and we want to trigger B when A finishes. So in this scenario B runs 2 times, once when you do a commit (parallel with A) and second after A finishes. To avoid this two times pipeline run problem follow the below solution trigger: none // add this trigger value to none resources: pipelines: - pipeline: RELEASE_PIPELINE // any arbitrary name source: PIPELINE_NAME. // name of the pipeline shown on azure UI portal trigger: branches: includ...