This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
234 lines (179 loc) · 7.72 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
.PHONY: help
# Shell that make should use
# Make changes to path persistent
# https://stackoverflow.com/a/13468229/13577666
SHELL := /bin/bash
PATH := $(PATH)
# Ubuntu distro string
OS_VERSION_NAME := $(shell lsb_release -cs)
HOSTNAME = $(shell hostname)
# This next section is needed to ensure $$HOME is on PATH in the initial shell session
# The file from bash scripts/before_script_path_fix.sh
# is only loaded in a new shell session.
LOCAL_BIN = $(shell echo $$HOME/.local/bin)
# $(warning LOCAL_BIN is $(LOCAL_BIN))
# Source for conditional: https://stackoverflow.com/a/2741747/13577666
ifneq (,$(findstring $(LOCAL_BIN),$(PATH)))
# Found: all set; do nothing, $(LOCAL_BIN) is on PATH
PATH := $(PATH);
else
# Not found: adding $(LOCAL_BIN) to PATH for this shell session
export PATH := $(LOCAL_BIN):$(PATH); @echo $(PATH)
endif
# "users" format is from https://github.com/icancclearynow/ansible-role-zsh
VARIABLES = '{"users": [{"username": "$(shell whoami)"}], "ansible_user": "$(shell whoami)", "docker_users": ["$(shell whoami)"]}'
# Main Ansible Playbook Command (prompts for password)
PLAYBOOK_TERMINAL=playbook_terminal.yml
PLAYBOOK_DESKTOP=playbook_desktop.yml
ANSIBLE_PLAYBOOK_TERMINAL = ansible-playbook $(PLAYBOOK_TERMINAL) -v -e $(VARIABLES)
ANSIBLE_PLAYBOOK_DESKTOP = ansible-playbook $(PLAYBOOK_DESKTOP) -v -e $(VARIABLES)
$(warning ANSIBLE_PLAYBOOK_TERMINAL is $(ANSIBLE_PLAYBOOK_TERMINAL))
$(warning ANSIBLE_PLAYBOOK_DESKTOP is $(ANSIBLE_PLAYBOOK_DESKTOP))
help:
# http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
# adds anything that has a double # comment to the phony help list
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ".:*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help
bootstrap-before-install:
bootstrap-before-install:
# Apt Dependencies (removes apt ansible)
bash scripts/before_install_apt_dependencies.sh
bootstrap-install:
bootstrap-install:
# Python3 Dependencies (install python3 ansible)
bash scripts/install_python3_dependencies.sh
bootstrap-before-script:
bootstrap-before-script:
# Ensure "$$HOME/.local/bin" is part of PATH on future shell sessions
# The top of the Makefile takes care of this in the initial session
bash scripts/before_script_path_fix.sh
galaxy-requirements:
galaxy-requirements:
ansible-galaxy install -r requirements.yml
bootstrap: bootstrap-before-install bootstrap-install bootstrap-before-script galaxy-requirements
bootstrap: ## Installs dependencies needed to run playbook
bootstrap-check:
bootstrap-check: ## Check that PATH and requirements are correct
@ansible --version | grep "python version"
terminal-github-runner:
terminal-github-runner:
# test coverage is in the ansible roles themselves
@$(ANSIBLE_PLAYBOOK_TERMINAL) --skip-tags="skip-ci"
desktop-github-runner:
desktop-github-runner:
# test coverage is in the ansible roles themselves
@$(ANSIBLE_PLAYBOOK_DESKTOP) --skip-tags="skip-ci"
terminal: DARGS?=
terminal: ## Installs everything from terminal playbook
@$(ANSIBLE_PLAYBOOK_TERMINAL)
desktop: DARGS?=
desktop: ## Installs everything from terminal playbook
@$(ANSIBLE_PLAYBOOK_DESKTOP)
all: ## Does most eveything with Ansible and Make targets
all: bootstrap bootstrap-check install non-ansible
lint: ## Lint the repo
lint:
pre-commit run --all-files
rust: ## Install rust
rust:
sudo apt install build-essential
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $$HOME/.cargo/env
cargo: ## Install rust crates
cargo:
cargo install just
cargo install sd
material-shell: ## Install Material Shell GNOME Extension from source
material-shell:
git clone --depth 1 https://github.com/material-shell/material-shell.git && cd material-shell && make install
xdg-open https://github.com/material-shell/material-shell#get-the-most-up-to-date-version-with-git
tresorit: ## Install Tresorit
tresorit:
wget -O ~/Downloads/tresorit_installer.run https://installerstorage.blob.core.windows.net/public/install/tresorit_installer.run
chmod +x ~/Downloads/tresorit_installer.run
$(echo $0) ~/Downloads/tresorit_installer.run
act: ## Local github actions runner
act:
@curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
sudo mv bin/act ~/.local/bin/act
dotfiles: ## Initialize dotfiles
dotfiles:
chezmoi init --apply [email protected]:iancleary/dotfiles.git
######################## Below is autogenerated ##########################
# Run python3 scripts/makefile_targets_from_ansible_tags.py, copy Makefile.template below
###########################################################################
colorls:
colorls: ## Runs the colorls ansible role
@$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="colorls" --ask-become-pass
docker:
docker: ## Runs the docker ansible role
@$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="docker" --ask-become-pass
fonts:
fonts: ## Runs the fonts ansible role
@$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="fonts" --ask-become-pass
gh:
gh: ## Runs the gh ansible role
@$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="gh" --ask-become-pass
github-cli:
github-cli: ## Runs the github-cli ansible role
@$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="github-cli" --ask-become-pass
meslolgs:
meslolgs: ## Runs the meslolgs ansible role
@$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="meslolgs" --ask-become-pass
nodejs:
nodejs: ## Runs the nodejs ansible role
@$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="nodejs" --ask-become-pass
ohmyzsh:
ohmyzsh: ## Runs the ohmyzsh ansible role
@$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="ohmyzsh" --ask-become-pass
tailscale:
tailscale: ## Runs the tailscale ansible role
@$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="tailscale" --ask-become-pass
terraform:
terraform: ## Runs the terraform ansible role
@$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="terraform" --ask-become-pass
zsh:
zsh: ## Runs the zsh ansible role
@$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="zsh" --ask-become-pass
airpods-pro-bluetooth-fix:
airpods-pro-bluetooth-fix: ## Runs the airpods-pro-bluetooth-fix ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="airpods-pro-bluetooth-fix" --ask-become-pass
appimagelauncher:
appimagelauncher: ## Runs the appimagelauncher ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="appimagelauncher" --ask-become-pass
caffeine:
caffeine: ## Runs the caffeine ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="caffeine" --ask-become-pass
code-extensions:
code-extensions: ## Runs the code-extensions ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="code-extensions" --ask-become-pass
extra-desktop-packages:
extra-desktop-packages: ## Runs the extra-desktop-packages ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="extra-desktop-packages" --ask-become-pass
extra-packages:
extra-packages: ## Runs the extra-packages ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="extra-packages" --ask-become-pass
flatpak:
flatpak: ## Runs the flatpak ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="flatpak" --ask-become-pass
liquorix:
liquorix: ## Runs the liquorix ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="liquorix" --ask-become-pass
nextcloud:
nextcloud: ## Runs the nextcloud ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="nextcloud" --ask-become-pass
snap:
snap: ## Runs the snap ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="snap" --ask-become-pass
timeshift:
timeshift: ## Runs the timeshift ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="timeshift" --ask-become-pass
ulauncher:
ulauncher: ## Runs the ulauncher ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="ulauncher" --ask-become-pass
universe-repository:
universe-repository: ## Runs the universe-repository ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="universe-repository" --ask-become-pass
wifi-powersave-mode:
wifi-powersave-mode: ## Runs the wifi-powersave-mode ansible role
@$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="wifi-powersave-mode" --ask-become-pass