runas-core
Version:
The adhesive orchestrator
184 lines (138 loc) • 3.74 kB
Markdown
---
title: Recipe Configuration
layout: doc_page.html
order: 11
---
`runas.json` is the file which defines the general configuration of the recipe. It is placed at the root directory of the recipe.
The configuration recipe could be overwritten with others available methods to fill parameters values. See [parameters](./05-parameters.md) configuration.
This is the general configuration file (`runas.json`) of runas:
```json
{
"cmd" : "runas",
"params" : {
"plugins" : ["inquirer"]
},
"junitDir": "test-reports",
"junitRunasFile": "runas-junit.xml",
"stages": [
"core-install",
"core-check",
"check",
"config",
"run",
"prove",
"notify",
"emit"
],
"flowTypes": [
"normal",
"utils",
"internal"
]
}
```
Then the different methods to configure (recipes, flows, steps, ...) will just add or remove configuration over the existing configuration.
Example of a recipe:
```json
{
"cmd": "cells"
}
```
Command name, this command will be executed in a console when the recipe is globally installed.
Global parameters, applies to all [flows](./03-flows.md) and [steps](./02-steps.md). See [parameter](./05-parameters.md) for more information.
`junitDir` is the Folder where will save the `junit.xml` file.
`junitRunasFile` is a customized name of the `junit.xml` file.
These configurations are available when runas write a junit report.
```sh
$ runas --junitReport
$ runas -u
```
Default stages. See [stages](./04-stages.md) for more information.
If it is added a new stage, and will be just executed if the step has its implementation.
```json
{
"stages": [ "final" ]
}
```
After `notify` stage, customized `final` stage will be executed.
```javascript
final : function() {
this.logger.info("#magenta","notify","Recollect all execution information and notify");
}
```
See [flows](./03-flows.md) for more information.
Runas recipes has lazy install strategy for installation, this means that
See [implementations](./15-implementations.md) for more information.
Configuration has different options according to the scopes:
For all flows, steps and contexts
```json
{
"params": {
"param1": "value1"
}
}
```
Just for a flow and all its steps and contexts.
```json
{
"flows" : {
"flowName" : {
"params" : {
"param1": "value1"
}
}
}
}
```
Just for a step and all its contexts.
```json
{
"steps" : {
"stepName" : {
"params" : {
"param1": "value1"
}
}
}
}
```
Just for a step and a context.
```json
{
"steps" : {
"stepName" : {
"contextName" : {
"params" : {
"param1": "value1"
}
}
}
}
}
```
In a [step](./02-steps) all parameters are accessible with `this.params.param1`.
- **1** `.runas/runas.json` file in the current working directory where recipe is executed.
- **1.1** Step & Context configuration
- **1.2** Step configuration
- **1.3** Flow configuration
- **1.4** Global configuration
- **2** `runas.json` file of the recipe.
- **1.1** Step & Context configuration
- **1.2** Step configuration
- **1.3** Flow configuration
- **1.4** Global configuration
This is the priority order (from high to low), if a parameter is provided twice or more, with different values, then it will stay the value that is above in the list.