-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
32 lines (24 loc) · 948 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.DEFAULT_GOAL := help
.PHONY: check-version help push local-install
PLUGIN := vagrant-guests-clearlinux
help:
@echo "available 'make' targets:"
@echo
@grep -E "^.*:.*?## .*$$" $(MAKEFILE_LIST) | \
grep -vE "(grep|BEGIN)" | awk \
'BEGIN {FS = ":.*?## "}; {printf "\t\033[36m%-30s\033[0m %s\n", $$1, $$2}' | \
VERSION=$(VERSION) envsubst
@echo
check-version:
ifndef VERSION
$(error VERSION is undefined)
endif
build: ## builds gem inside a docker container
docker run -it --rm --name gem-builder -v "$${PWD}":/usr/src/myapp \
-w /usr/src/myapp ruby:2.5 bash -c "bundle install; bundle exec rake build"
push: pkg/$(PLUGIN)-${VERSION}.gem ## pushes gem to rubygems.org
gem push pkg/$(PLUGIN)-${VERSION}.gem
pkg/$(PLUGIN)-${VERSION}.gem: check-version build
local-install: pkg/$(PLUGIN)-${VERSION}.gem ## installs plugin locally for testing
vagrant plugin uninstall $(PLUGIN)
vagrant plugin install pkg/$(PLUGIN)-${VERSION}.gem