DevOps Classroom notes 29/Oct/2023

Azure DevOps Pipelines

  • Pipeline is collection of stages and stage is collection of jobs and job is collection of steps
  • Stage: This represents a logical activity in ci/cd pipelines, examples: build, test, deploy. Each stage can be executed on a different agent
  • In one stage we can multiple Jobs and if required they can run in parallel.

Variables in Azure DevOps Pipelines

  • Refer Here for official docs
  • Types of variables
    • user-defined variables
    • System variables Refer Here and Refer Here for predefined variables
    • Environment variables
  • Syntax for using variables: $(Variable-Name)

Publishing build artifacts

  • refer the yaml below
---
pool: default

trigger:
  - master

steps:
  - bash: "echo staging directory $(Build.ArtifactStagingDirectory) and number $(Build.BuildNumber)"
  - bash: env
  - task: DotNetCoreCLI@2
    displayName: build the code
    inputs:
      command: build
      projects: src/NopCommerce.sln
      configuration: Release
  - task: DotNetCoreCLI@2
    displayName: publish the nopcommerce
    inputs:
      command: publish
      projects: src/Presentation/Nop.Web/Nop.Web.csproj
      zipAfterPublish: true
      configuration: Release
      arguments: "-o $(Build.ArtifactStagingDirectory)/Published"
  - task: PublishBuildArtifacts@1
    displayName: Make artifacts available
    inputs:
      PathtoPublish: $(Build.ArtifactStagingDirectory)/Published/Nop.Web.zip
      ArtifactName: 'nop'
      publishLocation: Container


Preview

Activity

  • Create a Azure DevOps pipeline to build spring petclinic and publish jar file

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner