The following are a list of examples. This list is autogenerated using togomak --disable-concurrency at togomak.
ANSI colors are provided as functions and variables which can be used to created colored terminal output platform agnostically.
Make stage run conditionally based on if argument.
Includes the most used features of togomak v1, previously on togomak v1
README.md
This example provides a custom entrypoint for the docker container when natively calling them.
Run scripts in docker containers natively, from togomak.
This example deals with mounting volumes and using the ubuntu:latest
docker container.
Derive environment variables from the host environment, and
also pass them to stages using the env {} sub block.
Uses stage args argument to perform a simple ls -al
This example uses a for_each on a stage using a map.
Each item in the map specified as the argument to for_each
will be iterated over and assigned each.key and each.value.
This is essentially the same example as for_each, but using
this on module on a nested set array.
In addition, this module also uses a remote github repository
source for its module.
Demonstrates the use of default functions and string interpolation
in stage scripts. This example deals with the env() helper function.
Uses the data.git provider to clone a git repository and
read contents of specific files to memory.
same example as git but retrieves file from a specific tag.
Runs a stage before or after the execution of a stage using
pre_hook and post_hook. post_hook will run regardless of the stage execution statuses,
which can be useful to check if a step failed or not.
This example imports a subfolder and a remote repository togomak pipeline code and merges the caller pipeline with its contents to create a flattened pipeline.
Uses Togomak lifecycles to classify stages using phases.
Consider reading Lifecycle Usage
for a detailed explanation.
Uses a simple local block in a stage.
Note Consider using
moduleinstead.
Invokes a stage with parameters as a macro, which can be reused, imported or customized with parameters.
This example loads a local module from a subfolder
and passed it local.* values as inputs.
This example is a module which does addition.
A simple module from a local directory.
Runs a step at the beginning, or the end of the pipeline, before and after all the stages, modules complete.
Deprecated, use variable {} instead.
Prompt data provider requests information from the user
before the pipeline starts. This, however is done directly by
the variable {} block, accessible through the var.<name>
attribute.
This example has a recursive, nested macro invocation.
Example on using Terraform data source blocks, using the hashicorp/random
provider to create a random_pet name, and use them directly in your
togomak pipeline, illustrating similar use cases where pipelines need
to run against IP addresses of Terraform provisioned resources.