From acbbdbb1edf2588683eea5cd6538be1f2f262494 Mon Sep 17 00:00:00 2001 From: Nick Cabatoff Date: Wed, 30 Nov 2022 08:37:26 -0500 Subject: [PATCH] Simplify go version update (#17821) * make ci-config now updates @executors based on go-version * Update to latest ubuntu-2004 for machine executors. --- .circleci/Makefile | 6 +++++- .circleci/config.yml | 6 +++--- .circleci/config/executors/@executors.yml | 3 +-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.circleci/Makefile b/.circleci/Makefile index d24027f1d9..188952dbb2 100644 --- a/.circleci/Makefile +++ b/.circleci/Makefile @@ -35,6 +35,8 @@ CONFIG_SOURCE := Makefile $(SOURCE_YML) | $(SOURCE_DIR) OUT := config.yml TMP := .tmp/config-processed CONFIG_PACKED := .tmp/config-packed +GO_VERSION_FILE := ../.go-version +GO_VERSION := $(shell cat $(GO_VERSION_FILE)) default: help @@ -54,7 +56,7 @@ $(SOURCE_DIR): $(shell [ -d .tmp ] || mkdir .tmp) .PHONY: $(CONFIG) -$(CONFIG): $(OUT) +$(CONFIG): $(OUT) $(GO_VERSION_FILE) .PHONY: $(VERIFY) $(VERIFY): config-up-to-date @@ -72,6 +74,8 @@ export GENERATED_FILE_HEADER # it them moves that file to $@. This makes is an atomic operation, so if it fails # make doesn't consider a half-baked file up to date. define GEN_CONFIG + @yq -i ".references.environment.GO_IMAGE = \"docker.mirror.hashicorp.services/cimg/go:$(GO_VERSION)\"" $(SOURCE_DIR)/executors/\@executors.yml + @$(CIRCLECI) config pack $(SOURCE_DIR) > $(CONFIG_PACKED) @echo "$$GENERATED_FILE_HEADER" > $@.tmp || { rm -f $@; exit 1; } @$(CIRCLECI) config process $(CONFIG_PACKED) >> $@.tmp || { rm -f $@.tmp; exit 1; } diff --git a/.circleci/config.yml b/.circleci/config.yml index 4a5a86ea79..1fea3f135f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,7 +73,7 @@ jobs: path: ui/test-results build-go-dev: machine: - image: ubuntu-2004:202201-02 + image: ubuntu-2004:2022.10.1 shell: /usr/bin/env bash -euo pipefail -c working_directory: /home/circleci/go/src/github.com/hashicorp/vault steps: @@ -358,7 +358,7 @@ jobs: - GOTESTSUM_VERSION: 0.5.2 fmt: machine: - image: ubuntu-2004:202201-02 + image: ubuntu-2004:2022.10.1 shell: /usr/bin/env bash -euo pipefail -c working_directory: /home/circleci/go/src/github.com/hashicorp/vault steps: @@ -858,7 +858,7 @@ jobs: name: Run Semgrep Rules pre-flight-checks: machine: - image: ubuntu-2004:202201-02 + image: ubuntu-2004:2022.10.1 shell: /usr/bin/env bash -euo pipefail -c working_directory: /home/circleci/go/src/github.com/hashicorp/vault steps: diff --git a/.circleci/config/executors/@executors.yml b/.circleci/config/executors/@executors.yml index 32494efbdc..5ecd5f6f26 100644 --- a/.circleci/config/executors/@executors.yml +++ b/.circleci/config/executors/@executors.yml @@ -5,10 +5,9 @@ references: GOFUMPT_VERSION: 0.3.1 # Pin gofumpt to patch version (ex: 1.2.3) GO_TAGS: "" GO_IMAGE: &GO_IMAGE "docker.mirror.hashicorp.services/cimg/go:1.19.3" - go-machine: machine: - image: ubuntu-2004:202201-02 + image: ubuntu-2004:2022.10.1 environment: *ENVIRONMENT shell: /usr/bin/env bash -euo pipefail -c working_directory: /home/circleci/go/src/github.com/hashicorp/vault