Skip to content

Commit

Permalink
fix: mage installation with go1.18 (#33083)
Browse files Browse the repository at this point in the history
* path for the mage with go1.18 has changed

* ci: test the command in the CI pipeline

* ci: set HOME

* new make goal to validate the mage installation

* unrequired path when using go install

(cherry picked from commit 5385fd2)

# Conflicts:
#	Jenkinsfile
  • Loading branch information
v1v authored and mergify[bot] committed Sep 21, 2022
1 parent bcf821f commit 7002d3c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,19 @@ pipeline {
GOFLAGS = '-mod=readonly'
}
steps {
<<<<<<< HEAD
withGithubNotify(context: "Checks") {
stageStatusCache(id: 'Checks'){
withBeatsEnv(archive: false, id: "checks") {
=======
withGithubNotify(context: "Lint") {
stageStatusCache(id: 'Lint'){
// test the ./dev-tools/run_with_go_ver used by the Unified Release process
dir("${BASE_DIR}") {
sh "HOME=${WORKSPACE} GO_VERSION=${GO_VERSION} ./dev-tools/run_with_go_ver make test-mage"
}
withBeatsEnv(archive: false, id: "lint") {
>>>>>>> 5385fd2387 (fix: mage installation with go1.18 (#33083))
dumpVariables()
whenTrue(env.ONLY_DOCS == 'false') {
runChecks()
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,7 @@ beats-dashboards: mage update
build/distributions/dependencies.csv: $(PYTHON)
@mkdir -p build/distributions
$(PYTHON) dev-tools/dependencies-report --csv $@

## test-mage : Test the mage installation used by the Unified Release process
test-mage: mage
@mage dumpVariables
2 changes: 1 addition & 1 deletion dev-tools/make/mage-install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export MAGE_IMPORT_PATH
mage:
ifndef MAGE_PRESENT
@echo Installing mage $(MAGE_VERSION).
@go get -ldflags="-X $(MAGE_IMPORT_PATH)/mage.gitTag=$(MAGE_VERSION)" ${MAGE_IMPORT_PATH}@$(MAGE_VERSION)
@go install -ldflags="-X $(MAGE_IMPORT_PATH)/mage.gitTag=$(MAGE_VERSION)" ${MAGE_IMPORT_PATH}@$(MAGE_VERSION)
@-mage -clean
endif
@true

0 comments on commit 7002d3c

Please sign in to comment.