Skip to content

Commit

Permalink
Merge pull request #68 from feelobot/auto-detect-image-path
Browse files Browse the repository at this point in the history
get image path from dockerrun file
  • Loading branch information
feelobot committed Jun 11, 2015
2 parents 3451e3e + 7a3531b commit 4362315
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions lib/gantree/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ def initialize options
check_credentials
set_aws_keys
@options = options
@image_path = @options[:image_path]
raise "Please provide an image path name in .gantreecfg ex. { 'image_path' : 'bleacher/cms' }" unless @image_path
@image_path = @options[:image_path]
@image_path||= get_image_path
@tag = @options[:tag] ||= tag
@base_image_tag = @options[:base_image_tag]
end

def get_image_path
dockerrun = JSON.parse(IO.read("Dockerrun.aws.json"))
image = dockerrun["Image"]["Name"]
image.gsub!(/:(.*)$/, "") if image.include? ":"
puts "Image Path: #{image}".light_blue
image
end

def pull
puts "Pulling Image First..."
Expand Down
2 changes: 1 addition & 1 deletion lib/gantree/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Gantree
VERSION = "0.6.0"
VERSION = "0.6.1"
end

0 comments on commit 4362315

Please sign in to comment.