-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (45 loc) · 1.62 KB
/
Makefile
File metadata and controls
61 lines (45 loc) · 1.62 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
SHELL = /usr/bin/env bash
.SHELLFLAGS = -o errexit -o nounset -o pipefail -c
.PHONY: all
all: install
##@ General
.PHONY: help
help: ## Display this help message
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Install
# Additional ansible-playbook options, e.g. make ARGS='--tags mytag -v'
ARGS ?=
.PHONY: install
install: ## Set up host using Ansible
@cd .ansible; \
$(UV) run ansible-playbook --ask-become-pass playbook.yml $(ARGS)
.PHONY: packages
packages: override ARGS += --tags packages
packages: install ## Run only the 'packages' Ansible role
.PHONY: dotfiles
dotfiles: override ARGS += --tags dotfiles
dotfiles: install ## Run only the 'dotfiles' Ansible role
.PHONY: tools
tools: override ARGS += --tags tools
tools: install ## Run only the 'tools' Ansible role
##@ Dependencies
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
UV ?= $(LOCALBIN)/uv
.PHONY: setup
setup: uv ## Create virtual environment and install dependencies with uv
@$(UV) venv --allow-existing
@$(UV) pip install -r requirements.txt
@cd .ansible; \
$(UV) run ansible-galaxy collection install -r requirements.yml
.PHONY: uv
uv: $(UV) ## Install latest uv locally with installer script using curl
$(UV): | $(LOCALBIN)
@curl -sSfL 'https://astral.sh/uv/install.sh' | \
UV_INSTALL_DIR='$(LOCALBIN)' UV_NO_MODIFY_PATH='1' bash
##@ Clean
.PHONY: clean
clean: ## Remove virtual environment and local binaries directories
rm -rf .venv
rm -rf $(LOCALBIN)