Skip to content

Commit

Permalink
Remove external mage dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-counteractive committed Jun 27, 2019
1 parent 4094f06 commit 366b81d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,24 @@ copy-vendor:
# copy whatever version of mage beats is using into vendor directory
mkdir -p vendor/github.com/magefile
cp -R vendor/github.com/elastic/beats/vendor/github.com/magefile/mage vendor/github.com/magefile

MAGE_VERSION ?= v1.8.0
MAGE_PRESENT := $(shell mage --version 2> /dev/null | grep $(MAGE_VERSION))
MAGE_IMPORT_PATH ?= github.com/elastic/beats/vendor/github.com/magefile/mage
export MAGE_IMPORT_PATH

.PHONY: mage
mage:
ifndef MAGE_PRESENT
@echo Installing mage $(MAGE_VERSION) from vendor dir.
@go install -ldflags="-X $(MAGE_IMPORT_PATH)/mage.gitTag=$(MAGE_VERSION)" ${MAGE_IMPORT_PATH}
@-mage -clean
endif
@true

# TODO: check for gcc and exit if it's not installed
# TODO: check for virtualenv and exit if it's not installed
# TODO: check for docker and check to be sure the user is in the docker group
# $ sudo usermod -aG docker $USER
# note: the snap version via the installer for 18.04 appears to be unsupported
# and doesn't work well. use the instructions for CE at https://docs.docker.com/install/linux/docker-ce/ubuntu/

0 comments on commit 366b81d

Please sign in to comment.