1.0.0-canary.1 • Published 1 year ago

lavoretto v1.0.0-canary.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

lavoretto

CI workflow npm version Snyk Vulnerabilities for npm package Conventional Commits

Keep your subworkflows out of your workflows, so you can reuse them.

lavorétto (Italian for "work of little importance or of little effort") is a tiny tool useful when working with Google Cloud Platform Workflows. Here is how it works:

  1. Write your workflows YAML files without including any subworkflow in them.
  2. Write your subworkflows in their own directory (e.g. src/subworkflows), each subworkflow in its own separate file.
  3. Tell lavoretto which workflow you want to build, and where to get the subworkflows.

Installation

npm install --save-dev lavoretto

Usage

Build a single workflow:

lavoretto \
  -i path/to/your/workflow-file \
  --subworkflows path/to/your/subworkflows-directory

Build all workflows found in a (possibly nested) directory:

lavoretto \
  -i path/to/your/workflows-directory \
  --subworkflows path/to/your/subworkflows-directory

Options

OptionDefaultExplanation
inputsrc/workflowsWorkflow file/directory to build.
subworkflowssrc/subworkflowsSubworkflows directory.
outdirdistDirectory where to put the generated workflows.
headertrueWhether to include a comment at the top of each generated workflow. Use --no-header if you don't want it.
footerfalseWhether to include a comment at the bottom of each generated workflow.

See a few more examples in scripts.

Troubleshoot

This tool uses debug for its logs. You can set the environment variable DEBUG=lavoretto:* to troubleshoot this tool.

Useful links