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.

File Operations Plugin

fileOperations: File Operations

  • fileOperations
      Array / List of Nested Choice of Objects
    • fileCopyOperation
      • includes : String
        Files included to copy, this supports ant-style file pattern ex: target/*/final*.xml
      • excludes : String
        Files excluded from copying, this supports ant-style file pattern ex: target/*/final*.xml
      • targetLocation : String
        Destination folder location to copy the files. Base directory is workspace.
      • flattenFiles : boolean
        If selected, files are copied directly to the target location without preserving source file sub-directory structure.
      • renameFiles : boolean
        By default, the file name of the source file is preserved. When flattening files, this can cause problems if files of the same name exist in multiple source sub-directories. Selecting this option allows the output file name to be manipulated to avoid file name clashes. Only used for setting flattenFiles: true.
      • sourceCaptureExpression : String
        Java-style regular expression that is run against the workspace relative path of each matching source file. This should be used to capture parts of the path that will be used in the target name expression to make each file name unique across all subdirectories. If path not match the regex the file is copied directly to the target location. If the includes path is not handled within the regex the sub-directory structure will be preserved.

        Example:

                    // folllowing structure:
                    // dir1/info-app.txt
                    // dir1/error-app.txt
                    fileOperations([fileCopyOperation(
                        includes: '**/dir1/*.txt',
                        targetLocation: 'logs/',
                        flattenFiles: true,
                        renameFiles: true,
                        sourceCaptureExpression: 'dir1/(.*)-app\\.txt$',
                        targetNameExpression: '$1.log')
                    ])
                
        will result in:
                    logs/info.log
                    logs/error.log
                

      • targetNameExpression : String
        An expression that provides the desired target file name. This can reference variables captured in the source capture expression by using $1, $2 etc.
      • useDefaultExcludes : boolean (optional)
    • fileCreateOperation
      • fileName : String
        Path and Name of the file to be created in workspace.
      • fileContent : String
        File content to be created, use environment variables where needed.
    • fileDeleteOperation
      • includes : String
        Files included to delete, this supports ant-style file pattern ex: target/*/final*.xml
      • excludes : String
        Files excluded from deleting, this supports ant-style file pattern ex: target/*/final*.xml
      • useDefaultExcludes : boolean (optional)
    • fileDownloadOperation
      • url : String
        Url of the file to download.
      • userName : String
      • password : String
      • targetLocation : String
        Destination location to download the file. Base directory is workspace.
      • targetFileName : String
      • proxyHost : String
      • proxyPort : String
    • fileJoinOperation
      • sourceFile : String
        Source file path to copy the content.
      • targetFile : String
        Target file path to append the content from source file.
    • filePropertiesToJsonOperation
      • sourceFile : String
        Source file path of properties.
      • targetFile : String
        Target file path to create or update with json data.
    • fileRenameOperation
      • source : String
        File to be renamed.
      • destination : String
        Destination file location to rename. Base directory is workspace.
    • fileTransformOperation
      • includes : String
        Files included to copy, this supports ant-style file pattern ex: target/*/final*.xml
      • excludes : String
        Files excluded from copying, this supports ant-style file pattern ex: target/*/final*.xml
      • useDefaultExcludes : boolean (optional)
    • fileUnTarOperation
      • filePath : String
        Source tar file location.
      • targetLocation : String
        Destination folder location to untar the files. Base directory is workspace.
      • isGZIP : boolean
    • fileUnZipOperation
      • filePath : String
        Source zip file location.
      • targetLocation : String
        Destination folder location to unzip the files. Base directory is workspace.
    • fileZipOperation
      • folderPath : String
        Path of the file or folder to create a zip file for, relative to the workspace directory.
      • outputFolderPath : String
        Path to a target directory for the zip file, relative to the workspace directory. Defaults to workspace directory if not defined.
    • folderCopyOperation
      • sourceFolderPath : String
        Folder to be copied.
      • destinationFolderPath : String
        Destination folder location to copy the files. Base directory is workspace.
    • folderCreateOperation
      • folderPath : String
        Path and Name of the folder to be created in workspace.
    • folderDeleteOperation
      • folderPath : String
        Path and Name of the folder to be deleted in workspace.
    • folderRenameOperation
      • source : String
        Folder to be renamed.
      • destination : String
        Destination folder name to rename. Base directory is workspace.

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.