lib/odania_ops/helper/docker.rb in odania_ops-0.0.5 vs lib/odania_ops/helper/docker.rb in odania_ops-0.0.6
- old
+ new
@@ -6,17 +6,17 @@
code, data = get("/#{image}/tags/list")
return [] unless 200.eql? code
data['tags']
end
- def remote_tag(image_name_and_tag, target_image_name_and_tag=nil, force=false)
+ def remote_tag(image_name_and_tag, target_image_name_and_tag=nil)
target_image_name_and_tag = image_name_and_tag if target_image_name_and_tag.nil?
- opts = force ? '-f' : ''
- OdaniaOps::Helper::Shell.execute("docker tag #{opts} #{image_name_and_tag} #{registry_name}/#{target_image_name_and_tag}")
+ OdaniaOps::Helper::Shell.execute("docker tag #{image_name_and_tag} #{registry_name}/#{target_image_name_and_tag}")
end
- def push(image_name)
- OdaniaOps::Helper::Shell.execute("docker push #{registry_name}/#{image_name}")
+ def push(image_name, tag=nil)
+ tag = ":#{tag}" unless tag.nil? or tag.empty?
+ OdaniaOps::Helper::Shell.execute("docker push #{registry_name}/#{image_name}#{tag}")
end
def login
$logger.info "Loggin in to private registry #{registry_name}"
data = $config['docker']