-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
41 lines (31 loc) · 1.18 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
# Copyright (c) 2021 Sine Nomine Associates
.PHONY: help init build install clean distclean
NAMESPACE := $(strip $(subst namespace:,,$(shell grep namespace: galaxy.yml)))
NAME := $(strip $(subst name:,,$(shell grep name: galaxy.yml)))
VERSION := $(strip $(subst version:,,$(shell grep version: galaxy.yml)))
PYTHON := /usr/bin/python3
UPDATE := --force
help:
@echo "usage: make <target>"
@echo "targets:"
@echo " venv install virtualenv"
@echo " build build openafs collection"
@echo " install install openafs collection"
@echo " clean remove generated files"
@echo " distclean remove generated files and virtualenv"
.venv/bin/activate:
test -d .venv || $(PYTHON) -m venv .venv
.venv/bin/pip install -U pip
.venv/bin/pip install -r requirements.txt
touch .venv/bin/activate
init venv: .venv/bin/activate
builds/$(NAMESPACE)-$(NAME)-$(VERSION).tar.gz:
mkdir -p builds
.venv/bin/ansible-galaxy collection build --output-path builds .
build: builds/$(NAMESPACE)-$(NAME)-$(VERSION).tar.gz
install: build
.venv/bin/ansible-galaxy collection install $(UPDATE) builds/$(NAMESPACE)-$(NAME)-$(VERSION).tar.gz
clean:
rm -rf builds
distclean: clean
rm -rf .venv