Releases: gruntwork-io/boilerplate
v0.3.6-alpha.1
DO NOT USE: integration testing release
v0.3.5: jsonnet support
#72: We now support rendering jsonnet files as an alternative to go templating. See the updated README for more details.
v0.3.4: skip_files for conditionally skipping files
#71: This release introduces skip_files
in the configuration, which can be used to conditionally skip files in the template folder. Refer to the relevant section in the README for more info.
v0.3.3: Add `toYaml` function
This release adds a new helper function called toYaml
that will render a given input variable to a YAML string. This is similar to the toJson
sprig function.
v0.3.2: Support rendering variable inputs to json
This release fixes an issue with using toJson
and related sprig functions within Boilerplate templates. It's now possible to read variable inputs from Boilerplate YML files and render those to JSON.
See related PR.
v0.3.1: Add partials feature
Adds the new partials
feature for better template reuse.
v0.3.0
v0.2.26
v0.2.25
v0.2.24
#49: This integrates sprig into boilerplate
so that the sprig functions are available in the templates rendered by boilerplate. Note that there are a few
boilerplatefunctions that overlap with
sprig. Each of these are now documented in the README. As such, starting this release those helpers are deprecated, and will be replaced with the
sprig` versions in a future release. Please review the deprecation notes in the README, pasted below for convenience.
Deprecated helpers
These helpers are deprecated. They are currently available for backwards compatibility, but may be removed in future
versions. Please use the alternative supported forms listed in the description.
downcase STRING
: Same functionality as lower in sprig.upcase STRING
: Same functionality as upper in sprig.capitalize STRING
: Same functionality as title in sprig.snakeCase STRING
: Same functionality as snakecase in sprig.camelCase STRING
: Same functionality as camelcase in sprig.
The following functions overlap with sprig, but have different functionality. There is an equivalent function listed
above under a different name. These point to the boilerplate implementations for backwards compatibility. Please migrate
to using the new naming scheme, as they will be updated to use the sprig versions in future versions of boilerplate.
round
: In boilerplate,round
returns the integer form as opposed to float. E.g{{ round 123.5555 }}
will return
124
. The following supported alternative functions are available:roundFloat
: The sprig version of round, which supports
arbitrary decimal rounding. E.g{{ round 123.5555 3 }}
returns123.556
. Note that{{ round 123.5555 0 }}
returns124.0
.roundInt
: Another name for the boilerplate version ofround
. Use this if you would like to keep old behavior.
ceil
andfloor
: In boilerplate,ceil
andfloor
return integer forms as opposed to floats. E.g{{ ceil 1.1 }}
returns2
, as opposed to2.0
in the sprig version. The following supported alternative functions are
available:env
: In boilerplate,env
supports returning a default value if the environment variable is not defined. The
following supported alternative functions are available:readEnv
: The sprig version of env. This always returns empty
string if the environment variable is undefined.envWithDefault
: Another name for the boilerplate version ofenv
. Use this if you would like to keep old
behavior.
keys
: In boilerplate,keys
returns the keys of the map in sorted order. The following supported alternative
functions are available:keysUnordered
: The sprig version of keys. This returns the
list of keys in no particular order, and there is no guarantee that the order of the returned list is consistent.keysSorted
: Another name for the boilerplate version ofkeys
. Use this if you would like to keep old
behavior.
replace
: In boilerplate,replace
only replaces the first occurrence in the string, as opposed to all occurrences
as in sprig. The following supported alternative functions are available:replaceAll
: The sprig version of replace.replaceOne
: Another name for the boilerplate version ofreplace
. Use this if you would like to keep old
behavior.
slice
: In boilerplate,slice
returns a list of numbers in the provided range. E.g{{ slice 1 5 1 }}
returns
the list[1, 2, 3, 4]
. The following supported alternative functions are available:sliceList
: The sprig version of slice, which returns the
slice of the given list. E.g{{ slice list n m }}
returnslist[n:m]
.numRange
: Another name for the boilerplate version ofslice
. Use this if you would like to keep old
behavior.
trimPrefix
andtrimSuffix
: In boilerplate,trimPrefix
andtrimSuffix
takes the base string first. E.g
{{ trimPrefix hello-world hello }}
returns-world
. The following supported alternative functions are available:trimPrefixSprig
andtrimSuffixSprig
: The sprig version of
trimPrefix and
trimSuffix. Unlike the boilerplate version, this takes the trim text first so that you can pipeline the trimming. E.g{{ "hello-world" | trimPrefix "hello" }}
returns{{ -world }}
.trimPrefixBoilerplate
andtrimSuffixBoilerplate
: Another name for the boilerplate versions oftrimPrefix
andtrimSuffix
. Use this if you would like to keep old behavior.