-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
45 lines (35 loc) · 1.33 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
BUILDER_TAG = "meetup/sbt-builder:0.1.5"
CI_BUILD_NUMBER ?= $(USER)-SNAPSHOT
CI_IVY_CACHE ?= $(HOME)/.ivy2
CI_SBT_CACHE ?= $(HOME)/.sbt
CI_WORKDIR ?= $(shell pwd)
TARGET ?= __package-sbt
VERSION ?= 0.0.$(CI_BUILD_NUMBER)
help:
@echo Public targets:
@grep -E '^[^_]{2}[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
@echo "Private targets: (use at own risk)"
@grep -E '^__[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[35m%-20s\033[0m %s\n", $$1, $$2}'
package: ## Package the plugin in the build container.
docker run \
--rm \
-v $(CI_WORKDIR):/data \
-v $(CI_IVY_CACHE):/root/.ivy2 \
-v $(CI_SBT_CACHE):/root/.sbt \
-v $(HOME)/.bintray:/root/.bintray \
-e CI_BUILD_NUMBER=$(CI_BUILD_NUMBER) \
-e TRAVIS_JOB_ID=$(TRAVIS_JOB_ID) \
-e TRAVIS_PULL_REQUEST=$(TRAVIS_PULL_REQUEST) \
$(BUILDER_TAG) \
make $(TARGET)
publish: __set-publish package ## Package the plugin in the build container and then publish to the repository.
version: ## Print the current version.
@echo $(VERSION)
__package-sbt: ## Publish the plugin locally.
sbt clean \
test \
publishLocal
__publish-sbt: __package-sbt ## Package and publish the plugin.
sbt publish cleanLocal
__set-publish:
$(eval TARGET=__publish-sbt)