Locals

If you plan to use a specific variable several times in your pipeline, you may use a locals {} block.

A simple usage may be shown below

locals {
    var1 = 1
    var2 = "hello"
    var3 = {
        apple = 2
        orange = 3
    }
}

When referring to them in stages, use local.<variable_name>, for example:

togomak {
  version = 2
}
 
locals {
  nerv_headquarters = "Tokyo-3"
  pilot_name        = "Shinji"
}
 
stage "eva01_synchronization" {
  name   = "Eva-01 Synchronization Tests"
  script = "echo ${local.pilot_name} is now running synchronization tests at ${local.nerv_headquarters}"
}