pass custom optional arguments from the cli permalink

You can pass your own arguments to your pipelines from the cli without writing any code. You can decide per pipeline what style of arguments work better for that specific pipeline, for example key-value pairs, or a single string, or boolean switches.

See context parsers for more information on how to pass your own arguments to a pipeline and how to use those runtime values in the pipeline.

boolean switches permalink

# ./defaultarg.yaml
#
# To execute this pipeline, shell something like:
# pypyr defaultarg arb
#
# And to run with isRetry
# pypyr defaultarg isRetry
#
# And to run with isCI:
# pypyr defaultarg isCI
#
# And to run with both Retry and CI:
# pypyr defaultarg isCI isRetry
context_parser: pypyr.parser.keys
steps:
  - name: pypyr.steps.default
    in:
      defaults:
        isCI: False
        isRetry: False
  - name: pypyr.steps.echo
    run: '{isRetry}'
    in:
      echoMe: you'll only see me if IsRetry is True
  - name: pypyr.steps.echo
    run: '{isCI}'
    in:
      echoMe: this only runs in the CI environment, not on dev
  - name: pypyr.steps.echo
    in:
      echoMe: done!

see also

last updated on .