Skip to content

Commit 205518c

Browse files
Vishal TakGitLab
authored andcommitted
Merge branch 'vtak/add_go_update_make' into 'main'
Add command to sync go version in other files See merge request https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/6378 Merged-by: Vishal Tak <vtak@gitlab.com> Approved-by: Timo Furrer <tfurrer@gitlab.com> Reviewed-by: Timo Furrer <tfurrer@gitlab.com> Reviewed-by: GitLab Duo <gitlab-duo@gitlab.com>
2 parents 4985aec + d527f30 commit 205518c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,3 +478,13 @@ print_image_tags:
478478

479479
.PHONY: tools # Install dev tool and dependency binaries for local development.
480480
tools: $(GITLAB_CHANGELOG) $(GOCOVER_COBERTURA) $(GOLANGLINT) $(GOLANGLINT_GOARGS) $(MAGE) $(MOCKERY) $(PROTOC) $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_GRPC) $(RELEASE_INDEX_GENERATOR)
481+
482+
.PHONY: sync-updated-go-version # Sync the go version in CI files to development docs and scripts
483+
sync-updated-go-version:
484+
@echo "Updating Go version in documentation and scripts..."
485+
$(eval GO_VERSION := $(shell grep 'GO_VERSION:' .gitlab/ci/_common.gitlab-ci.yml | awk '{print $$2}' | tr -d '"'))
486+
@echo "Using Go version: $(GO_VERSION)"
487+
@sed -i.bak -E 's/go[0-9]+\.[0-9]+\.[0-9]+/go$(GO_VERSION)/g' docs/development/_index.md && rm docs/development/_index.md.bak
488+
@sed -i.bak -E 's/go-[0-9]+\.[0-9]+\.[0-9]+/go-$(GO_VERSION)/g' docs/development/_index.md && rm docs/development/_index.md.bak
489+
@sed -i.bak -E 's/\$$goVersion = "[0-9]+\.[0-9]+\.[0-9]+"/$$goVersion = "$(GO_VERSION)"/g' scripts/vagrant/provision/base.ps1 && rm scripts/vagrant/provision/base.ps1.bak
490+
@echo "Files updated with Go version $(GO_VERSION)"

0 commit comments

Comments
 (0)