Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Formula output #931

Open
1 task done
lucasdittrichzup opened this issue May 20, 2021 · 0 comments
Open
1 task done

Formula output #931

lucasdittrichzup opened this issue May 20, 2021 · 0 comments
Assignees
Labels
📚 documentation Improvements or additions to documentation ✨ feature Suggest a new feature or enhancement to the Ritchie project
Projects
Milestone

Comments

@lucasdittrichzup
Copy link
Contributor

lucasdittrichzup commented May 20, 2021

What would you like to be added:

The idea of ​​formula outputs is to allow ritchie cli users to develop workflows in which it is possible to reuse the output of one formula as input to another.

With that we have, initially, that the output of the formulas will be recorded in a file called output.json inside the bin folder of the formula. In addition, we have the following definitions:

:: > initial marker
rit-output > log identifier for rit outputs
[space] > separator between identifier and variable
= > separator between variable name and variable value

NodeJS example:

console.log("::rit-output database=postgres")

We also defined that, from the formula output file, it will be possible to consume the values ​​recorded through the flags, as an example:

rit database init --db=::rit-output.repo_formula.database

Where:

--db > formula input used as a flag
= > separator of the flag and the value passed
:: > initial marker
rit-output > log identifier for rit outputs
. > is the separator of the identifier, formula path and variable
repo > repository where the formula is located (local-default, for example)
formula > formula itself without the rit command separated by an underscore (scaffold_kotlin, for example)
database > key inside the "output.json" file that you want to use

P.S .: For this first delivery, only one output per line will be accepted:

console.log("::rit-output database=postgres")
console.log("::rit-output host=localhost")
console.log("::rit-output port=5432")

Why is this needed:

To allow the output of formulas and the reuse in the development of workflows

  • Check this box if this issue needs a documentation update
@lucasdittrichzup lucasdittrichzup added 📚 documentation Improvements or additions to documentation ✨ feature Suggest a new feature or enhancement to the Ritchie project labels May 20, 2021
@lucasdittrichzup lucasdittrichzup added this to the 3.0.0 milestone May 20, 2021
@lucasdittrichzup lucasdittrichzup self-assigned this May 20, 2021
@GuillaumeFalourd GuillaumeFalourd added this to To do in Ritchie V3 Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📚 documentation Improvements or additions to documentation ✨ feature Suggest a new feature or enhancement to the Ritchie project
Projects
Development

No branches or pull requests

1 participant