class Google
Public Class Methods
push_container(image_tag)
click to toggle source
# File lib/docker/google.rb, line 25 def self.push_container(image_tag) command = "gcloud preview docker push #{image_tag}" fail "Could not push container: #{image_tag}" unless system(command) end
tag_container(image_id, repo, project_id, cached=false)
click to toggle source
# File lib/docker/google.rb, line 3 def self.tag_container(image_id, repo, project_id, cached=false) branch = `git rev-parse --abbrev-ref HEAD`.strip commit = `git rev-parse --short HEAD`.strip tag = "#{repo}/#{project_id}:#{branch}-#{commit}-" if cached tag << 'cached' else tag << 'uncached' end command = "docker tag #{image_id} #{tag}" puts command system command return tag end
tag_latest(image_id, repo, project_id)
click to toggle source
# File lib/docker/google.rb, line 18 def self.tag_latest(image_id, repo, project_id) branch = `git rev-parse --abbrev-ref HEAD`.strip command = "docker tag -f #{image_id} #{repo}/#{project_id}:#{branch}-latest" puts command system command end