-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
78 lines (63 loc) · 2.51 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
default: help
PROJECT_LOCATION=.
.PHONY: create_tarball
create_tarball: ## Create a tarball from local repository
@tar \
--exclude='./.git' \
--exclude='./.github' \
--exclude='test_data/' \
--exclude='docs-site/' \
--exclude='formula.rb' \
--exclude='dotfiles-cli.tar.gz' \
-zcf dotfiles-cli.tar.gz \
. > /dev/null 2>&1
.PHONY: install_from_respository
install_from_respository: create_tarball ## Install a local dotfiles CLI from this repository
@LOCAL_ARCHIVE_FILEPATH=$(CURDIR)/dotfiles-cli.tar.gz ./install.sh
@rm -rf $(CURDIR)/dotfiles-cli.tar.gz
.PHONY: uninstall
uninstall: ## Uninstall a local dotfiles CLI
@./uninstall.sh
.PHONY: release_version_create
release_version_create: create_tarball ## Create release tag in GitHub with version from resources/version.txt
@sh -c "'$(CURDIR)/external/shell_scripts_lib/github/release.sh' \
'action: create' \
'version_file_path: ./resources/version.txt' \
'artifact_file_path: dotfiles-cli.tar.gz' \
'debug'"
@rm -rf $(CURDIR)/dotfiles-cli.tar.gz
.PHONY: release_version_delete
release_version_delete: ## Enter a tag to delete its attached release tag from GitHub
@sh -c "'$(CURDIR)/external/shell_scripts_lib/github/release.sh' \
'action: delete' \
'debug'"
.PHONY: calculate_sha_by_commit_hash
calculate_sha_by_commit_hash: ## Enter a commit to get its SHA hash
@sh -c "'$(CURDIR)/external/shell_scripts_lib/github/sha_calculator.sh' \
'sha_source: commit-hash' \
'repository_url: https://github.com/ZachiNachshon/dotfiles-cli'"
.PHONY: calculate_sha_by_tag
calculate_sha_by_tag: ## Enter a tag to get its SHA hash
@sh -c "'$(CURDIR)/external/shell_scripts_lib/github/sha_calculator.sh' \
'sha_source: tag' \
'repository_url: https://github.com/ZachiNachshon/dotfiles-cli' \
'asset_name: dotfiles-cli.tar.gz'"
# http://localhost:9001/dotfiles-cli/
.PHONY: serve_docs_site
serve_docs_site: ## Run a local site
@cd docs-site && npm run docs-serve
# http://192.168.x.xx:9001/
.PHONY: serve_docs_site_lan
serve_docs_site_lan: ## Run a local site (open for LAN)
@cd docs-site && npm run docs-serve-lan
.PHONY: test
test: ## Run tests suite
@sh -c "$(CURDIR)/dotfiles_test.sh"
.PHONY: fmt
fmt: ## Format shell scripts using shfmt bash style (https://github.com/mvdan/sh)
@sh -c "'$(CURDIR)/external/shell_scripts_lib/runner/shfmt/shfmt.sh' \
'working_dir: $(CURDIR)' \
'shfmt_args: -w -ci -i=2 -ln=bash $(CURDIR)' \
'debug'"
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'