Ryan
Ryan

Reputation: 1628

Why is the s3Upload build step not found on Jenkins 2.124

I'm trying to use the s3Upload step in a declarative pipeline and am getting the error:

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

The docs indicate that this step should be a part of the base install (core), but perhaps I'm missing a plugin? I tried the pipeline-aws-steps and the s3publisher plugins, but neither supports the managedArtifacts behavior from the docs which I'd like to use.

This is my implementation:

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]
                ])
        }
    }
}
}

Thanks for any input/help!

Upvotes: 2

Views: 1271

Answers (1)

Ryan
Ryan

Reputation: 1628

It seems that the Pipeline steps reference documentation is wrong, the s3Upload step is not a part of Jenkins core.

To get this functionality, install the s3 plugin (S3 Publisher) found here: https://plugins.jenkins.io/s3

Upvotes: 2

Related Questions