lib/odania_ops/helper/docker.rb in odania_ops-0.0.1 vs lib/odania_ops/helper/docker.rb in odania_ops-0.0.2
- old
+ new
@@ -19,36 +19,32 @@
end
def login
$logger.info "Loggin in to private registry #{registry_name}"
data = $config['docker']
- puts data.inspect
OdaniaOps::Helper::Shell.execute("docker login --username=#{data['user']} --password=\"#{data['password']}\" --email=#{data['email']} #{registry_url}")
end
+ def registry_name
+ uri = URI.parse $config['docker']['url']
+ uri.host
+ end
+
private
def auth
{:username => $config['docker']['user'], :password => $config['docker']['password']}
end
- def registry_name
- uri = URI.parse $config['docker']['url']
- uri.host
- end
-
def registry_url
uri = URI.parse $config['docker']['url']
uri.path = '/v2'
uri.to_s
end
def get(query_url)
$logger.debug "Query registry: #{registry_url}#{query_url}"
response = HTTParty.get("#{registry_url}#{query_url}", :basic_auth => auth)
- puts response.inspect
- puts response.code
- puts response.parsed_response.inspect
return response.code, response.parsed_response
end
end
end
end