srevinsaju / togomak

A declarative pipeline orchestrator with the magic of HCL as a configuration language, inspired from Terraform's architecture.
https://togomak.srev.in
Mozilla Public License 2.0
145 stars 5 forks source link
cicd concurrency continuous-delivery continuous-integration go golang hacktoberfest hcl orchestration terraform

togomak

GitHub go.mod Go version (branch) codecov

Screenshot of togomak build pipeline for togomak using togomak, dogfooding?

togomak is a declarative pipeline orchestration tool, powered by HashiCorp Configuration Language (HCL) built on top of Terraform's architecture and features. It supports modules, custom HCL expressions.

togomak {
  version = 2
}
stage "hello" {
  script = "echo hello world"
}
$ togomak
0000 • togomak (version=dev)
0000 • [stage.hello]  hello world
0000 • took 2ms

Contents

Installation

Download a compatible binary for your operating system and architecture from Releases. The v2.x tag has the latest, bleeding edge features which are more relevant.

Or, using go:

go install github.com/srevinsaju/togomak/v2@latest

Building and installing from source

  1. Clone the repository, https://github.com/srevinsaju/togomak
  2. cd cmd/togomak
    go build .
    ./togomak

Docker containers

Consider using the ghcr.io/srevinsaju/togomak:v2alpine image. Other flavors are available are available here.

Getting Started

togomak {
  version = 2
}

locals {
  validate = toset(["vet", "fmt", "test"])
}

variable "service" {
  type = string
  description = "Name of the service"
}

stage "build" {
  depends_on = [stage.validate]
  script = "echo Running go build ... for ${var.service}"
  post_hook {
    stage {
      script = "echo send slack message, build completed for ${upper(var.service)} with status: ${this.status}"
    }
  }
}

stage "validate" {
  for_each = local.validate
  script = "echo Running go ${each.value} ... for ${var.service}"
}

Screenshot of the above execution

Installation

Check out the releases page for the v2.0.0-alpha.* release binaries, and other pre-built packages for your desired platform.

Building from Source

cd cmd/togomak 
go build

Building using togomak (what!)

togomak

Features

In togomak, a stage is a single independent task, and a module is a group of stages. Here is a non-exhaustive list of features. See the work in progress documentation or examples for a list of examples. These examples also run as part of an integration test, using tests/togomak.hcl.

And don't forget to format your CICD files with togomak fmt.

Contributing

Contributions are welcome, and encouraged. Please check out the contributing guide for more information.

License

togomak is licensed under the MPL License v2.0