-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (72 loc) · 2.68 KB
/
Copy pathMakefile
File metadata and controls
94 lines (72 loc) · 2.68 KB
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
PASSWORD=$$(docker exec nexus3 bash -c 'cat /nexus-data/admin.password')
COMPOSE_FILE=docker-compose.yml
.PHONY: start start_nexus stop integration reload clean shell docs docs-check docs-sphinx set-version test test-integration lint format changelog-draft sync-src
start: start_nexus
@echo "==> target=start COMPOSE_FILE=$(COMPOSE_FILE)"
@docker compose --progress quiet -f $(COMPOSE_FILE) pull
@docker compose -f $(COMPOSE_FILE) up -d
@sleep 5
@echo " installing package in salt containers..."
@docker exec salt-master sh -c 'python3 -m pip install -e /workspace >/dev/null'
@docker exec salt-minion sh -c 'python3 -m pip install -e /workspace >/dev/null'
@docker restart salt-minion > /dev/null
@sleep 10
@echo " syncing files with minion..."
@docker exec salt-master sh -c 'salt \* saltutil.sync_all' > /dev/null 2>&1
start_nexus:
@echo "==> target=start_nexus COMPOSE_FILE=$(COMPOSE_FILE)"
@docker compose --progress quiet -f $(COMPOSE_FILE) pull
@docker compose -f $(COMPOSE_FILE) up -d nexus3
@./bin/check_nexus.sh
@echo
@echo "admin password:"
@docker exec nexus3 bash -c 'cat /nexus-data/admin.password'
@echo
@echo "NEXUS_PASSWORD=$(PASSWORD)" > .env
@echo "NEXUS_PASSWORD=$(PASSWORD)" > $(dir $(COMPOSE_FILE)).env
stop:
@docker compose -f $(COMPOSE_FILE) stop
integration: clean
@echo "==> target=integration: invoking start with COMPOSE_FILE=tests/files/integration.yml"
@$(MAKE) COMPOSE_FILE=tests/files/integration.yml start
@echo "==> target=integration: running pytest in salt-master"
@docker exec -w /tests/integration salt-master ash -c 'pip install pytest; pytest -c /workspace/pyproject.toml ./'
@echo "==> target=integration: invoking stop with COMPOSE_FILE=tests/files/integration.yml"
@$(MAKE) COMPOSE_FILE=tests/files/integration.yml stop
test:
@nox -e tests
test-integration:
@nox -e integration
lint:
@pre-commit run --all-files
format:
@ruff format src tests
reload:
@docker exec -it salt-master salt-key -D -y
@docker rm -f salt-minion
@docker compose up -d
@sleep 10
@docker exec salt-master ash -c 'salt \* saltutil.sync_all' > /dev/null 2>&1
clean:
@docker compose stop
@docker compose -f tests/files/integration.yml stop
@docker container prune -f
@docker system prune -f --volumes
shell:
@docker exec -it -w /srv salt-master ash || true
docs:
@python3 ./bin/generate_docs_from_docstrings.py
docs-check:
@python3 ./bin/generate_docs_from_docstrings.py --check
docs-sphinx:
@nox -e docs
changelog-draft:
@nox -e changelog
sync-src:
@python3 ./bin/sync_legacy_to_src.py
set-version:
@if [ -n "$(VERSION)" ]; then \
python3 ./bin/update_file_versions.py "$(VERSION)"; \
else \
python3 ./bin/update_file_versions.py --from-branch; \
fi