Context State
Upon flow execution each action handler gets access to shared context.
EJS template can be used inside options to pass values from shared context. Please refer to plugin documentation if this feature supported and what options are required.
Example:
1
version: 1.0.0
2
pipeline:
3
plugin:
4
# Pass "something" from "ctx"
5
contextValue: <%- ctx.something %>
6
# Pass "password" from "secrets"
7
secretValue: <%- secrets.password %>
Copied!
Available actions:
  • ctx - assign values to "ctx"
  • secret - assign values to "secret"
  • summary - report in the end of fbl execution

Action Handler: Context Values Assignment

Assign non-secret values to context ctx field or its child properties by path. General use case: register shared non-sensitive options that later will be used by actions.
ID: com.fireblink.fbl.context.values
Aliases:
  • fbl.context.values
  • context.values
  • context
  • ctx
Example 1: Assign values to context root directly:
1
ctx:
2
# assign to "ctx" directly
3
'#x27;:
4
inline:
5
something: true
6
else: false
Copied!
Example 2: Assign values from file "vars.yml" to field "vars -> files":
1
ctx:
2
# create hierarchy of objects: "files" inside "vars" that is inside "ctx"
3
$.vars:
4
files:
5
- vars.yml
Copied!
Example 3: Assign values from file "vars.yml" after inline ones:
1
ctx:
2
'#x27;:
3
inline:
4
test: true
5
files:
6
- vars.yml
7
# specify that files have a priority over inline vars
8
# if not provided inline vars will have priority over files
9
priority: 'files'
Copied!
Example 4: Override instead of assigning
1
ctx:
2
'$.test':
3
inline:
4
test: true
5
# [optional] override everything tha tis inside "test" object with { test: true }
6
# use with caution
7
override: true
Copied!
Example 5: Push to array
1
ctx:
2
'$.test':
3
inline: 1
4
# [optional] override everything tha tis inside "test" object with { test: true }
5
# use with caution
6
override: true
7
# [required] if you want to push inline or value(s) from file(s) to targets array
8
push: true
9
# [optional] if enambled and value is array its child items will be pushed instead of array itself
10
children: false
Copied!
Example 6: Find files by mask:
1
ctx:
2
'#x27;:
3
files:
4
- vars/*.yml
Copied!

Action Handler: Secret Values Assignment

Same as above, but for secrets. All the options will me masked in report to prevent any security leakage.
ID: com.fireblink.fbl.secret.values
Aliases:
  • fbl.secret.values
  • secret.values
  • secrets
  • secret
Example 1: Assign values to secrets root directly:
1
secrets:
2
'#x27;:
3
inline:
4
something: true
5
else: false
Copied!
Example 2: Assign values from file "vars.yml" to field "vars -> files":
1
secrets:
2
$.vars:
3
files:
4
- vars.yml
Copied!
Example 3: Assign values from file "vars.yml" after inline ones:
1
secrets:
2
'.':
3
inline:
4
test: true
5
files:
6
- vars.yml
7
8
# [optional] specify that files have a priority over inline vars
9
# if not provided inline vars will have priority over files
10
priority: 'files'
Copied!
Example 4: Override instead of assigning
1
secrets:
2
'$.test':
3
inline:
4
test: true
5
# [optional] override everything tha tis inside "test" object with { test: true }
6
# use with caution
7
override: true
Copied!
Example 5: Push to array
1
secrets:
2
'$.test':
3
inline: 1
4
# [optional] override everything tha tis inside "test" object with { test: true }
5
# use with caution
6
override: true
7
# [required] if you want to push inline or value(s) from file(s) to target's array
8
push: true
9
# [optional] if enambled and value is array its child items will be pushed instead of array itself
10
children: false
Copied!
Example 6: Find files by mask:
1
secrets:
2
'#x27;:
3
files:
4
- vars/*.yml
Copied!

Action Handler: Summary

Add summary record. All summary records will be printed once the main flow ends.
ID: com.fireblink.fbl.context.summary
Aliases:
  • fbl.context.summary
  • context.summary
  • summary
Example:
1
summary:
2
# summary record title
3
title: Step Title
4
# summary record status
5
# statuses (ignoring case):
6
# - 'created', 'updated', 'passed', 'success', 'ok', 'yes' will be colored in green
7
# - 'deleted', 'failed', 'failure', 'error', 'no' - in red
8
# - 'ignored', 'skipped', 'none' - in yellow
9
# others will have default text color
10
status: Failed
11
# [optional] human readable duration (string)
12
duration: <%- $.duration(1000) %>
13
# [optional] additional data associated with record. Not presented in printed table.
14
payload: anything
Copied!
Last modified 1yr ago