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.

Publish Over FTP

step([$class: 'BapFtpPromotionPublisherPlugin']): Send build artifacts over FTP

Send build artifacts over FTP as a build step during a promotion process.
  • publishers
      Array / List of Nested Object
    • configName

      Select an FTP configuration from the list configured in the global configuration of this Jenkins.

      The configuration defines the connection properties and base directory of the FTP server.

      • Type: String
    • verbose
      Select to enable logging of all commands sent to, and responses received from the FTP server in the Jenkins console.
      • Type: boolean
    • transfers
        Array / List of Nested Object
      • sourceFiles

        Files to upload to a server.

        The string is a comma separated list of includes for an Ant fileset eg. '**/*.jar' (see Patterns in the Ant manual).
        The base directory for this fileset is the workspace.

        • Type: String
      • excludes

        Exclude files from the Transfer set.

        The string is a comma separated list of excludes for an Ant fileset eg. '**/*.log,**/*.tmp,.git/' (see Patterns in the Ant manual)

        • Type: String
      • remoteDirectory

        Optional destination folder.

        This folder will be below the one in the global configuration, if present.
        The folder will be created if does not exist.

        • Type: String
      • removePrefix

        First part of the file path that should not be created on the remote server.

        Directory structures are created relative to the base directory, which is usually the workspace.
        You normally do not want the full path to these files to be created on the server.
        For example if Source files were target/deployment/images/**/ then you may want Remove prefix to be target/deployment This would create the images folder under the remote directory, and not target/deployment
        Jenkins environment variables can be used in this path.

        If you use remove prefix, then ALL source file paths MUST start with the prefix.

        • Type: String
      • asciiMode

        Select to enable ASCII mode for the transfer, otherwise binary transfer mode will be used.

        Use with ASCII text files to fix the line terminators when transferring between different operating systems.

        • Type: boolean
      • remoteDirectorySDF

        Select this to include the timestamp in the remote directory.

        The timestamp is the date of build. If this publisher is being used during a promotion, then the timestamp is that of the build that is being promoted.
        This setting turns the remote directory option into a java SimpleDateFormat.
        The SimpleDateFormat(SDF) uses letters to represent components of the date, like the month, year, or day of the week. Click here for more information about the date patterns.
        As the SDF reserves all of the letters [A-Z][a-z], any that you want to appear literally in the directory that is created will need to be quoted.

        Some examples follow - all examples are based on a build with a timestamp of 3:45 pm and 55 seconds on the 7th November 2010.

        Remote directory Directories created
        'qa-approved/'yyyyMMddHHmmss qa-approved/20101107154555
        'builds/'yyyy/MM/dd/'build-${BUILD_NUMBER}' builds/2010/11/07/build-456 (if the build was number 456)
        yyyy_MM/'build'-EEE-d-HHmmss 2010_11/build-Sun-7-154555
        yyyy-MM-dd_HH-mm-ss 2010-11-07_15-45-55

        • Type: boolean
      • flatten

        Only create files on the server, don't create directories (except for the remote directory, if present).

        All files that have been selected to transfer must have unique filenames. The publisher will stop and fail as soon as a duplicate filename is found when using the flatten option.

        • Type: boolean
      • cleanRemote

        Select to delete all files and directories within the remote directory before transferring files.

        • Type: boolean
      • noDefaultExcludes
        • Type: boolean
      • makeEmptyDirs

        The default behaviour of this plugin is to match files, and then create any directories required to preserve the paths to the files.
        Selecting this option will create any directories that match the Source files pattern, even if empty.

        • Type: boolean
      • patternSeparator

        The regular expression that is used to separate the Source files and Exclude files patterns.

        The Source files and Exclude files both accept multiple patterns that by default are split using

        [, ]+
        which is how Ant, by default, handles multiple patterns in a single string.

        The above expression makes it difficult to reference files or directories that contain spaces. This option allows the expression to be set to something that will preserve the spaces in a pattern eg. a single comma.

        • Type: String
    • useWorkspaceInPromotion

      Set the root directory for the Source files to the workspace.

      By default this plugin uses the artifacts directory (where archived artifacts are stored). This allows the artifacts from the build number that you are promoting to be sent somewhere else.

      If you run tasks that produce files in the workspace during the promotion and you want to publish them, then set this option.

      If you need to send files from both the workspace and the archive directory, then you need to add a second server, even if you want to send the files to the same place. This is due to the fact that the workspace is not necessarily on the same host as the archive directory

      • Type: boolean
    • usePromotionTimestamp

      Use the build time of the promotion when the remote directory is a date format.

      By default this plugin uses the time of the original build (the one that is being promoted) when formatting the remote directory. Setting this option will mean that if you use the remote directory is a date format option, it will use the time that the promotion process runs, instead of the original build.

      • Type: boolean
    • ftpRetry

      If publishing to this server fails, try again.

      Files that were successfully transferred will not be re-sent.
      If the Clean remote option is selected, and succeeds, it will not be attempted again.

        Nested Object
      • retries
        The number of times to retry this server in the event of failure.
        • Type: int
      • retryDelay
        The time to wait, in milliseconds, before attempting another transfer.
        • Type: long
    • ftpLabel

      Set the label for this Server instance - for use with Parameterized publishing.

      Expand the help for Parameterized publishing for more details.

        Nested Object
      • label

        Set the label for this Server instance - for use with Parameterized publishing.

        Expand the help for Parameterized publishing for more details.

        • Type: String
    • ftpCredentials
      Set the username and password to use with this connection.

      If you want to use different credentials from those configured for this server, or if the credentials have not been specified for this server, then enable this option and set the username and password to use.

        Nested Object
      • username
        • Type: String
      • password
        • Type: String
  • continueOnError
    • Type: boolean
  • failOnError
    • Type: boolean
  • alwaysPublishFromMaster
    • Type: boolean
  • masterNodeName
    • Type: String
  • paramPublish
      Nested Object
    • parameterName
      The name of the parameter or environment variable that will contain the expression for matching the labels.
      • Type: String

