-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (26 loc) · 999 Bytes
/
Makefile
File metadata and controls
38 lines (26 loc) · 999 Bytes
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
SHELL := $(shell which bash)
SELF := $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST)))))
ENV_RUN = hatch env run -e $(1) --
ENV_ONE_DEPLOY_VALIDATION := $(shell hatch env find validation-default)
I ?= $(SELF)/inventory/reference/example.yml
INVENTORY ?= $(I)
T ?=
TAGS ?= $(T)
S ?=
SKIP_TAGS ?= $(S)
V ?= vv
VERBOSE ?= $(V)
export
# Make sure we source ANSIBLE_ settings from ansible.cfg exclusively.
unexport $(filter ANSIBLE_%,$(.VARIABLES))
.PHONY: validation
validation: _TAGS := $(if $(TAGS),-t $(TAGS),)
validation: _SKIP_TAGS := $(if $(SKIP_TAGS),--skip-tags $(SKIP_TAGS),)
validation: _VERBOSE := $(if $(VERBOSE),-$(VERBOSE),)
ifdef ENV_ONE_DEPLOY_VALIDATION
$(ENV_ONE_DEPLOY_VALIDATION):
hatch env create validation-default
endif
validation: $(ENV_ONE_DEPLOY_VALIDATION)
cd $(SELF)/ && \
$(call ENV_RUN,validation-default) ansible-playbook $(_VERBOSE) -i $(INVENTORY) $(_TAGS) $(_SKIP_TAGS) $(SELF)/playbooks/validation.yml