Browse code

hack/make.ps1: don't use ENV GO_VERSION

Modify hack/make.ps1 to use the version value used in
"FROM golang" statement.

While at it:
1. Make search expression a bit more strict (use ^ to match at BOL only).
2. Simplify by removing Get-Contents as Select-String can read files.

After this, ENV GO_VERSION can be removed from Dockerfile.
Unfortunately it can't be done in one commit as Windows CI
fails (presumably because Dockerfile is being modified in
place).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

Kir Kolyshkin authored on 2018/08/03 19:40:38
Showing 1 changed files
... ...
@@ -130,7 +130,7 @@ Function Check-InContainer() {
130 130
 # outside of a container where it may be out of date with master.
131 131
 Function Verify-GoVersion() {
132 132
     Try {
133
-        $goVersionDockerfile=(Get-Content ".\Dockerfile" | Select-String "ENV GO_VERSION").ToString().Split(" ")[2]
133
+        $goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^FROM golang:").ToString().Split(" ")[1].SubString(7)
134 134
         $goVersionInstalled=(go version).ToString().Split(" ")[2].SubString(2)
135 135
     }
136 136
     Catch [Exception] {