-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
107 lines (82 loc) · 1.97 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.SUFFIXES:
BUILD:=
CHECK:=
DISTCLEAN:=
MAINTAINERCLEAN:=
PREREQ:=
SANITY:=
PKG_INSTALLER=
PKG_UPDATE=
PKG_UPGRADE=
PKG_SEARCH_INSTALL= $(PKG_INSTALLER) $(1)
BASE_INSTALL_PATH= /usr/
HOSTNAME:= `hostname`
HOST_TYPE:= `hostname | cut -d'-' -f1`
HOST_UUID:= `hostname | cut -d'-' -f2`
ALL_SCRIPTS:= $(wildcard *.sh)
TMP_FILES:= tmp
TMP_DIR= $(TMP_FILES)/$(dirstamp)
DISTCLEAN+= $(TMP_FILES)
DIST_MAKEFILES:=
include aux/common.mk
include aux/pip.mk
include aux/ansible.mk
include aux/git.mk
.PHONY: clean
clean:
@rm -rf $(BUILD)
@rm -rf $(TMP_DIR)
@find roles | grep role.yml | xargs rm
.PHONY: distclean
distclean: clean distclean-am
.PHONY: distclean-am
distclean-am:
@rm -rf $(PREREQ)
@rm -rf $(DISTCLEAN)
PREREQ+= $(TMP_DIR)
$(TMP_DIR):
@$(MKDIR_P) $(@D)
@$(TOUCH) $@
SANITY+= /usr/local/bin/pip
/usr/local/bin/pip:
$(warning sudo easy_install pip)
$(error rerun make once completing the above action)
SANITY+= /usr/local/bin/virtualenv
/usr/local/bin/virtualenv:
$(warning sudo pip install virtualenv)
$(error rerun make once completing the above action)
SANITY+= $(HOME)/.ssh/id_rsa.pub
$(HOME)/.ssh/id_rsa.pub:
ssh-keygen
ssh-add -K $@
.PHONY: maintainer-clean
maintainer-clean: distclean
@rm -rf $(MAINTAINERCLEAN)
@rm -rf $(PIP_DIR)
.PHONY: check
check: all $(CHECK)
PREREQ+= roles/$(dirstamp)
roles/$(dirstamp):
@$(MKDIR_P) $(@D)
@$(TOUCH) $@
PREREQ+= /usr/local/bin/brew
/usr/local/bin/brew:
@$(srcdir)/playbooks/install_homebrew.yaml
.PHONY: install
install: all
@$(srcdir)/playbooks/install_homebrew.yaml*
@$(srcdir)/playbooks/homebrew_basics.yaml*
.PHONY: install-ansible-user
install-ansible-user: inventory/localhost
@$(ANSIBLE_PLAYBOOK) go.yml --limit=localhost -s
.PHONY: upgrade
upgrade: all
@$(ANSIBLE_PLAYBOOK) maintenance.yml
.PHONY: localhost
localhost: all inventory/localhost
@$(ANSIBLE_PLAYBOOK) go.yml -i inventory/localhost
.PHONY: deploy
deploy: install
all: | $(SANITY) $(PREREQ) $(ANSIBLE_PLAYBOOK) $(BUILD)
.DEFAULT_GOAL:= all
.NOTPARALLEL: