Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
/ nomadcfg Public archive

A CLI tool for defining Hashicorp Nomad job specs in jsonnet.

License

Notifications You must be signed in to change notification settings

cloneable/nomadcfg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nomadcfg

A CLI tool for defining HashiCorp Nomad job specs in jsonnet. Unofficial. Not related to HashiCorp.

Very experimental! The code is still PoC quality. Don't use yet.

About

The official Nomad CLI tool nomad is able to ingest job specifications in JSON instead of HCL, which allows other configuration languages to produce such job specs. nomadcfg is an attempt to use jsonnet for this. It's similar to kubecfg for Kubernetes.

Installation

cargo install --locked nomadcfg
cargo install --git https://github.com/cloneable/nomadcfg

Usage

myjob.jsonnet:

local job(name, namespace='default') = {
  type: 'service',
  id: self.name,
  name: name,
  namespace: namespace,
  // ...
};

{
  job: job('myjob', 'biz') {
    // job definition
  }

  // helper definitions (ignored by nomadcfg)
}
nomadcfg print myjob.jsonnet
{
  "Job": {
    "ID": "myjob",
    "Name": "myjob",
    "Namespace": "biz",
    "Type": "service"
  }
}

About

A CLI tool for defining Hashicorp Nomad job specs in jsonnet.

Topics

Resources

License

Stars

Watchers

Forks