-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
91 lines (69 loc) · 2.47 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
.PHONY: build-dev run-dev stop clean purge reformat tests requirements coverage docs
ifeq ($(DC),)
DC := docker-compose.yml
endif
build-dev:
docker build -t repository-service-tuf-worker:dev .
run-dev: export API_VERSION = dev
run-dev:
$(MAKE) build-dev
docker pull ghcr.io/repository-service-tuf/repository-service-tuf-api:dev
docker compose -f $(DC) up --remove-orphans
db-migration:
if [ -z "$(M)" ]; then echo "Use: make db-migration M=\'message here\'"; exit 1; fi
docker compose run --rm --entrypoint='alembic revision --autogenerate -m "$(M)"' repository-service-tuf-worker
stop:
docker compose -f $(DC) down -v
clean:
$(MAKE) stop
docker compose -f $(DC) rm --force
docker rm repository-service-tuf-worker-localstack-1 -f
rm -rf ./data
rm -rf ./data_test
purge:
$(MAKE) clean
docker rmi repository-service-tuf-worker_repository-service-tuf-worker --force
reformat:
black -l 79 .
isort -l79 --profile black .
tests:
tox -r
requirements:
pipenv lock
pipenv requirements > requirements.txt
pipenv requirements --dev > requirements-dev.txt
precommit:
pre-commit install
pre-commit run --all-files --show-diff-on-failure
coverage:
coverage report
coverage html -i
docs:
tox -e docs
precommit:
pre-commit install
pre-commit autoupdate
pre-commit run --all-files --show-diff-on-failure
clone-umbrella:
if [ -d rstuf-umbrella ];\
then \
cd rstuf-umbrella && git pull;\
else \
git clone https://github.com/repository-service-tuf/repository-service-tuf.git rstuf-umbrella;\
fi
ft-das:
# Use "GITHUB_ACTION" to identify if we are running from a GitHub action.
ifeq ($(GITHUB_ACTION),)
$(MAKE) clone-umbrella
endif
docker compose -f $(DC) run --env UMBRELLA_PATH=rstuf-umbrella --rm rstuf-ft-runner bash rstuf-umbrella/tests/functional/scripts/run-ft-das.sh $(CLI_VERSION) $(PYTEST_GROUP) $(SLOW)
ft-das-local:
docker compose -f $(DC) run --env UMBRELLA_PATH=rstuf-umbrella --rm rstuf-ft-runner bash rstuf-umbrella/tests/functional/scripts/run-ft-das.sh $(CLI_VERSION)
ft-signed:
# Use "GITHUB_ACTION" to identify if we are running from a GitHub action.
ifeq ($(GITHUB_ACTION),)
$(MAKE) clone-umbrella
endif
docker compose -f $(DC) run --env UMBRELLA_PATH=rstuf-umbrella --rm rstuf-ft-runner bash rstuf-umbrella/tests/functional/scripts/run-ft-signed.sh $(CLI_VERSION) $(PYTEST_GROUP) $(SLOW)
ft-signed-local:
docker compose -f $(DC) run --env UMBRELLA_PATH=rstuf-umbrella --rm rstuf-ft-runner bash rstuf-umbrella/tests/functional/scripts/run-ft-signed.sh $(CLI_VERSION)