Travel-Agent relays on ego as its template engine to build the pipeline configuration for concourse.
See pipeline example here
Ego uses tags to embed golang code.
There are 2 tags available:
- Execution tag
<% %>
- Execution and output tag
<%= %>
Code gets executed but the result will not be included in the pipeline configuration file.
<% if { %>
<% } %>
Code gets executed and the output gets included in the pipeline configuration file.
<%= env.Name %>
<% if CONDITION { %>
<% } else { %>
<% } %>
<% for _, VAR_NAME := range ARRAY { %>
<% } %>
Travel-agent allows you to retrive data from the travel-agent.yml config file through helpers.
<%! func ManifestTmpl(w io.Writer, config Config) error %>
<%% import . "github.com/compozed/travel-agent/models" %%>
Retuns list of all the available environments.
Returns features available for an specific environment
<% if env.HasFeature("check_for_existence") { %>
'<%= env.Feature("grab_value") %>'
Pulls data for an specific environment.
name: <PIPELINE_NAME>
envs:
- name: <ENV_NAME>
features:
grab_value: foo