Zip Path Contents

Action ID: roadiehq:utils:zip
NPM Package:

@roadiehq/scaffolder-backend-module-utils

Description

Zips the content of the path

Input Schema

PropertyTypeDescriptionRequired
pathstring-
outputPathstring-

Output Schema

PropertyTypeDescriptionRequired
outputPathstring-

Usage Examples

Zip Kubernetes manifests into a distributable archive

This example zips a service’s Kubernetes manifests into a versioned archive placed under dist. Use it to package deployable configuration generated during scaffolding.

Copy
steps:
  - id: fetch-base
    action: fetch:template
    input:
      url: ./skeleton

  - id: zip-manifests
    action: roadiehq:utils:zip
    input:
      path: ./k8s/manifests
      outputPath: ./dist/${{ parameters.serviceName }}-manifests-${{ parameters.version }}.zip

  - id: log-zip-path
    action: debug:log
    input:
      message: Created archive at ${{ steps.zip-manifests.output.outputPath }}

Zip the entire generated source tree for distribution

This example zips the whole workspace after fetching a template and writes the archive to an artifacts directory. Use it when you need a single archive of the generated project.

Copy
steps:
  - id: fetch-template
    action: fetch:template
    input:
      url: ./templates/service

  - id: zip-source
    action: roadiehq:utils:zip
    input:
      path: .
      outputPath: ./artifacts/${{ parameters.name }}-starter.zip

  - id: log
    action: debug:log
    input:
      message: Source archive ready at ${{ steps.zip-source.output.outputPath }}