Код IT
← Каталог

Jenkins Shared Library — общий Groovy-код CI — Классы в src/

Фрагмент из «Jenkins Shared Library — общий Groovy-код CI»: Классы в src/.

Groovy main.groovy
import com.example.ci.DeployHelper

def call(Map config) {
    pipeline {
        agent any
        stages {
            stage('Deploy') {
                steps {
                    script {
                        def helper = new DeployHelper(this)
                        helper.deploy(config.env ?: 'staging')
                    }
                }
            }
        }
    }
}
import com.example.ci.DeployHelper

def call(Map config) {
    pipeline {
        agent any
        stages {
            stage('Deploy') {
                steps {
                    script {
                        def helper = new DeployHelper(this)
                        helper.deploy(config.env ?: 'staging')
                    }
                }
            }
        }
    }
}