Class: Shipitron::Server::Docker::Configure

Inherits:
Object
  • Object
show all
Includes:
Metaractor, ConsulKeys
Defined in:
lib/shipitron/server/docker/configure.rb

Instance Method Summary collapse

Methods included from ConsulKeys

#configure_consul_client!, #fetch_key, #fetch_key!

Instance Method Details

#callObject



17
18
19
20
21
22
23
24
25
# File 'lib/shipitron/server/docker/configure.rb', line 17

def call
  docker_auth = fetch_key!(key: "shipitron/#{application}/docker_auth")
  auth_file = Pathname.new('/home/shipitron/.docker/config.json')
  auth_file.parent.mkpath
  auth_file.open('wb') do |file|
    file.puts(docker_auth.to_s)
    file.chmod(0600)
  end
end