Complete the code to specify the trigger branch for the build pipeline.
trigger:
branches:
include:
- [1]The trigger section defines which branches start the build. Usually, main is the primary branch to trigger builds.
Complete the code to specify the agent pool for the build job.
pool: vmImage: '[1]'
The vmImage specifies the virtual machine image to run the build. ubuntu-latest is a common choice for Linux builds.
Fix the error in the script step to run a shell command.
- script: echo Hello, world! displayName: 'Run a one-line script' shell: [1]
powershell on a Linux agent.cmd which is Windows-only.The shell property defines which shell runs the script. For Linux agents, bash is the correct shell for this command.
Fill both blanks to define a job with a step that installs Node.js version 16.
jobs:
- job: Build
pool:
vmImage: '[1]'
steps:
- task: NodeTool@0
inputs:
versionSpec: '[2]'
displayName: 'Install Node.js'The job runs on ubuntu-latest VM image and installs Node.js version 16.x using the NodeTool task.
Fill all three blanks to create a build pipeline that triggers on the main branch, uses Ubuntu, and runs a script step.
trigger:
branches:
include:
- [1]
pool:
vmImage: '[2]'
steps:
- script: |
echo Building project
echo Done
displayName: '[3]'This pipeline triggers on the main branch, uses the ubuntu-latest VM image, and runs a script step named Run build script.