Skip to content
Run a workflow defined in a YAML file
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE chore: update issue templates Mar 1, 2019
.idea feat: first take on types Mar 1, 2019
cmd/flowascode feat: apply text/template Mar 8, 2019
documentation feat: first take on types Mar 1, 2019
.gitignore feat: first take on types Mar 1, 2019
CODE_OF_CONDUCT.md chore: add license information Mar 6, 2019
LICENSE.md chore: add license information Mar 6, 2019
README.md chore: update readme Mar 8, 2019
flow_execute.go feat: apply text/template Mar 8, 2019
flow_from_reader.go
flow_from_reader_test.go feat: implement HasDefault Mar 1, 2019
flow_from_yaml.go chore: add license information Mar 6, 2019
flow_from_yaml_test.go
flow_get_default.go chore: add license information Mar 6, 2019
flow_get_default_test.go feat: implement GetDefault Mar 1, 2019
flow_get_env_with_variables.go feat: apply text/template Mar 8, 2019
flow_get_step.go chore: add license information Mar 6, 2019
flow_has_default.go
flow_has_default_test.go feat: implement HasDefault Mar 1, 2019
flow_has_step.go chore: add license information Mar 6, 2019
flow_string.go chore: add license information Mar 6, 2019
flow_string_test.go feat: implement GetDefault Mar 1, 2019
flow_validate_step.go chore: add license information Mar 6, 2019
flow_validate_step_test.go refactor: splt validation function Mar 5, 2019
go.mod feat: add support for gops Mar 6, 2019
go.sum feat: add support for gops Mar 6, 2019
step_apply_text_template.go feat: apply text/template Mar 8, 2019
step_execute.go chore: add license information Mar 6, 2019
step_execute_other.go chore: add license information Mar 6, 2019
step_execute_test.go feat: add step functions Mar 4, 2019
step_execute_windows.go chore: add license information Mar 6, 2019
step_has_failure.go chore: add license information Mar 6, 2019
step_has_failure_test.go feat: add step functions Mar 4, 2019
step_has_success.go chore: add license information Mar 6, 2019
step_has_success_test.go feat: add step functions Mar 4, 2019
step_string.go
step_string_test.go feat: implement GetDefault Mar 1, 2019
types.go chore: add license information Mar 6, 2019

README.md

flow as code

create a flow as code (in YAML format) is a utility that executes workflows based on a yaml configuration you pass in.

Sample flow document: documentation/example-flow.yaml

Remarks: the example document still communicates features not yet implemented

Usage

flow-as-code --flow <flow.yaml> --name <test> [--debug]


--flow      path to the file containing the flow definition
--name      name of the step to execute (entrypoint)
--log-level set log level (one of debug, info, warn or error[default])

Configuration

The configuration is done using a YAML document. It has the following structure:

---

shell:       string      # binary in path or complete path to
                         # shell that will be called

name:        string      # just give the thing a name
description: string      # provide a more in depth description

steps:       list        # provide a list of steps

A step contains the following properties:

name:        string      # just give the thing a name
on_success:  list        # follow up with steps on success (descendant)
on failure:  list        # follow up with steps on failure (descendant)
script:      list        # list of commands to execute

A descendant contains the following properties:

name:        string      # must match the name of a step
variables:   map         # A dictionary (map) of variables passed to
                         # the step to be executed

Variable handling

The variables get special treatment as $VAR gets replaced by the environment variable named VAR.

Also you can access the flow and the current step like this:

{{.Flow.Name}}        # Name
{{.Flow.Shell}}       # Shell
{{.Flow.Description}} # Description
{{.Flow.Steps}}       # All steps

{{.Step.Name}}        # Name
{{.Step.Script}}      # Commands to be executed
{{.Step.OnSuccess}}   # List of descendants on success
{{.Step.OnFailure}}   # List of descendants on failure

History

Version Description
0.3.0 - support for templated variables
- add --log-level parameter
- make use of dependabot
0.2.0 - support to pass variables to descendants
- license and contributor information
- integrated gops
0.1.0 initial minimal version
You can’t perform that action at this time.