3
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/docker/google.rb', line 3
def self.tag_container(image_id, repo, project_id)
time = Time.new
image_timestamp = "#{time.year}-#{time.month}-#{time.day}_#{time.hour}#{time.min}#{time.sec}"
branch = `git rev-parse --abbrev-ref HEAD`.strip
command = "docker tag #{image_id} #{repo}/#{project_id}:#{branch}-latest"
puts command
system command
tag = "#{repo}/#{project_id}:#{branch}-#{image_timestamp}"
command = "docker tag #{image_id} #{tag}"
puts command
system command
return tag
end
|