Skip to content

joshpmcghee/gadabout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages