-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
62 lines (44 loc) · 1.62 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
#
#
.PHONY: test all venv
help:
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-10s\033[0m - %s\n", $$1, $$2} /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) }' $(MAKEFILE_LIST)
all: help
##@ Testing
test: checkenv-VIRTUAL_ENV ## Run Python Unit Tests
@pip install flexmock
@python -m unittest discover -b -s test
test-verbose: checkenv-VIRTUAL_ENV ## Run Python Unit Tests - Verbose
@pip install flexmock
@python -m unittest discover -b -v -s test
##@ Installation
venv: ## Create virtualenv environment
virtualenv $@
@echo "\nVirtualenv created\nexecute the following to activate: $$ source $@/bin/activate\n"
install: checkenv-VIRTUAL_ENV ## Install via pip, ensuring a virtualenv
@pip install .
install-no-venv: ## Install via pip without ensuring a virtualenv
@pip install .
##@ Build (for PyPi)
build: checkenv-VIRTUAL_ENV ## Build distro for pypi upload
@python setup.py sdist bdist_wheel
clean: ## Clean build directories
rm -rf build
rm -rf dist
rm -rf appscale_agents.egg-info
rm -rf venv
upload: checkenv-VIRTUAL_ENV ## Upload distribution to pypi
@pip install --user --upgrade twine
$(info "Uploading to twine")
##@ Utilities
bump-major: ## Bump major version number for appscale-agents
util/bump_version.sh major
bump-minor: ## Bump minor version number for appscale-agents
util/bump_version.sh minor
bump-patch: ## Bump patch version number for appscale-agents
util/bump_version.sh patch
# $* is the environment variable expanded from % in the rule
# $($*) gives the value of the environment variable
checkenv-%:
$(if $($*), , $(error virtualenv was not detected, exiting))