pipelines

✅ any — free agent/slave

Jenkinsfile
pipeline {
    agent any
    stages {
        stage('Hello') {
            steps {
                echo 'Hello World'
                sh 'mkdir abc'
                sh 'ls -lart'
                sh 'pwd'
            }
        }
    }
}

✅ none — schedule stages on different agents

Jenkinsfile
pipeline {
    agent none
    stages {
        stage('Hello') {
            agent any
            steps {
                echo 'Hello World'
                // sh 'mkdir abc'
                sh 'ls -lart'
                sh 'pwd'
            }
        }
        stage('Hello1') {
            agent any
            steps {
                echo 'Hello World'
                // sh 'mkdir abc'
                sh 'ls -lart'
                sh 'pwd'
            }
        }
    }
}

✅ label — specific agent


✅ docker — run inside container


✅ pipeline with environment block


✅ pipeline with options (retry, buildDiscarder, timeout, timestamps)


✅ parallel stages with try/catch and dir


✅ trigger other jobs using build()


✅ post block - always, success, failure, etc.


✅ post inside stage


✅ when condition with expression


✅ when condition with parameters


✅ Git + Maven build