-
Notifications
You must be signed in to change notification settings - Fork 154
/
Makefile
79 lines (59 loc) · 1.89 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
PREFIX:=/usr/local
BUILD_DIR:=build
VIRTUAL_ENV?=$(BUILD_DIR)/virtualenv
TESTS?=tests
PYTHON?=3.7
TEST_DIR:=/tmp/gitfs-tests
MNT_DIR:=$(TEST_DIR)/$(shell bash -c 'echo $$RANDOM')_mnt
REPO_DIR:=$(TEST_DIR)/$(shell bash -c 'echo $$RANDOM')_repo
REPO_NAME:=testing_repo
BARE_REPO:=$(TEST_DIR)/$(REPO_NAME).git
export
REMOTE:=$(TEST_DIR)/$(REPO_NAME)
GITFS_PID:=$(TEST_DIR)/gitfs.pid
GIT_NAME=GitFs
all: $(BUILD_DIR)/gitfs
install: $(BUILD_DIR)/gitfs
mkdir -p $(DESTDIR)$(PREFIX)/bin
install -m 0755 $(BUILD_DIR)/gitfs $(DESTDIR)$(PREFIX)/bin/gitfs
uninstall:
rm -rf $(DESTDIR)$(PREFIX)/bin/gitfs
$(BUILD_DIR)/gitfs: $(BUILD_DIR) $(VIRTUAL_ENV)/bin/pex
$(VIRTUAL_ENV)/bin/pex -v --disable-cache -r requirements.txt -e gitfs:mount -o $(BUILD_DIR)/gitfs .
$(VIRTUAL_ENV)/bin/pex: virtualenv
$(VIRTUAL_ENV)/bin/pip install pex wheel
$(VIRTUAL_ENV)/bin/mkdocs: virtualenv
$(VIRTUAL_ENV)/bin/pip install mkdocs
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(VIRTUAL_ENV)/bin/py.test: $(VIRTUAL_ENV)/bin/pip$(PYTHON)
@touch $@
$(VIRTUAL_ENV)/bin/pip2.7:
virtualenv --setuptools $(VIRTUAL_ENV)
$(VIRTUAL_ENV)/bin/pip%:
virtualenv --setuptools $(VIRTUAL_ENV) -ppython$*
virtualenv: $(VIRTUAL_ENV)/bin/pip$(PYTHON)
testenv: virtualenv
script/testenv
test: testenv
script/test
clean:
rm -rf $(BUILD_DIR)
rm -rf $(TEST_DIR)
lint:
black -t py27 gitfs
verify-lint: lint
git diff --exit-code
.PHONY: docs
docs: $(VIRTUAL_ENV)/bin/mkdocs
$(VIRTUAL_ENV)/bin/mkdocs build --clean
.PHONY: gh-pages
gh-pages: docs
git config --global user.email "[email protected]"
git config --global user.name "Igor Debot"
cp docs/index.html .
git add .
echo -n "(autodoc) " > /tmp/COMMIT_MESSAGE ; git log -1 --pretty=%B >> /tmp/COMMIT_MESSAGE ; echo >> /tmp/COMMIT_MESSAGE ; echo "Commited-By: $$CI_BUILD_URL" >> /tmp/COMMIT_MESSAGE
git commit -F /tmp/COMMIT_MESSAGE
.PHONY: clean test testenv virtualenv drone all