ftpPublisher: Send build artifacts over FTP

Send build artifacts over FTP.
  • publishers
      Array / List of Nested Object
    • configName

      Select an FTP configuration from the list configured in the global configuration of this Jenkins.

      The configuration defines the connection properties and base directory of the FTP server.

      • Type: String
    • verbose
      Select to enable logging of all commands sent to, and responses received from the FTP server in the Jenkins console.
      • Type: boolean
    • transfers
        Array / List of Nested Object
      • sourceFiles

        Files to upload to a server.

        The string is a comma separated list of includes for an Ant fileset eg. '**/*.jar' (see Patterns in the Ant manual).
        The base directory for this fileset is the workspace.

        • Type: String
      • excludes

        Exclude files from the Transfer set.

        The string is a comma separated list of excludes for an Ant fileset eg. '**/*.log,**/*.tmp,.git/' (see Patterns in the Ant manual)

        • Type: String
      • remoteDirectory

        Optional destination folder.

        This folder will be below the one in the global configuration, if present.
        The folder will be created if does not exist.

        • Type: String
      • removePrefix

        First part of the file path that should not be created on the remote server.

        Directory structures are created relative to the base directory, which is usually the workspace.
        You normally do not want the full path to these files to be created on the server.
        For example if Source files were target/deployment/images/**/ then you may want Remove prefix to be target/deployment This would create the images folder under the remote directory, and not target/deployment
        Jenkins environment variables can be used in this path.

        If you use remove prefix, then ALL source file paths MUST start with the prefix.

        • Type: String
      • asciiMode

        Select to enable ASCII mode for the transfer, otherwise binary transfer mode will be used.

        Use with ASCII text files to fix the line terminators when transferring between different operating systems.

        • Type: boolean
      • remoteDirectorySDF

        Select this to include the timestamp in the remote directory.

        The timestamp is the date of build. If this publisher is being used during a promotion, then the timestamp is that of the build that is being promoted.
        This setting turns the remote directory option into a java SimpleDateFormat.
        The SimpleDateFormat(SDF) uses letters to represent components of the date, like the month, year, or day of the week. Click here for more information about the date patterns.
        As the SDF reserves all of the letters [A-Z][a-z], any that you want to appear literally in the directory that is created will need to be quoted.

        Some examples follow - all examples are based on a build with a timestamp of 3:45 pm and 55 seconds on the 7th November 2010.

        Remote directory Directories created
        'qa-approved/'yyyyMMddHHmmss qa-approved/20101107154555
        'builds/'yyyy/MM/dd/'build-${BUILD_NUMBER}' builds/2010/11/07/build-456 (if the build was number 456)
        yyyy_MM/'build'-EEE-d-HHmmss 2010_11/build-Sun-7-154555
        yyyy-MM-dd_HH-mm-ss 2010-11-07_15-45-55

        • Type: boolean
      • flatten

        Only create files on the server, don't create directories (except for the remote directory, if present).

        All files that have been selected to transfer must have unique filenames. The publisher will stop and fail as soon as a duplicate filename is found when using the flatten option.

        • Type: boolean
      • cleanRemote

        Select to delete all files and directories within the remote directory before transferring files.

        • Type: boolean
      • noDefaultExcludes
        • Type: boolean
      • makeEmptyDirs

        The default behaviour of this plugin is to match files, and then create any directories required to preserve the paths to the files.
        Selecting this option will create any directories that match the Source files pattern, even if empty.

        • Type: boolean
      • patternSeparator

        The regular expression that is used to separate the Source files and Exclude files patterns.

        The Source files and Exclude files both accept multiple patterns that by default are split using

        [, ]+
        which is how Ant, by default, handles multiple patterns in a single string.

        The above expression makes it difficult to reference files or directories that contain spaces. This option allows the expression to be set to something that will preserve the spaces in a pattern eg. a single comma.

        • Type: String
    • useWorkspaceInPromotion

      Set the root directory for the Source files to the workspace.

      By default this plugin uses the artifacts directory (where archived artifacts are stored). This allows the artifacts from the build number that you are promoting to be sent somewhere else.

      If you run tasks that produce files in the workspace during the promotion and you want to publish them, then set this option.

      If you need to send files from both the workspace and the archive directory, then you need to add a second server, even if you want to send the files to the same place. This is due to the fact that the workspace is not necessarily on the same host as the archive directory

      • Type: boolean
    • usePromotionTimestamp

      Use the build time of the promotion when the remote directory is a date format.

      By default this plugin uses the time of the original build (the one that is being promoted) when formatting the remote directory. Setting this option will mean that if you use the remote directory is a date format option, it will use the time that the promotion process runs, instead of the original build.

      • Type: boolean
    • ftpRetry

      If publishing to this server fails, try again.

      Files that were successfully transferred will not be re-sent.
      If the Clean remote option is selected, and succeeds, it will not be attempted again.

        Nested Object
      • retries
        The number of times to retry this server in the event of failure.
        • Type: int
      • retryDelay
        The time to wait, in milliseconds, before attempting another transfer.
        • Type: long
    • ftpLabel

      Set the label for this Server instance - for use with Parameterized publishing.

      Expand the help for Parameterized publishing for more details.

        Nested Object
      • label

        Set the label for this Server instance - for use with Parameterized publishing.

        Expand the help for Parameterized publishing for more details.

        • Type: String
    • ftpCredentials
      Set the username and password to use with this connection.

      If you want to use different credentials from those configured for this server, or if the credentials have not been specified for this server, then enable this option and set the username and password to use.

        Nested Object
      • username
        • Type: String
      • password
        • Type: String
  • continueOnError
    Select to continue publishing to the other FTP servers after a problem with a previous server.
    • Type: boolean
  • failOnError
    Select to mark the build as a failure if there is a problem publishing to a server. The default is to mark the build as unstable.
    • Type: boolean
  • alwaysPublishFromMaster

    Select to publish from the Jenkins master.

    The default is to publish from the server that holds the files to transfer (workspace on the agent, or artifacts directory on the master)
    Enabling this option could help dealing with strict network configurations and firewall rules.
    This option will cause the files to be transferred through the master before being sent to the remote server, this may increase network traffic, and could increase the build time.

    • Type: boolean
  • masterNodeName

    Set the NODE_NAME for the master Jenkins.

    Set this option to give a value to the NODE_NAME environment variable when the value is missing (the Jenkins master).
    This is useful if you use the NODE_NAME variable in the remoteDirectory option and the build may occur on the master.

    • Type: String
  • paramPublish
      Nested Object
    • parameterName
      The name of the parameter or environment variable that will contain the expression for matching the labels.
      • 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.