Wednesday, June 1, 2022

Azure DevOps vs Jenkins

 

Azure DevOps vs Jenkins

  • Group Tasks – Azure allows you to perform a sequence of tasks, already defined in a pipeline, into a single task, whereas Jenkins is generally done by a single user which leads to tracking and accountability problems.
  • YAML Interface – With YAML in Azure Pipelines, you can configure CI/CD pipeline as code, whereas Jenkins doesn’t have a YAML interface.
  • Platform, language, and cloud – In Azure Pipelines, you can deploy various applications including Node.js, android, iOS, java, python, and many more and then deploy to either on-premise, AWS, Azure, or GCP. With regards to Jenkins, you get scripted pipelines that must be programmed in Groovy.
  • Analytics in Azure Pipelines is provided at the end with two parameters – rate and duration of the run. Jenkins doesn’t provide any analytics.
  • Plugins and Tasks – The built-in plugins and extensions can be downloaded from Azure DevOps marketplace. Jenkins has a wide range of plugins to choose from.
  • Integration of Azure Pipelines with Microsoft is easy, but requires configuration changes to integrate with non-Microsoft products. Jenkins, on the other hand, can easily be modified and extended.
  • Easy Support – Since Jenkins is open source, there is a huge support from the agile teams.

Who wins the battle?

The battle boils down to the team or the project you work on. While Jenkins is more flexible to create and deploy complex workflows, Azure DevOps is faster to adapt. In most cases, organizations use both the tools and in such cases, Azure Pipelines supports integration with Jenkins.



Concerns with Jenkins: 

  • 12
    Workarounds needed for basic requirements
  • 9
    Groovy with cumbersome syntax
  • 7
    Plugins compatibility issues
  • 6
    Lack of support
  • 6
    Limited abilities with declarative pipelines
  • 4
    No YAML syntax
  • 3
    Too tied to plugins versions


  • Sample Jenkins File 

  • pipeline {
  •     agent none
  •     stages {
  •         stage('Build') {
  •             steps {
  •                 sh 'npm install'
  •                 sh 'npm run build'
  •             }
  •         }
  •         stage('Test') {
  •             steps {
  •                 sh 'npm test'
  •             }
  •         }
  •     }
  • }


  • Azure-pipeline.yaml
  • jobs:
  • - job: Build
  •   steps:
  •   - script: npm install
  •   - script: npm run build
  • - job: Test
  •   steps:
  •   - script: npm test


  • If we containerized our applications.
  • Jenkinsfile
  • pipeline {
  •     agent none
  •     stages {
  •         stage('Build') {
  •             agent {
  •                 docker {
  •                     image 'ubuntu:trusty'
  •                     args '-v $HOME:/build -w /build'
  •                 }
  •             }
  •             steps {
  •                 sh 'make'
  •             }
  •         }
  •         stage('Test') {
  •             agent {
  •                 docker {
  •                     image 'ubuntu:xenial'
  •                     args '-v $HOME:/build -w /build'
  •                 }
  •             }
  •             steps {
  •                 sh 'make test'
  •             }
  •         }
  •     }
  • }

  • Azure-pipeline.yaml

  • resources:
  •   containers:
  •   - container: trusty
  •     image: ubuntu:trusty
  •   - container: xenial
  •     image: ubuntu:xenial

  • jobs:
  • - job: build
  •   container: trusty
  •   steps:
  •   - script: make
  • - job: test
  •   dependsOn: build
  •   container: xenial
  •   steps:
  •   - script: make test


  • After completion Jenkinsfile

  • post {
  •     always {
  •         echo "The build has finished"
  •     }
  •     success {
  •         echo "The build succeeded"
  •     }
  •     failure {
  •         echo "The build failed"
  •     }
  • }
  • Azure-pipeline.yaml

  • jobs: - job: always steps: - script: echo "The build has finished" condition: always() - job: success steps: - script: echo "The build succeeded" condition: succeeded() - job: failed steps: - script: echo "The build failed" condition: failed()


  • https://blog.opstree.com/2021/04/13/jenkins-vs-azure-devops/

  • No comments: