-
-
Notifications
You must be signed in to change notification settings - Fork 747
/
default.j2
executable file
·52 lines (48 loc) · 1.94 KB
/
default.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{%- macro serialize(iter, prefix='') -%}
{% for key, value in iter -%}
{{ prefix }}{{ key }} : {% if value is mapping -%}
{{ '\n' + serialize(six.iteritems(value), prefix+' ') }}
{%- elif value is string and (value | trim).split('\n') | length > 1 %}
{{ '\n' + prefix + ' ' + value | trim }}
{% else -%}
{{ value | trim }}
{% endif %}
{% endfor %}
{%- endmacro %}
Action {{ execution.action.ref }} completed.
status : {{ execution.status }}
execution: {{ execution.id }}
{% if execution.web_url -%}
web_url: {{ execution.web_url }}
{% endif %}
{% if execution.elapsed_seconds -%}
Took {{execution.elapsed_seconds | to_human_time_from_seconds}} to complete.
{% endif %}
{% if execution.result -%}
result :
--------
{% if execution.runner['name'] in ('http-request',) -%}
{# TODO: is there are conceptual difference between it and default? #}
{{ serialize(six.iteritems(execution.result)) }}
{% elif execution.runner['name'] in ('python-script', 'windows-cmd', 'windows-script',) -%}
{{ serialize(six.iteritems(execution.result)
| selectattr('0', 'in', ['result', 'stdout', 'stderr', 'exit_code'])
| selectattr('1')) }}
{% elif execution.runner['name'] in ('remote-shell-cmd','remote-shell-script',) -%}
{% for key, value in six.iteritems(execution.result) -%}
{{key}} : {{ '\n' + serialize(six.iteritems(value)
| selectattr('0', 'in', ['stdout', 'stderr', 'return_code', 'error'])
| selectattr('1'), ' ') }}
{% endfor %}
{% elif execution.runner['name'] in ('local-shell-cmd','local-shell-script') -%}
{{ serialize(six.iteritems(execution.result)
| selectattr('0', 'in', ['stdout', 'stderr', 'return_code', 'error'])
| selectattr('1')) }}
{% else -%}
{% if execution.result is mapping -%}
{{ serialize(six.iteritems(execution.result)) }}
{% else -%}
{{ execution.result }}
{% endif %}
{% endif %}
{% endif %}