Improve resolution of Dockerfile since used in both Vagrantfile and test/Vagrantfile.
This commit is contained in:
1 parent
c801409c94
commit
4839f41809
1 file changed
+2
-1
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
$go_regexp = /FROM golang:(\S*).*?/
|
$go_regexp = /FROM golang:(\S*).*?/
|
||||||
$go_version = File.readlines("build/Dockerfile").first { |line| line.match($go_regexp) }.match($go_regexp).captures.first
|
$dockerfile_path = File.expand_path(File.join(File.dirname(__FILE__), 'build', 'Dockerfile'))
|
||||||
|
$go_version = File.readlines($dockerfile_path).first { |line| line.match($go_regexp) }.match($go_regexp).captures.first
|
||||||
if $go_version.nil?
|
if $go_version.nil?
|
||||||
raise ArgumentError.new("Failed to read Go version from Dockerfile.")
|
raise ArgumentError.new("Failed to read Go version from Dockerfile.")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user