DevOps Classroom notes 24/Aug/2024

Branching strategy

  • Refer Here for git flow branching strategy
  • Other two branching stratgies
    • trunk based development (old)
    • git lab branching strategy

Pipeline

  • Overview
  • Steps
    • Jenkins Server with 3 nodes
      • 1 node for building the code with label build
      • ensure sonar qube is setup
      • 1 nodes add as agents with label systemtest
      • 1 nodes add as agents with label perftest
  • Experiment
    • Write a pipeline where you build spring petclinic, perform sonar qube and then create two stages
      • ST: here run on agent with label systemtest and step is sleep 5m
      • PT: here run on agent with label perftest and step is sleep 7m
    • Ensure both stages ST and PT execute in parallel
pipeline {
    agent none
    stages {
        stage('SCM') {
            agent { label 'build' }
            steps {
                git url: '',
                    branch ''
            }
        }
        stage('Build') {
            agent { label 'build' }
            steps {
                sh 'mvn clean package'
            }
        }
        stage('Deploy') {
            parallel {
                stage('ST') {
                    agent { label 'ST' }
                    steps {
                        sh 'sleep 5m'
                        // Add commands to run unit tests here
                        // terraform
                    }
                }
                stage('PT') {
                    agent { label 'PT' }
                    steps {
                        sh 'sleep 7m'
                        // Add commands to run integration tests here
                        // terraform
                    }
                }
            }
        }

    }
}
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%%