|
1 | 1 | SHELL := $(shell which bash) |
2 | 2 | SELF := $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST))))) |
3 | 3 |
|
| 4 | +POETRY_BIN ?= $(shell command -v poetry) |
| 5 | +POETRY_RUN := $(if $(POETRY_BIN),$(POETRY_BIN) run,) |
| 6 | + |
4 | 7 | I ?= $(SELF)/inventory/example.yml |
5 | 8 | INVENTORY ?= $(I) |
6 | 9 |
|
@@ -28,14 +31,17 @@ infra pre ceph site main: _TAGS := $(if $(TAGS),-t $(TAGS),) |
28 | 31 | infra pre ceph site main: _SKIP_TAGS := $(if $(SKIP_TAGS),--skip-tags $(SKIP_TAGS),) |
29 | 32 | infra pre ceph site main: _VERBOSE := $(if $(VERBOSE),-$(VERBOSE),) |
30 | 33 | infra pre ceph site main: |
31 | | - cd $(SELF)/ && ansible-playbook $(_VERBOSE) -i $(INVENTORY) $(_TAGS) $(_SKIP_TAGS) opennebula.deploy.$@ |
| 34 | + cd $(SELF)/ && $(POETRY_RUN) ansible-playbook $(_VERBOSE) -i $(INVENTORY) $(_TAGS) $(_SKIP_TAGS) opennebula.deploy.$@ |
| 35 | + |
| 36 | +.PHONY: requirements requirements-poetry requirements-python requirements-galaxy |
32 | 37 |
|
33 | | -.PHONY: requirements requirements-python requirements-galaxy |
| 38 | +requirements: requirements-$(if $(POETRY_RUN),poetry,python) requirements-galaxy |
34 | 39 |
|
35 | | -requirements: requirements-python requirements-galaxy |
| 40 | +requirements-poetry: $(SELF)/pyproject.toml |
| 41 | + poetry update --directory $(dir $<) |
36 | 42 |
|
37 | 43 | requirements-python: $(SELF)/requirements.txt |
38 | 44 | pip3 install --requirement $< |
39 | 45 |
|
40 | 46 | requirements-galaxy: $(SELF)/requirements.yml |
41 | | - ansible-galaxy collection install --requirements-file $< |
| 47 | + $(POETRY_RUN) ansible-galaxy collection install --requirements-file $< |
0 commit comments