The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Core

archiveArtifacts: Archive the artifacts

Archives the build artifacts (for example, distribution zip files or jar files) so that they can be downloaded later. Archived files will be accessible from the Jenkins webpage.
Normally, Jenkins keeps artifacts for a build as long as a build log itself is kept, but if you don't need old artifacts and would rather save disk space, you can do so.

Note that the Maven job type automatically archives any produced Maven artifacts. Any artifacts configured here will be archived on top of that. Automatic artifact archiving can be disabled under the advanced Maven options.
  • artifacts
    You can use wildcards like 'module/dist/**/*.zip'. See the includes attribute of Ant fileset for the exact format. The base directory is the workspace. You can only archive files that are located in your workspace.
    • Type: String
  • allowEmptyArchive (optional)
    Normally, a build fails if archiving returns zero artifacts. This option allows the archiving process to return nothing without failing the build. Instead, the build will simply throw a warning.
    • Type: boolean
  • caseSensitive (optional)
    Artifact archiver uses Ant org.apache.tools.ant.DirectoryScanner which by default is case sensitive. For instance, if the job produces *.hpi files, pattern "**/*.HPI" will fail to find them.

    This option can be used to disable case sensitivity. When it's unchecked, pattern "**/*.HPI" will match any *.hpi files, or pattern "**/cAsEsEnSiTiVe.jar" will match a file called caseSensitive.jar.
    • Type: boolean
  • defaultExcludes (optional)
    • Type: boolean
  • excludes (optional)
    Optionally specify the 'excludes' pattern, such as "foo/bar/**/*". A file that matches this mask will not be archived even if it matches the mask specified in 'files to archive' section.
    • Type: String
  • fingerprint (optional)
    • Type: boolean
  • onlyIfSuccessful (optional)
    • Type: boolean

fingerprint: Record fingerprints of files to track usage

Jenkins can record the 'fingerprint' of files (most often jar files) to keep track of where/when those files are produced and used. When you have inter-dependent projects on Jenkins, this allows you to quickly find out answers to questions like:
  • I have foo.jar on my HDD but which build number of FOO did it come from?
  • My BAR project depends on foo.jar from the FOO project.
    • Which build of foo.jar is used in BAR #51?
    • Which build of BAR contains my bug fix to foo.jar #32?

To use this feature, all of the involved projects (not just the project in which a file is produced, but also the projects in which the file is used) need to use this and record fingerprints.

See this document for more details.

perfpublisher: Activate PerfPublisher for this project

  • name
    • Type: String
  • threshold
    • Type: String
  • healthy
    • Type: String
  • unhealthy
    • Type: String
  • metrics
    • Type: String

s3Upload: Publish artifacts to S3 Bucket

  • profileName
    • Type: String
  • entries
      Array/List
      Nested Object
    • bucket
      Destination bucket. It will be created if doesn't exist. Environment variable can be used, for example my-artifact-bucket/${JOB_NAME}-${BUILD_NUMBER}.
      • Type: String
    • sourceFile
      Files to be uploaded. This field follows the Ant glob syntax, such as **/build/test-reports/*.xml. The base directory is the workspace.
      • Type: String
    • excludedFile
      • Type: String
    • storageClass
      • Type: String
    • selectedRegion
      Region location of the Bucket. By default plugin uses value provided by system property "hudson.plugins.s3.DEFAULT_AMAZON_S3_REGION"
      • Type: String
    • noUploadOnFailure
      If Enabled, the artifacts won't be published if the build failed.
      • Type: boolean
    • uploadFromSlave
      Upload directly from the slave, instead of proxying the upload to the master.
      • Type: boolean
    • managedArtifacts
      When enabled, this lets Jenkins fully manage the artifacts, exactly like it does when the artifacts are published to the master.
      In this case, the artifacts are stored in the "jobs/[job]/[build-number]/" path in the selected bucket and prefix path. This means the following features are enabled:
      • artifacts are finger printed and linked to the build
      • artifacts can be downloaded directly from the build page in the S3 Artifact section
      • artifacts are automatically deleted when the build is deleted
      • the S3 Copy Artifact build step can be used to download artifacts from S3 automatically, helping build complex pipelines
      • Type: boolean
    • useServerSideEncryption
      Use S3 AES-256 server side encryption support.
      • Type: boolean
    • flatten
      When enabled, Jenkins will ignore the directory structure of the artifacts in the source project and copy all matching artifacts directly into the specified bucket. By default the artifacts are copied in the same directory structure as the source project.
      • Type: boolean
    • gzipFiles
      When enabled, files will be compressed with GZIP and "Content-Encoding" header will be set to "gzip".
      • Type: boolean
    • keepForever
      By default, artifacts will be cleaned up as part of job history rotation policy. If you want to keep artifacts after removing job history, you need to enable this option.
      • Type: boolean
    • showDirectlyInBrowser
      If option is enabled, content of artifact would be displayed directly in browser. Otherwise, it would be attached and user could download it.
      • Type: boolean
    • userMetadata
        Array/List
        Nested Object
      • key
        Metadata key for the files from this build. It will be prefixed by "x-amz-meta-" when uploaded to S3. Can contain macros (e.g. environment variables).
        • Type: String
      • value
        Metadata value for the files from this build. Can contain macros (e.g. environment variables).
        • Type: String
  • userMetadata
      Array/List
      Nested Object
    • key
      Metadata key for the files from this build. It will be prefixed by "x-amz-meta-" when uploaded to S3. Can contain macros (e.g. environment variables).
      • Type: String
    • value
      Metadata value for the files from this build. Can contain macros (e.g. environment variables).
      • Type: String
  • dontWaitForConcurrentBuildCompletion
    When disabled, only publish to S3 after completion of concurrent builds to prevent overriding published artifact. You can enable this to publish to S3 at the end of each concurrent build. Published artifact should then have a different name for each build to prevent unnecessary uploads.
    • Type: boolean
  • consoleLogLevel
    Allows filtering log messages by level of severity: INFO, WARNING and SEVERE.
    • Type: String
  • pluginFailureResultConstraint
    • Type: String

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.