1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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>
This commit is contained in:
Kir Kolyshkin 2018-08-03 13:40:38 +03:00
parent 75fe414440
commit 6a2851332d

View file

@ -130,7 +130,7 @@ Function Check-InContainer() {
# outside of a container where it may be out of date with master.
Function Verify-GoVersion() {
Try {
$goVersionDockerfile=(Get-Content ".\Dockerfile" | Select-String "ENV GO_VERSION").ToString().Split(" ")[2]
$goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^FROM golang:").ToString().Split(" ")[1].SubString(7)
$goVersionInstalled=(go version).ToString().Split(" ")[2].SubString(2)
}
Catch [Exception] {