Jenkins共享库无法引用
我无法在repo的src中引用第二个groovy文件 我的设置是:库名称管道库演示Jenkins共享库无法引用,jenkins,groovy,shared-libraries,jenkins-pipeline,Jenkins,Groovy,Shared Libraries,Jenkins Pipeline,我无法在repo的src中引用第二个groovy文件 我的设置是:库名称管道库演示 我在src文件夹中添加了第二个groovy文件 app_config.groovy 我使用的Jenkins文件是: pipeline { Library('pipeline-library-demo') _ agent { node { label params.SLAVE config = new app_config()
我在src文件夹中添加了第二个groovy文件 app_config.groovy 我使用的Jenkins文件是:
pipeline {
Library('pipeline-library-demo') _
agent {
node {
label params.SLAVE
config = new app_config()
}
}
parameters {
string(name: 'SLAVE', defaultValue: 'so_slave')
}
stages {
stage('Demo') {
steps {
echo 'Hello World'
sayHello 'Dave'
}
}
stage('bob') {
steps {
config.test 'bob'
config.bob '--help'
}
}
}
}
我想我没有正确引用app_config.groovy,它也没有找到库调用应该出现在jenkins文件的开头,请遵循下面的说明
pipeline {
Library('pipeline-library-demo') _
agent {
node {
label params.SLAVE
config = new app_config()
}
}
parameters {
string(name: 'SLAVE', defaultValue: 'so_slave')
}
stages {
stage('Demo') {
steps {
echo 'Hello World'
sayHello 'Dave'
}
}
stage('bob') {
steps {
config.test 'bob'
config.bob '--help'
}
}
}
}