| Crates.io | nomadcfg |
| lib.rs | nomadcfg |
| version | 0.0.6 |
| created_at | 2023-05-28 13:06:04.415868+00 |
| updated_at | 2023-08-12 13:59:45.803685+00 |
| description | A CLI tool for defining HashiCorp Nomad job specs in jsonnet. |
| homepage | |
| repository | https://github.com/cloneable/nomadcfg |
| max_upload_size | |
| id | 876465 |
| size | 156,447 |
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.
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.
cargo install --locked nomadcfg
cargo install --git https://github.com/cloneable/nomadcfg
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"
}
}