-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (57 loc) · 1.74 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
SHELL:=/bin/bash
UNAME=$(shell uname)
PLAYBOOK_OPTS="-vvv"
ANSIBLE_LINT_EXCLUDE="-x indentation,unnamed-task,yaml[indentation]"
brew-Linux:
ifeq (, $(shell which brew))
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | /bin/bash
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
else
@echo "linuxbrew is already exits."
endif
brew-Darwin:
ifeq (, $(shell which brew))
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | /bin/bash
else
@echo "homebrew is already exits."
endif
.PHONY: brew
brew: brew-$(UNAME)
.PHONY: age
age:
brew install age
python-Linux:
sudo apt update
sudo apt install -y python3
sudo apt upgrade -y python3
python-Darwin:
brew install python
.PHONY: python
python: python-$(UNAME)
ansible-Linux:
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install -y ansible
sudo apt install -y ansible-lint
ansible-Darwin:
brew install ansible
brew install ansible-lint
.PHONY: ansible
ansible: ansible-$(UNAME)
ansible-galaxy collection install community.general
.PHONY: lint
lint:
ansible-playbook -v --syntax-check ./dev-provisioning.yaml
ansible-lint $(ANSIBLE_LINT_EXCLUDE) $(wildcard ./*/*/*/*.yaml)
.PHONY: provision
provision:
ansible-playbook $(PLAYBOOK_OPTS) -e "ansible_user=$(shell whoami)" ./dev-provisioning.yaml
.PHONY: dep
dep: brew age python ansible
.PHONY: all
all: dep lint provision
.DEFAULT_GOAL=all