Hello World formula

You will find in this section how to run a “hello-world” formula..

Hello World

To do so, you can use the rit add repo command, or run the command line below:

rit add repo --provider=Github --name=demo --repoUrl=https://github.com/ZupIT/ritchie-formulas-demo --priority=1

Now that you have added the demo repository and check the details of the formula, you can execute this tutorial commands.

Premisse: Check the formula’s details

To get details about a formula, you can execute the command using with the --help flag:.

rit demo hello-world --help

It will return all the flags available for the command execution.

On Ritchie, you have 6 possibilities to run a formula through these flags:

  1. Via Prompt
  2. Via Prompt e Docker
  3. Via Input Flags
  4. Via Input Flags e Docker
  5. Via Stdin
  6. Via Stdin e Docker

To do so, type the following commands lines:

Case 1: With Prompt

rit demo hello-world

Select an option for each input parameter and see how the magic works:

This is the default command line execution, that runs the formula locally using prompt to inform the input parameters.

Case 2: With Prompt and Docker

You can run the same command using the –docker flag pto execute it remotely (on a container), but still using prompt to inform the inputs parameters:

rit demo hello-world --docker

Case 3: With Input Flags

You can also run the command informing the inputs through flags (you can know which flags are available using the --help flag when executing a command). This way, inputs parameters are informed directly with the command line.

rit demo hello-world --rit_input_text=Dennis --rit_input_boolean=true --rit_input_list=everything --rit_input_password=Ritchie

Case 4: With Input flags and Docker

When you combine both input flags and the --docker flag, it is possible to run a command remotely (on a container) with the input parameters directly informed on the command line:

rit demo hello-world --rit_input_text=Dennis --rit_input_boolean=true --rit_input_list=everything --rit_input_password=Ritchie --docker

Case 5: With Stdin

You can also run the command with the --stdin (Standard input) flag. This way, inputs parameters are also informed directly with the command line.

echo '{"rit_input_text":"Dennis", "rit_input_boolean":"true", "rit_input_list":"everything", "rit_input_password":"Ritchie"}' | rit demo hello-world --stdin

Case 6: With Stdin and Docker

When you combine both –stdin and –docker flags, it is also possible to run a command remotely (on a container) with the input parameters directly informed on the command line:

echo '{"rit_input_text":"Dennis", "rit_input_boolean":"true", "rit_input_list":"everything", "rit_input_password":"Ritchie"}' | rit demo hello-world --stdin --docker

In this section, you saw how to run formulas on Ritchie. To keep learning:

  • Check which formulas you can run using the following command:

  • See how to create formula .


Last modified June 15, 2021: fix: change all image links (9612361c)