This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
146 lines (118 loc) · 3.6 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
COMPOSE := $(shell command -v docker-compose 2> /dev/null)
YARN := $(shell command -v yarn 2> /dev/null)
POETRY := $(shell command -v poetry 2> /dev/null)
LAST_TAG := $(shell git for-each-ref --format='%(*committerdate:raw)%(committerdate:raw) %(refname) %(*objectname) %(objectname)' refs/tags 2>/dev/null | sort -n | awk '{ print $$3 }' | tail -n1 | sed s@refs/tags/@@g)
OS_NAME := $(shell uname -s)
.PHONY: docs
setup:
ifndef POETRY
@echo "You must have poetry installed (https://github.com/sdispater/poetry)."
@echo
@exit 1
endif
@poetry install
ifdef YARN
@yarn install
else
@npm install
endif
setup-ci:
@pip install poetry
@poetry develop
check-sec:
ifdef COMPOSE
@echo "Installing Bandit..."
@pip install bandit
@echo "Running Bandit..."
@bandit -r .
endif
ps:
ifdef COMPOSE
@echo "Listing dependencies..."
@docker-compose --project-name fastlane ps
endif
deps:
ifdef COMPOSE
@echo "Starting dependencies..."
@docker-compose --project-name fastlane up -d
@echo "Dependencies started successfully."
endif
deps-build:
ifdef COMPOSE
@echo "Starting dependencies..."
@docker-compose --project-name fastlane up --build -d
@echo "Dependencies started successfully."
endif
stop-deps:
ifdef COMPOSE
@echo "Stopping dependencies..."
@docker-compose --project-name fastlane down -v --remove-orphans
@docker-compose --project-name fastlane rm --stop --force
endif
stop-deps-func:
ifdef COMPOSE
@echo "Stopping func tests dependencies..."
@docker-compose --project-name fastlane-tests -f ./docker-compose-func-tests.yml down -v
endif
deps-func: stop-deps stop-deps-func
ifdef COMPOSE
@echo "Starting func tests dependencies..."
@docker-compose --project-name fastlane-tests -f ./docker-compose-func-tests.yml up -d
@echo "Func tests dependencies started successfully."
endif
docker-build:
@docker build -t fastlane .
docker-push: docker-build
@docker tag fastlane heynemann/fastlane:${LAST_TAG}
@docker push heynemann/fastlane:${LAST_TAG}
@docker tag fastlane heynemann/fastlane:latest
@docker push heynemann/fastlane:latest
test: deps unit deps-func func
unit:
@poetry run pytest -sv --quiet --nf --cov=fastlane tests/unit/
focus:
@poetry run pytest -sv --quiet --nf -m focus tests/unit/
watch:
@poetry run ptw -c -w -- --quiet --nf --cov=fastlane tests/unit/
func:
@poetry run pytest -s --quiet --nf tests/func/
run: deps
@poetry run fastlane api -vvv -c ./fastlane/config/local.conf
worker:
@#This env must be set in MacOS to ensure that docker py works
@OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES poetry run fastlane worker -vv -c ./fastlane/config/local.conf
publish: docker-push
@poetry build
@poetry publish
coverage:
@coverage html
ifeq ($(OS_NAME),Linux)
@firefox `pwd`/htmlcov/index.html
else
@open htmlcov/index.html
endif
sample:
ifdef COMPOSE
@echo "Starting fastlane..."
@docker-compose -f ./docker-compose-sample.yml --project-name fastlane-sample up -d
@echo "fastlane started successfully."
endif
readme:
#ensure remark is installed with
#npm install --global remark-cli remark-preset-lint-recommended remark-stringify
@remark README.md -o README.md
lint:
@pylint fastlane
@flake8
docs:
@mkdocs build && open site/index.html
update-config-doc:
@echo '## Configuration Options' > docs/configuration.md
@echo '' >> docs/configuration.md
@echo 'To generate a sample configuration file like this one: `fastlane config\.' >> docs/configuration.md
@echo '' >> docs/configuration.md
@echo '```python' >> docs/configuration.md
@poetry run fastlane config >> docs/configuration.md
@echo '```' >> docs/configuration.md
@sed -i.bak 's/^#//g' docs/configuration.md
@rm docs/configuration.md.bak