| Ran into a similar issue, when attempting to set 'Cache control' headers during publishing to S3, and eventually figured out that the userMetadata parameter had to be set twice (going by the Jenkins pipeline syntax editor). Oddly enough, it worked. Working pipeline step is as follows:
step([$class: 'S3BucketPublisher',
consoleLogLevel: 'INFO',
dontWaitForConcurrentBuildCompletion: false,
entries: [[
bucket: 'example.com',
excludedFile: '',
flatten: false,
gzipFiles: false,
keepForever: false,
managedArtifacts: false,
noUploadOnFailure: true,
selectedRegion: 'ap-south-1',
showDirectlyInBrowser: false,
sourceFile: 'dist/**/*',
storageClass: 'STANDARD',
uploadFromSlave: true,
useServerSideEncryption: false,
userMetadata: [[key: 'Cache-Control', value: 'max-age=86400']]
]],
profileName: 's3deployer',
pluginFailureResultConstraint: 'FAILURE',
userMetadata: [[key: 'Cache-Control', value: 'max-age=86400']]
])
|