DevOps Classroom notes 03/Dec/2024

Pipeline as Code

  • Pipeline as Code is about representing the CI/CD pipeline in a format that can be stored in version control system
  • Examples:
    • Jenkins: Jenkinsfile
      • Scripted Pipeline
      • Declarative Pipeline
    • Azure DevOps: azure-pipelines.yaml
    • Github Actions: .github\*.yaml
  • Branch wise pipelines

Azure DevOps Pipelines

  • To create pipeline we need to write a YAML file
  • filename can be anything but azure-pipelines.yaml is most widely used
  • This YAML has a schema (structure)
  • YAML Pipelines can be created in visual studio code (install extension) or in azure devops pipelines section

Agents

  • Azure DevOps Agents represent where we can run the pipeline
  • Agents are of two types
    • Microsoft Hosted
    • Self Hosted
  • Complete pipeline can be run on a single agent or we can have agent per stage or agent per job
  • Agents docs

Steps/Tasks

  • This is smallest unit of work where you execute the pipeline steps
  • On a broader note we have two options
    • task:
      • These are reusable activities published by azure devops or other communities
      • We can also create a custom azure devops task (it needs to written in javascript over nodejs)
      • Predefined task list
      • Community Based : Azure DevOps Market place
    • other (script/command/….):
      • These are low level activities where we mostly run the commands directly

Azure DevOps YAML Schema

Authoring Pipelins

  • Watch classroom video for instructions
  • First sample
---
pool:
  vmImage: ubuntu-24.04
trigger:
  - main
stages:
  - stage: buildstage
    jobs:
      - job: buildjob
        steps:
          - task: Maven@4
            inputs:
              mavenPomFile: pom.xml
              goals: validate
              jdkVersionOption: '1.17'
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

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

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%