-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (33 loc) · 1.25 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
.PHONY: all ${MAKECMDGOALS}
MOLECULE_SCENARIO ?= default
GALAXY_API_KEY ?=
GITHUB_REPOSITORY ?= $$(git config --get remote.origin.url | cut -d: -f 2 | cut -d. -f 1)
GITHUB_ORG = $$(echo ${GITHUB_REPOSITORY} | cut -d/ -f 1)
GITHUB_REPO = $$(echo ${GITHUB_REPOSITORY} | cut -d/ -f 2)
COLLECTION_NAMESPACE = $$(yq '.namespace' < galaxy.yml)
COLLECTION_NAME = $$(yq '.name' < galaxy.yml)
COLLECTION_VERSION = $$(yq '.version' < galaxy.yml)
all: install version lint pytest verify
pytest: install
poetry run pytest tests/pytest
@echo
test: pytest verify
install:
@type poetry >/dev/null || pip3 install poetry
@type yq || sudo apt-get install -y yq
@poetry install --no-root
format: install
poetry run black .
lint: install
poetry run pylint plugins
publish: build
poetry run ansible-galaxy collection publish --api-key ${GALAXY_API_KEY} \
"${COLLECTION_NAMESPACE}-${COLLECTION_NAME}-${COLLECTION_VERSION}.tar.gz"
build: install
@poetry run ansible-galaxy collection build --force
dependency create prepare converge idempotence side-effect verify destroy login reset listt:
MOLECULE_DOCKER_IMAGE=${MOLECULE_DOCKER_IMAGE} poetry run molecule $@ -s ${MOLECULE_SCENARIO}
version:
@poetry run molecule --version
debug: version
@poetry export --dev --without-hashes