Working with Flows

Working with Flows #

Instead of calling each command of furo again and again, you can set up a flow which chains them together.

The config file from the init haves a preconfigured default flow.

chain of furo commands

graph LR deprecated --> muSpec2Spec --> checkImports --> genMessageProtos --> genServiceProtos

How to define a flow #

The single commands of furo can be configured as a chain of commands.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
flows:
  default: 
    - deprecated
    - muSpec2Spec
    - clean_dist
    - checkImports
    - genMessageProtos
    - genServiceProtos
  generate:
    - buf_generate
    - gen_transcoder
    - genEsModule

Execute a flow #

If you have a flow with the name default* you can execute it, by just calling furo without any options. The same flow can be started with furo run default.

To start the flow with the name “generate”, type in furo run generate.

Note: At the moment the flow runner jumps to the next command on any error of a sub command. This behavior may change in the future.

How to define a custom command #

You can add custom commands which can be integrated in a flow. A custom command is a link to an executable, this can be a shell script or a command which is installed on your system. Make sure that you enter the correct paths.

Add your commands in the commands section of the config.

1
2
3
4
5
commands: #camelCase is not allowed, command scripts can only be executed from a flow
  gen_transcoder: "./scripts/gprcgateway/generate.sh" # shell script to generate a grpc gateway mux.
  buf_generate: "./scripts/buf_generate.sh" # call buf with the configured options.
  buf_braking: "./scripts/buf_breaking.sh"
  clean_dist : "./scripts/cleanUpDist.sh" # Deletes the content of the dist folder
Attention: You can not use camelCase notation for the name of a custom command.

The commands that you have defined, can be used in any flow configuration.

graph LR genMessageProtos --> genServiceProtos --> buf_generate --> gen_transcoder --> genEsModule