我对詹金斯世界是陌生的,并且不确定为什么它不阅读我的声明式管道中的步骤。
我敢肯定这很简单,但是我似乎看不出错误在哪里。
import cloud.GitClient
import cloud.SlackClient
def call(body) {
def parameters = [:]
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = parameters
body()
pipeline {
agent {
kubernetes {
cloud parameters['buildCloudId']
}
}
stages {
stage('Inform Build Start') {
steps {
script{
slackClient.warn('Starting build!')
}
}
}
stage('Build Docker Images') {
steps {
checkout scm
container('docker') {
withCredentialsee(usernamePassword(credentialsId: parameters.docker.credentialsId, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')) {
sh """
echo "\$PASSWORD" | docker login -u \$USERNAME --password-stdin hub.containers
./build.sh
"""
}
}
}
post {
failure {
script {
slackClient.failed("Docker backend build *FAILED*! <${env.BUILD_URL}console|See log> for details.")
}
}
success {
script {
slackClient.success("Docker backend build *COMPLETED*! <${env.BUILD_URL}console|See log> for details.")
}
}
}
}
}
}
}
在詹金斯,一切都显示为绿色,但是日志显示根本没有运行。