Commit Graph

6 Commits (1138789f20f77cb5645ba19a59aaf9a1ed012cf1)

Author SHA1 Message Date
Justin Chadwell a3293cdaaa
Merge pull request #1720 from jedevc/bake-replace-func
Add `replace` function to bake stdlib
2 years ago
Justin Chadwell 5d33a3af22 bake: add replace func to stdlib
Signed-off-by: Justin Chadwell <me@jedevc.com>
2 years ago
Justin Chadwell 87f900ce77 chore: sort bake stdlib map
Signed-off-by: Justin Chadwell <me@jedevc.com>
2 years ago
Justin Chadwell 1613fde55c bake: allow interception to create derived contexts
This patch allows high level clients to define an EvalContext method
which can derive a new context given a block and the base parent
context.

This allows users of the package to intercept evaluation before it
begins, and define additional variables and functions that are bound to
a single block.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2 years ago
Justin Chadwell 691723f9f9 bake: add timestamp function
Terraform includes a timestamp function to get the current time. go-cty
has imported a number of the timestamp functions to it's standard
library, however, this was one was not included.

This patch simply pulls in the TimestampFunc from Terraform's
internal/lang/funcs/datetime.go to allow easily fetching the current
time in bake.

Signed-off-by: Justin Chadwell <me@jedevc.com>
3 years ago
Tonis Tiigi c5eb8f58b4 bake: new hclparser package
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
4 years ago