Azure Pipelines
Azure DevOps pipelines in YAML.
Structure
trigger: [main]- CI trigger branches
pool: vmImage: ubuntu-latest- Choose a hosted agent
stages: - stage: Build- Declare a stage
jobs: - job: A- Jobs in a stage
steps: - script: dotnet build- A step
Tasks
- task: DotNetCoreCLI@2- Use a built-in task
- checkout: self- Get the source
- publish: $(Build.ArtifactStagingDirectory)- Publish artifacts
Variables
variables: { tag: "1.0" }- Define variables
$(Build.BuildId)- Predefined variable
$(MySecret)- Secret variable
condition: eq(variables["Build.SourceBranchName"], "main")- Conditional