drone-archive

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

archive-plugin

Synopsis

This repository contains a plugin for running archive functionalities like zip/tar/gzip.

Plugin Image

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

Parameters

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

Building

Build the plugin image:

./scripts/build.sh

Examples

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
tar
zip

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL