为什么在Jenkins 2.124上找不到s3Upload构建步骤

时间:2018-05-28 06:43:45

标签: jenkins jenkins-plugins jenkins-pipeline jenkins-blueocean

我正在尝试在声明性管道中使用s3Upload步骤并收到错误:

java.lang.NoSuchMethodError: No such DSL method 's3Upload' found among steps

The docs indicate这一步应该是基本安装(核心)的一部分,但也许我错过了一个插件?我尝试了pipeline-aws-stepss3publisher插件,但都不支持我要使用的文档中的managedArtifacts行为。

这是我的实施:

pipeline {
agent any


stages {

    // checkout, build, archive... removed for brevity

    stage('Publish') {
        steps {
            s3Upload(profileName: 'build',
                dontWaitForConcurrentBuildCompletion: true,
                consoleLogLevel: 'INFO',
                pluginFailureResultConstraint: 'FAILURE',
                entries: [
                    bucket: 'measurabl-build',
                    sourceFile: config.npmOutputPath,
                    selectedRegion: 'us-west-2',
                    noUploadOnFailure: true,
                    uploadFromSlave: false,
                    managedArtifacts: true,
                    flatten: false,
                    gzipFiles: true
                ],
                userMetadata: [
                    [key: 'gitCommit', value: env.GIT_COMMIT],
                    [key: 'gitPreviousCommit', value: env.GIT_PREVIOUS_COMMIT],
                    [key: 'gitLastSuccessfulBuildCommit', value: env.GIT_PREVIOUS_SUCCESSFUL_COMMIT],
                    [key: 'gitBranch', value: env.GIT_BRANCH],
                    [key: 'gitRepo', value: env.GIT_URL],
                    [key: 'buildUrl', value: env.BUILD_URL]
                ])
        }
    }
}
}

感谢您的任何输入/帮助!

1 个答案:

答案 0 :(得分:1)

似乎Pipeline steps reference documentation错了,s3Upload步骤不是Jenkins核心的一部分。

要获得此功能,请安装此处的s3插件(S3发布商):https://plugins.jenkins.io/s3