Files
dotfiles/Makefile

65 lines
1.2 KiB
Makefile
Raw Normal View History

2022-06-30 06:38:05 +02:00
DISTRO := $(shell . /etc/os-release && echo $$NAME)
2017-09-02 19:48:01 +02:00
venv = ./venv
requirements = requirements.txt
2018-02-08 21:38:36 +01:00
activate = . $(venv)/bin/activate
2017-09-02 19:48:01 +02:00
pip = pip
2022-06-30 06:38:05 +02:00
ifeq ($(DISTRO),Ubuntu)
ansible_run = $(activate) && ansible-playbook -e ansible_python_interpreter=/usr/bin/python3 --inventory localhost, --diff ./playbook.yml ${ANSIBLE_EXTRA_ARGS}
else
ansible_run =ansible-playbook -e ansible_python_interpreter=/usr/bin/python3 --inventory localhost, --diff ./playbook.yml ${ANSIBLE_EXTRA_ARGS}
endif
2017-09-02 19:48:01 +02:00
2022-06-30 06:38:05 +02:00
.PHONY: all
2022-06-30 06:38:05 +02:00
all: | venv
2022-06-30 06:38:05 +02:00
$(ansible_run)
2022-05-02 20:16:22 +02:00
.PHONY: config
2022-06-30 06:38:05 +02:00
config: | venv
$(ansible_run) --skip-tags system-update
2022-05-02 20:20:24 +02:00
.PHONY: system-update
2022-06-30 06:38:05 +02:00
system-update: venv
2022-05-02 20:20:24 +02:00
$(ansible_run) --tags system-update
2020-10-05 22:00:36 +02:00
.PHONY: reboot
reboot:
sudo reboot
.PHONY: poweroff
poweroff:
sudo poweroff
.PHONY: weekend
weekend: | update poweroff
.PHONY: packages
2022-06-30 06:38:05 +02:00
packages: venv
$(ansible_run) --tags packages
.PHONY: dotfiles
2022-06-30 06:38:05 +02:00
dotfiles: venv
$(ansible_run) --tags dotfiles
2018-02-05 20:14:02 +01:00
.PHONY: clean
clean:
2018-02-08 21:39:07 +01:00
rm -rf venv
2018-02-05 20:14:02 +01:00
2020-12-08 23:41:35 +01:00
.PHONY: test
test:
./test-in-docker.sh
2022-06-30 06:38:05 +02:00
ifeq ($(DISTRO), Ubuntux)
venv:
python3 -m venv $(venv)
$(activate) && $(pip) install -r $(requirements)
else
2017-09-02 19:48:01 +02:00
venv:
2022-06-30 06:38:05 +02:00
true
endif
2017-09-02 19:48:01 +02:00
2020-03-02 16:07:25 +01:00
.PHONY: freeze
2017-09-02 19:48:01 +02:00
freeze:
$(activate) && $(pip) freeze > $(requirements)