Read Go version from Dockerfile in order to keep things 'DRY'.
This commit is contained in:
1 parent
880b0a883a
commit
1c4a01d52c
1 file changed
+5
-1
+5
-1
@@ -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"
|
$go_path = "/usr/local/go/bin"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user