title | description | ms.date | monikerRange |
---|---|---|---|
ArchiveFiles@2 - Archive files v2 task |
Compress files into .7z, .tar.gz, or .zip. |
07/02/2024 |
<=azure-pipelines |
:::moniker range=">=azure-pipelines-2019.1"
Archive files using compression formats such as .7z, .tar, .gz, and .zip.
:::moniker-end
:::moniker range="=azure-pipelines-2019"
Archive files using compression formats such as .7z, .rar, .tar., .gz, and .zip.
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
# Archive files v2
# Compress files into .7z, .tar.gz, or .zip.
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)' # string. Required. Root folder or file to archive. Default: $(Build.BinariesDirectory).
#includeRootFolder: true # boolean. Prepend root folder name to archive paths. Default: true.
# Archive
archiveType: 'zip' # 'zip' | '7z' | 'tar' | 'wim'. Required. Archive type. Default: zip.
#sevenZipCompression: 'normal' # 'ultra' | 'maximum' | 'normal' | 'fast' | 'fastest' | 'none'. Optional. Use when archiveType = 7z. 7z compression. Default: normal.
#tarCompression: 'gz' # 'gz' | 'bz2' | 'xz' | 'none'. Optional. Use when archiveType = tar. Tar compression. Default: gz.
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' # string. Required. Archive file to create. Default: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip.
#replaceExistingArchive: true # boolean. Replace existing archive. Default: true.
#verbose: false # boolean. Force verbose output. Default: false.
#quiet: false # boolean. Force quiet output. Default: false.
:::moniker-end
:::moniker range=">=azure-pipelines-2020 <=azure-pipelines-2020.1"
# Archive files v2
# Compress files into .7z, .tar.gz, or .zip.
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)' # string. Required. Root folder or file to archive. Default: $(Build.BinariesDirectory).
#includeRootFolder: true # boolean. Prepend root folder name to archive paths. Default: true.
# Archive
archiveType: 'zip' # 'zip' | '7z' | 'tar' | 'wim'. Required. Archive type. Default: zip.
#sevenZipCompression: '5' # 'ultra' | 'maximum' | 'normal' | 'fast' | 'fastest' | 'none'. Optional. Use when archiveType = 7z. 7z compression. Default: 5.
#tarCompression: 'gz' # 'gz' | 'bz2' | 'xz' | 'none'. Optional. Use when archiveType = tar. Tar compression. Default: gz.
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' # string. Required. Archive file to create. Default: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip.
#replaceExistingArchive: true # boolean. Replace existing archive. Default: true.
#verbose: false # boolean. Force verbose output. Default: false.
#quiet: false # boolean. Force quiet output. Default: false.
:::moniker-end
:::moniker range="=azure-pipelines-2019.1"
# Archive files v2
# Compress files into .7z, .tar.gz, or .zip.
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)' # string. Required. Root folder or file to archive. Default: $(Build.BinariesDirectory).
#includeRootFolder: true # boolean. Prepend root folder name to archive paths. Default: true.
# Archive
archiveType: 'zip' # 'zip' | '7z' | 'tar' | 'wim'. Required. Archive type. Default: zip.
#tarCompression: 'gz' # 'gz' | 'bz2' | 'xz' | 'none'. Optional. Use when archiveType = tar. Tar compression. Default: gz.
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' # string. Required. Archive file to create. Default: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip.
#replaceExistingArchive: true # boolean. Replace existing archive. Default: true.
#verbose: false # boolean. Force verbose output. Default: false.
#quiet: false # boolean. Force quiet output. Default: false.
:::moniker-end
:::moniker range="=azure-pipelines-2019"
# Archive Files v2
# Archive files using compression formats such as .7z, .rar, .tar.gz, and .zip.
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)' # string. Required. Root folder or file to archive. Default: $(Build.BinariesDirectory).
#includeRootFolder: true # boolean. Prepend root folder name to archive paths. Default: true.
# Archive
archiveType: 'zip' # 'zip' | '7z' | 'tar' | 'wim'. Required. Archive type. Default: zip.
#tarCompression: 'gz' # 'gz' | 'bz2' | 'xz' | 'none'. Optional. Use when archiveType = tar. Tar compression. Default: gz.
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' # string. Required. Archive file to create. Default: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip.
#replaceExistingArchive: true # boolean. Replace existing archive. Default: true.
:::moniker-end
:::moniker range="<=azure-pipelines"
rootFolderOrFile
- Root folder or file to archive
string
. Required. Default value: $(Build.BinariesDirectory)
.
Name of the root folder or the file path to files to add to the archive. For folders, everything in the named folder is added to the archive.
:::moniker-end
:::moniker range="<=azure-pipelines"
includeRootFolder
- Prepend root folder name to archive paths
boolean
. Default value: true
.
Prepends the root folder name to file paths in the archive. Otherwise, all file paths will start one level lower.
For example, if the root folder is: /home/user/output/classes/
and the file path: com/acme/Main.class
. The resulting archive will contain: classes/com/acme/Main.class
. Otherwise, the resulting archive will contain: com/acme/Main.class
.
:::moniker-end
:::moniker range="<=azure-pipelines"
archiveType
- Archive type
string
. Required. Allowed values: zip
, 7z
, tar
, wim
. Default value: zip
.
Specifies a compression format. Valid formats include:
zip
- Default. Choose this format for all zip compatible types such as .zip, .jar, .war, .ear7z
- 7-Zip format, (.7z)tar
- tar format, use for compressed tars including .tar.gz, .tar.bz2, .tar.xzwim
- wim format, .wim
Example, to create an archive named foo.jar
:
- Select compression format
zip
- Specify the name of the archive file to create:
foo.jar
:::moniker-end
:::moniker range=">=azure-pipelines-2022"
sevenZipCompression
- 7z compression
string
. Optional. Use when archiveType = 7z
. Allowed values: ultra
, maximum
, normal
, fast
, fastest
, none
. Default value: normal
.
Set compression level or None
to create an uncompressed .7z file.
:::moniker-end
:::moniker range=">=azure-pipelines-2020 <=azure-pipelines-2020.1"
sevenZipCompression
- 7z compression
string
. Optional. Use when archiveType = 7z
. Allowed values: ultra
, maximum
, normal
, fast
, fastest
, none
. Default value: 5
.
Set a compression format or None
to create an uncompressed .7z file.
:::moniker-end
:::moniker range="<=azure-pipelines"
tarCompression
- Tar compression
string
. Optional. Use when archiveType = tar
. Allowed values: gz
, bz2
, xz
, none
. Default value: gz
.
Set a compression format or choose None
to create an uncompressed .tar file.
gz
- Default format for gzip compression (.tar.gz, .tar.tgz, .taz)bz2
- bzip2 compression (.tar.bz2, .tz2, .tbz2)xz
- xz compression (.tar.xz, .txz)
:::moniker-end
:::moniker range="<=azure-pipelines"
archiveFile
- Archive file to create
string
. Required. Default value: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
.
Specify the name of the archive file to create. For example, to create foo.tgz
:
- Set archive type:
tar
- Set tar compression:
gz
:::moniker-end
:::moniker range="<=azure-pipelines"
replaceExistingArchive
- Replace existing archive
boolean
. Default value: true
.
By default, overwrites an existing archive. Otherwise, when set to false
, uncompressed tar files are added to the existing archive.
Supported file formats that can be added to an existing archive:
zip
7z
tar
- Only uncompressedwim
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
verbose
- Force verbose output
boolean
. Default value: false
.
If set to true, forces tools to use verbose output. Overrides the 'quiet' setting.
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
quiet
- Force quiet output
boolean
. Default value: false
.
If set to true
, forces tools to use quiet output. The verbose
setting (or equivalent) can override this setting.
:::moniker-end
All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.
:::moniker range="<=azure-pipelines"
None.
:::moniker-end
Use this task to create an archive file from a source folder. Standard archive formats are supported including .zip, .jar, .war, .ear, .tar, .7z, and more.
:::moniker range=">=azure-pipelines-2022"
Requirement | Description |
---|---|
Pipeline types | YAML, Classic build, Classic release |
Runs on | Agent, DeploymentGroup |
Demands | None |
Capabilities | This task does not satisfy any demands for subsequent tasks in the job. |
Command restrictions | This task runs using the following command restrictions: restricted |
Settable variables | This task has permission to set the following variables: Setting variables is disabled |
Agent version | 2.182.1 or greater |
Task category | Utility |
:::moniker-end
:::moniker range="<=azure-pipelines-2020.1"
Requirement | Description |
---|---|
Pipeline types | YAML, Classic build, Classic release |
Runs on | Agent, DeploymentGroup |
Demands | None |
Capabilities | This task does not satisfy any demands for subsequent tasks in the job. |
Command restrictions | Any |
Settable variables | Any |
Agent version | All supported agent versions. |
Task category | Utility |
:::moniker-end