Read Go version from Dockerfile in order to keep things 'DRY'.

This commit is contained in:
Marc CARRE committed 2016-10-26 16:09:09 +01:00
1 parent 880b0a883a
commit 1c4a01d52c
1 file changed
+5 -1
+5 -1
View File
@@ -1,4 +1,8 @@
$go_version = "1.5.2"
$go_regexp = /FROM golang:(\S*).*?/
$go_version = File.readlines("build/Dockerfile").first { |line| line.match($go_regexp) }.match($go_regexp).captures.first
if $go_version.nil?
raise ArgumentError.new("Failed to read Go version from Dockerfile.")
end
$go_path = "/usr/local/go/bin"