Project

gadabout

0.01
No commit activity in last 3 years
No release in over 3 years
A swiss army knife gem for the Hashicorp Nomad job scheduler
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 10.4.2

Runtime

~> 0.19
 Project Readme

Gadabout Build Status

A Swiss army knife gem for the Hashicorp Nomad job scheduler.

$ gem install gadabout

Gadabout::Client

A simple API client for Nomad.

require 'gadabout'

client = Gadabout::Client.new

client.agent_info

client.jobs

client.drain("<ID>", true)

Gadabout::DSL

A DSL for defining Nomad Jobs that compiles to JSON.

require 'gadabout'

job do
  name "example"
  region "global"
  type "batch"
  meta "environment", "production"
  priority 50
  datacenters "dc1", "dc2"

  task_group do
    name "cache"
    count 1

    task do
      name "redis"
      driver "docker"
      user "redis"

      config "image", "redis:latest"
      config "port_map", [
        {
          "db": 6379
        }
      ]

      env "FOO", "bar"

      resources do
        cpu 500
        disk 1024
        memory 4096

        network do |n|
          reserved_port "redis", 6379
          mbits 10
        end
      end
    end
  end
end

Contributing

Contributions are very welcome, especially from those of you that enjoy writing test coverage.