This repository contains a plugin for running archive functionalities like zip/tar/gzip.
The plugin plugins/archive
is available for the following architectures:
OS | Tag |
---|---|
latest | latest |
linux/amd64 | linux-amd64 |
linux/arm64 | linux-arm64 |
windows/amd64 | windows-amd64 |
Parameter | Comments |
---|---|
source required |
source path |
target required |
target path |
format required |
zip/tar/gzip |
action required |
archive or extract |
tarcompress optional |
true or false (compression for tar) |
glob optional |
Ant style pattern of files to extract/archive from the zip/tar. Leave empty to include all files and directories. |
exclude optional |
Ant style pattern of files to exclude from the zip/tar. |
overwrite optional |
true of false |
Build the plugin image:
./scripts/build.sh
docker run \
-e PLUGIN_SOURCE=/data/source \
-e PLUGIN_TARGET=/data/backup/archive.zip \
-e PLUGIN_FORMAT=zip \
-e PLUGIN_ACTION=archive \
-e PLUGIN_OVERWRITE=true \
-e PLUGIN_EXCLUDE="*.log" \
-e PLUGIN_GLOB="**/*.txt" \
plugins/archive
docker run \
-e PLUGIN_SOURCE=/data/backup/archive.zip \
-e PLUGIN_TARGET=/data/source \
-e PLUGIN_FORMAT=zip \
-e PLUGIN_ACTION=extract \
-e PLUGIN_OVERWRITE=true \
-e PLUGIN_GLOB="**/*.txt" \
plugins/archive
docker run \
-e PLUGIN_SOURCE=/data/source \
-e PLUGIN_TARGET=/data/backup/archive.tar \
-e PLUGIN_FORMAT=tar \
-e PLUGIN_ACTION=archive \
-e PLUGIN_OVERWRITE=true \
-e PLUGIN_EXCLUDE="*.log" \
-e PLUGIN_GLOB="**/*.txt" \
-e PLUGIN_TARCOMPRESS=false \
plugins/archive
docker run \
-e PLUGIN_SOURCE=/data/backup/archive.tar \
-e PLUGIN_TARGET=/data/source \
-e PLUGIN_FORMAT=tar \
-e PLUGIN_ACTION=extract \
-e PLUGIN_OVERWRITE=true \
-e PLUGIN_GLOB="**/*.txt" \
plugins/archive
docker run \
-e PLUGIN_SOURCE=/data/source \
-e PLUGIN_TARGET=/data/backup/archive.tar.gz \
-e PLUGIN_FORMAT=tar \
-e PLUGIN_ACTION=archive \
-e PLUGIN_OVERWRITE=true \
-e PLUGIN_TARCOMPRESS=true \
-e PLUGIN_EXCLUDE="*.log" \
-e PLUGIN_GLOB="**/*.txt" \
plugins/archive
# Plugin YAML
- step:
type: Plugin
name: archive-plugin-arm64
identifier: archive-plugin-arm64
spec:
connectorRef: harness-docker-connector
image: plugins/archive:linux-arm64
settings:
source: path/to/source
target: targetpath
format: zip/tar/gzip
action: archive or extract
glob: Some ant style pattern to include those files
exclude: Some ant style pattern to exclude those files
overwrite: true/false