Une collection organisée de snippets de code pour accélérer votre développement. Parcourez, recherchez et copiez en un clic.
@Library('my-shared-library') _
pipeline {
agent any
stages {
stage('Build') {
steps {
standardMavenBuild(goal: 'clean install')
}
}
}
}
@Library('my-shared-library') _
pipeline { /* ... */ }
// src/com/example/Utils.groovy
package com.example
class Utils {
static void sayHello(script) {
script.echo 'Hello from shared lib!'
}
}
// vars/standardMavenBuild.groovy
def call(Map config) {
sh "mvn ${config.goal}"
}
@Library('my-shared-library')
import com.example.Utils
node {
stage('Demo') {
Utils.sayHello(this)
}
}