From 9aa4cfebaa257ae130cc106573d4f1ad38ea89b9 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Thu, 16 Jan 2020 09:52:38 -0500 Subject: [PATCH 1/4] Avoid unnecessary golang version reference --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8336b333f5e..43cc0a7d049 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,7 +23,7 @@ install: cd %APPVEYOR_BUILD_FOLDER% rmdir /Q/S C:\go - # install go 1.12.13 to match version used for cutting a release + # install the go version used for cutting a release - cmd: | mkdir c:\go appveyor DownloadFile "https://dl.google.com/go/go1.12.13.windows-amd64.zip" -FileName "%TEMP%\\go.zip" From 8dbb16cbe5ff918bc7cc32dce7faefab9a8626e4 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Thu, 16 Jan 2020 10:00:15 -0500 Subject: [PATCH 2/4] add a script to update golang version --- scripts/update_golang_version.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 scripts/update_golang_version.sh diff --git a/scripts/update_golang_version.sh b/scripts/update_golang_version.sh new file mode 100755 index 00000000000..1cc0d1b06ed --- /dev/null +++ b/scripts/update_golang_version.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +golang_version="$1" + +current_version=$(grep -o -e 'golang:[.0-9]*' .circleci/config.yml | head -n1 | cut -d: -f2) + +# To support both GNU and BSD sed, the regex is looser than it needs to be. +# Specifically, we use "* instead of "?, which relies on GNU extension without much loss of +sed -i'' -e "s|golang:[.0-9]*|golang:${golang_version}|g" \ + .circleci/config/config.yml .circleci/config.yml +sed -i'' -e "s|GOLANG_VERSION:[ \"]*[.0-9]*\"*|GOLANG_VERSION: ${golang_version}|g" \ + .circleci/config/config.yml .circleci/config.yml + +sed -i'' -e "s|\\(golang.org.*version\\) [.0-9]*|\\1 ${golang_version}|g" \ + README.md + +sed -i'' -e "s|go[.0-9]*.windows-amd64.zip|go${golang_version}.windows-amd64.zip|g" \ + appveyor.yml + +sed -i'' -e "s|go_version=\"*[^\"]*\"*$|go_version=\"${golang_version}\"|g" \ + scripts/vagrant-linux-priv-go.sh scripts/release/mac-remote-build + +# check if there is any remaining references to old versions +if git grep -I --fixed-strings "${current_version}" | grep -v -e CHANGELOG.md -e vendor/ +then + echo " ^^ files contain references to old golang version" >&2 + echo " update script and run again" >&2 + exit 1 +fi From ee244e9256c5dca19f7091377e43aa67adfa2975 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Thu, 16 Jan 2020 10:01:58 -0500 Subject: [PATCH 3/4] Update golang to 1.12.15 --- .circleci/config.yml | 26 +++++++++++++------------- .circleci/config/config.yml | 4 ++-- README.md | 2 +- appveyor.yml | 2 +- scripts/release/mac-remote-build | 2 +- scripts/vagrant-linux-priv-go.sh | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 73ae04eeddb..8e1ca59e0f1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ jobs: working_directory: ~/go/src/github.com/hashicorp/nomad environment: - GIT_PAGER: cat - - GOLANG_VERSION: 1.12.13 + - GOLANG_VERSION: 1.12.15 - GOMAXPROCS: 1 - GOPATH: /home/circleci/go - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml @@ -86,7 +86,7 @@ jobs: working_directory: ~/go/src/github.com/hashicorp/nomad environment: - GIT_PAGER: cat - - GOLANG_VERSION: 1.12.13 + - GOLANG_VERSION: 1.12.15 - GOMAXPROCS: 1 - GOPATH: /home/circleci/go - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml @@ -162,7 +162,7 @@ jobs: working_directory: ~/go/src/github.com/hashicorp/nomad environment: - GIT_PAGER: cat - - GOLANG_VERSION: 1.12.13 + - GOLANG_VERSION: 1.12.15 - GOMAXPROCS: 1 - GOPATH: /home/circleci/go - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml @@ -238,7 +238,7 @@ jobs: working_directory: ~/go/src/github.com/hashicorp/nomad environment: - GIT_PAGER: cat - - GOLANG_VERSION: 1.12.13 + - GOLANG_VERSION: 1.12.15 - GOMAXPROCS: 1 - GOPATH: /home/circleci/go - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml @@ -314,7 +314,7 @@ jobs: working_directory: ~/go/src/github.com/hashicorp/nomad environment: - GIT_PAGER: cat - - GOLANG_VERSION: 1.12.13 + - GOLANG_VERSION: 1.12.15 - GOMAXPROCS: 1 - GOPATH: /home/circleci/go - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml @@ -413,7 +413,7 @@ jobs: name: Ember tests lint-go: docker: - - image: golang:1.12.13 + - image: golang:1.12.15 working_directory: /go/src/github.com/hashicorp/nomad steps: - checkout @@ -471,7 +471,7 @@ jobs: working_directory: ~/go/src/github.com/hashicorp/nomad environment: - GIT_PAGER: cat - - GOLANG_VERSION: 1.12.13 + - GOLANG_VERSION: 1.12.15 - GOMAXPROCS: 1 - GOPATH: /home/circleci/go - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml @@ -543,7 +543,7 @@ jobs: path: /tmp/test-reports test-devices: docker: - - image: golang:1.12.13 + - image: golang:1.12.15 working_directory: /go/src/github.com/hashicorp/nomad environment: - GIT_PAGER: cat @@ -610,7 +610,7 @@ jobs: command: make test-website environment: - GIT_PAGER: cat - - GOLANG_VERSION: 1.12.13 + - GOLANG_VERSION: 1.12.15 - GOMAXPROCS: 1 - GOPATH: /home/circleci/go - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml @@ -622,7 +622,7 @@ jobs: working_directory: ~/go/src/github.com/hashicorp/nomad environment: - GIT_PAGER: cat - - GOLANG_VERSION: 1.12.13 + - GOLANG_VERSION: 1.12.15 - GOMAXPROCS: 1 - GOPATH: /home/circleci/go - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml @@ -694,7 +694,7 @@ jobs: path: /tmp/test-reports build-binaries: docker: - - image: golang:1.12.13 + - image: golang:1.12.15 working_directory: /go/src/github.com/hashicorp/nomad environment: - GIT_PAGER: cat @@ -727,7 +727,7 @@ jobs: path: pkg/linux_amd64.zip test-e2e: docker: - - image: golang:1.12.13 + - image: golang:1.12.15 working_directory: /go/src/github.com/hashicorp/nomad steps: - checkout @@ -758,7 +758,7 @@ jobs: working_directory: ~/go/src/github.com/hashicorp/nomad environment: - GIT_PAGER: cat - - GOLANG_VERSION: 1.12.13 + - GOLANG_VERSION: 1.12.15 - GOMAXPROCS: 1 - GOPATH: /home/circleci/go - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml diff --git a/.circleci/config/config.yml b/.circleci/config/config.yml index c18e455f218..e3849f12798 100644 --- a/.circleci/config/config.yml +++ b/.circleci/config/config.yml @@ -21,7 +21,7 @@ executors: go: working_directory: /go/src/github.com/hashicorp/nomad docker: - - image: golang:1.12.13 + - image: golang:1.12.15 environment: <<: *common_envs GOPATH: /go @@ -33,7 +33,7 @@ executors: environment: &machine_env <<: *common_envs GOPATH: /home/circleci/go - GOLANG_VERSION: "1.12.13" + GOLANG_VERSION: 1.12.15 # uses a more recent image with unattended upgrades disabled properly # but seems to break docker builds diff --git a/README.md b/README.md index 0127d0d8dae..8f272caa1b4 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ Who Uses Nomad Contributing to Nomad -------------------- -If you wish to contribute to Nomad, you will need [Go](https://www.golang.org) installed on your machine (version 1.12.13+ is *required*, and `gcc-go` is not supported). +If you wish to contribute to Nomad, you will need [Go](https://www.golang.org) installed on your machine (version 1.12.15+ is *required*, and `gcc-go` is not supported). See the [`contributing`](contributing/) directory for more developer documentation. diff --git a/appveyor.yml b/appveyor.yml index 43cc0a7d049..ac2c7f56b1f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,7 +26,7 @@ install: # install the go version used for cutting a release - cmd: | mkdir c:\go - appveyor DownloadFile "https://dl.google.com/go/go1.12.13.windows-amd64.zip" -FileName "%TEMP%\\go.zip" + appveyor DownloadFile "https://dl.google.com/go/go1.12.15.windows-amd64.zip" -FileName "%TEMP%\\go.zip" - ps: Expand-Archive $Env:TEMP\go.zip -DestinationPath C:\ diff --git a/scripts/release/mac-remote-build b/scripts/release/mac-remote-build index ea1787024c3..beb66d55b86 100755 --- a/scripts/release/mac-remote-build +++ b/scripts/release/mac-remote-build @@ -56,7 +56,7 @@ REPO_PATH="${TMP_WORKSPACE}/gopath/src/github.com/hashicorp/nomad" mkdir -p "${TMP_WORKSPACE}/tmp" install_go() { - local go_version="1.12.13" + local go_version="1.12.15" local download= download="https://storage.googleapis.com/golang/go${go_version}.darwin-amd64.tar.gz" diff --git a/scripts/vagrant-linux-priv-go.sh b/scripts/vagrant-linux-priv-go.sh index c3c69ad9441..2cfcf6afa28 100755 --- a/scripts/vagrant-linux-priv-go.sh +++ b/scripts/vagrant-linux-priv-go.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash function install_go() { - local go_version=1.12.13 + local go_version="1.12.15" local download= download="https://storage.googleapis.com/golang/go${go_version}.linux-amd64.tar.gz" From 30af487eb3c5f9f49dd1d6409252e2a9d020ab6c Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Mon, 27 Jan 2020 09:10:38 -0500 Subject: [PATCH 4/4] fix comment --- scripts/update_golang_version.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update_golang_version.sh b/scripts/update_golang_version.sh index 1cc0d1b06ed..91c31ecfe3f 100755 --- a/scripts/update_golang_version.sh +++ b/scripts/update_golang_version.sh @@ -6,6 +6,7 @@ current_version=$(grep -o -e 'golang:[.0-9]*' .circleci/config.yml | head -n1 | # To support both GNU and BSD sed, the regex is looser than it needs to be. # Specifically, we use "* instead of "?, which relies on GNU extension without much loss of +# correctness in practice. sed -i'' -e "s|golang:[.0-9]*|golang:${golang_version}|g" \ .circleci/config/config.yml .circleci/config.yml sed -i'' -e "s|GOLANG_VERSION:[ \"]*[.0-9]*\"*|GOLANG_VERSION: ${golang_version}|g" \