You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

294 lines
8.0 KiB
Makefile

9 years ago
#
# Author: Hari Sekhon
# Date: 2016-01-17 12:56:53 +0000 (Sun, 17 Jan 2016)
#
# vim:ts=4:sts=4:sw=4:noet
#
# https://github.com/harisekhon/bash-tools
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback
#
# https://www.linkedin.com/in/harisekhon
9 years ago
#
5 years ago
include Makefile.in
5 years ago
REPO := HariSekhon/DevOps-Bash-tools
5 years ago
CODE_FILES := $(shell find . -type f -name '*.sh' -o -type f -name '.bash*' | sort)
5 years ago
5 years ago
CONF_FILES := $(shell sed "s/\#.*//; /^[[:space:]]*$$/d" setup/files.txt)
5 years ago
5 years ago
BASH_PROFILE_FILES := $(shell echo .bashrc .bash_profile .bash.d/*.sh)
5 years ago
#.PHONY: *
define MAKEFILE_USAGE
Repo specific options:
5 years ago
make install builds all script dependencies, installs AWS CLI, symlinks all config files to $$HOME and adds sourcing of bash profile
make link symlinks all config files to $$HOME and adds sourcing of bash profile
5 years ago
make unlink removes all symlinks pointing to this repo's config files and removes the sourcing lines from .bashrc and .bash_profile
5 years ago
make python-desktop installs all Python Pip packages for desktop workstation listed in setup/pip-packages-desktop.txt
make perl-desktop installs all Perl CPAN packages for desktop workstation listed in setup/cpan-packages-desktop.txt
make ruby-desktop installs all Ruby Gem packages for desktop workstation listed in setup/gem-packages-desktop.txt
make golang-desktop installs all Golang packages for desktop workstation listed in setup/go-packages-desktop.txt
5 years ago
make nodejs-desktop installs all NodeJS packages for desktop workstation listed in setup/npm-packages-desktop.txt
5 years ago
5 years ago
make desktop installs all of the above + many desktop OS packages listed in setup/
5 years ago
5 years ago
make mac-desktop all of the above + installs a bunch of major common workstation software packages like Ansible, Terraform, MiniKube, MiniShift, SDKman, Travis CI, CCMenu, Parquet tools etc.
make linux-desktop
5 years ago
make ls-scripts print list of scripts in this project, ignoring code libraries in lib/ and .bash.d/
make wc-scripts show line counts of the scripts and grand total
make wc-scripts2 show line counts of only scripts and total
5 years ago
make vim installs Vundle and plugins
make tmux installs TMUX plugin for kubernetes context
5 years ago
make ccmenu installs and (re)configures CCMenu to watch this and all other major HariSekhon GitHub repos
5 years ago
make status open the Github Status page of all my repos build statuses across all CI platforms
5 years ago
5 years ago
make aws installs AWS CLI tools
5 years ago
make azure installs Azure CLI
5 years ago
make gcp installs GCloud SDK
make gcp-shell sets up GCP Cloud Shell: installs core packages and links configs
5 years ago
(future boots then auto-install system packages via .customize_environment hook)
5 years ago
endef
5 years ago
9 years ago
.PHONY: build
5 years ago
build: init system-packages aws azure
5 years ago
@:
9 years ago
5 years ago
.PHONY: init
init:
git submodule update --init --recursive
5 years ago
.PHONY: install
5 years ago
install: build link aws
5 years ago
@:
5 years ago
5 years ago
.PHONY: uninstall
uninstall: unlink
5 years ago
@echo "Not removing any system packages for safety"
5 years ago
5 years ago
.PHONY: bash
bash: link
@:
.PHONY: link
link:
@setup/shell_link.sh
.PHONY: unlink
unlink:
@setup/shell_unlink.sh
5 years ago
5 years ago
.PHONY: mac-desktop
mac-desktop: desktop
@setup/mac_desktop.sh
5 years ago
.PHONY: linux-desktop
linux-desktop: desktop
@setup/linux_desktop.sh
5 years ago
.PHONY:
5 years ago
ccmenu:
5 years ago
@setup/configure_ccmenu.sh
.PHONY: desktop
desktop: install
@if [ -x /sbin/apk ]; then $(MAKE) apk-packages-desktop; fi
@if [ -x /usr/bin/apt-get ]; then $(MAKE) apt-packages-desktop; fi
@if [ -x /usr/bin/yum ]; then $(MAKE) yum-packages-desktop; fi
@if [ -x /usr/local/bin/brew -a `uname` = Darwin ]; then $(MAKE) homebrew-packages-desktop; fi
@# do these late so that we have the above system packages installed first to take priority and not install from source where we don't need to
5 years ago
@$(MAKE) perl-desktop
@$(MAKE) golang-desktop
5 years ago
@$(MAKE) nodejs-desktop
@# no packages any more since jgrep is no longer found
5 years ago
@#$(MAKE) ruby-desktop
.PHONY: apk-packages-desktop
apk-packages-desktop: system-packages
@echo "Alpine desktop not supported at this time"
@exit 1
.PHONY: apt-packages-desktop
apt-packages-desktop: system-packages
5 years ago
NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/apt_install_packages.sh setup/deb-packages-desktop.txt
.PHONY: yum-packages-desktop
yum-packages-desktop: system-packages
5 years ago
NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/yum_install_packages.sh setup/rpm-packages-desktop.txt
.PHONY: homebrew-packages-desktop
5 years ago
homebrew-packages-desktop: system-packages homebrew
@:
.PHONY: homebrew
homebrew: system-packages brew
@:
.PHONY: brew
brew:
5 years ago
NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/brew_install_packages.sh setup/brew-packages-desktop.txt
5 years ago
NO_FAIL=1 NO_UPDATE=1 CASK=1 $(BASH_TOOLS)/brew_install_packages.sh setup/brew-packages-desktop-casks.txt
5 years ago
NO_FAIL=1 NO_UPDATE=1 TAP=1 $(BASH_TOOLS)/brew_install_packages.sh setup/brew-packages-desktop-taps.txt
5 years ago
.PHONY: perl-desktop
5 years ago
perl-desktop: system-packages cpan
@:
.PHONY: cpan
5 years ago
cpan:: cpanm
5 years ago
@:
.PHONY: cpanm
cpanm:
NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/perl_cpanm_install_if_absent.sh setup/cpan-packages-desktop.txt
5 years ago
.PHONY: golang-desktop
5 years ago
golang-desktop: system-packages go-desktop
@:
.PHONY: go-desktop
go-desktop: system-packages go
@:
.PHONY: go
go:
NO_FAIL=1 $(BASH_TOOLS)/golang_get_install_if_absent.sh setup/go-packages-desktop.txt
5 years ago
.PHONY: ruby-desktop
5 years ago
ruby-desktop: system-packages gems
@:
.PHONY: gems
gems: gem
@:
.PHONY: gem
gem:
NO_FAIL=1 $(BASH_TOOLS)/ruby_gem_install_if_absent.sh setup/gem-packages-desktop.txt
5 years ago
.PHONY: python-desktop
5 years ago
python-desktop: system-packages pip
.PHONY: pip
5 years ago
pip::
5 years ago
./python_pip_install_if_absent.sh setup/pip-packages-desktop.txt
5 years ago
.PHONY: nodejs-desktop
nodejs-desktop: system-packages npm
.PHONY: npm
npm::
5 years ago
$(BASH_TOOLS)/nodejs_npm_install_if_absent.sh $(BASH_TOOLS)/setup/npm-packages-desktop.txt
5 years ago
.PHONY: aws
5 years ago
aws: system-packages
5 years ago
@setup/install_aws_cli.sh
5 years ago
5 years ago
.PHONY: azure
azure: system-packages
@setup/install_azure_cli.sh
5 years ago
.PHONY: gcp
gcp: system-packages
@./setup/install_gcloud.sh
5 years ago
.PHONY: gcp-shell
gcp-shell: system-packages link
5 years ago
@:
5 years ago
.PHONY: vim
vim:
setup/install_vundle.sh
5 years ago
.PHONY: tmux
tmux: ~/.tmux/plugins/kube.tmux
@:
~/.tmux/plugins/kube.tmux:
wget -O ~/.tmux/plugins/kube.tmux https://raw.githubusercontent.com/jonmosco/kube-tmux/master/kube.tmux
9 years ago
.PHONY: test
test:
5 years ago
./check_all.sh
9 years ago
9 years ago
.PHONY: clean
9 years ago
clean:
5 years ago
@rm -fv setup/terraform.zip
5 years ago
5 years ago
.PHONY: ls-scripts
ls-scripts:
@$(MAKE) ls-code | grep -v -e '/kafka_wrappers/' -e '/lib/' -e '\.bash'
5 years ago
5 years ago
.PHONY: lsscripts
lsscripts: ls-scripts
@:
.PHONY: wc-scripts
wc-scripts:
@$(MAKE) ls-scripts | xargs wc -l
5 years ago
@printf "Total Script files: "
5 years ago
@$(MAKE) ls-scripts | wc -l
5 years ago
5 years ago
.PHONY: wcscripts
wcscripts: wc-scripts
@:
.PHONY: wc-scripts2
wc-scripts2:
5 years ago
@printf "Total Scripts files: "
5 years ago
@$(MAKE) ls-scripts | wc -l
5 years ago
@printf "Total line count without # comments: "
5 years ago
@$(MAKE) ls-scripts | xargs sed 's/#.*//;/^[[:space:]]*$$/d' | wc -l
.PHONY: wcscripts2
wcscripts2: wc-scripts2
@:
5 years ago
5 years ago
.PHONY: wc-scripts3
wc-scripts3:
@$(MAKE) ls-scripts | grep -v /setup/ | xargs wc -l
@printf "Total Script files: "
@$(MAKE) ls-scripts | grep -v /setup/ | wc -l
.PHONY: wcscripts3
wcscripts3: wc-scripts3
@:
5 years ago
.PHONY: wcbashrc
wcbashrc:
@wc $(BASH_PROFILE_FILES)
@printf "Total Bash Profile files: "
@ls $(BASH_PROFILE_FILES) | wc -l
.PHONY: wcbash
wcbash: wcbashrc
@:
.PHONY: wcbashrc2
wcbashrc2:
@printf "Total Bash Profile files: "
@ls $(BASH_PROFILE_FILES) | wc -l
@printf "Total line count without # comments: "
@ls $(BASH_PROFILE_FILES) | xargs sed 's/#.*//;/^[[:space:]]*$$/d' | wc -l
.PHONY: wcbash2
wcbash2: wcbashrc2
@:
5 years ago
.PHONY: pipreqs-mapping
pipreqs-mapping:
#wget -O lib/pipreqs_mapping.txt https://raw.githubusercontent.com/HariSekhon/pipreqs/mysql-python/pipreqs/mapping
wget -O lib/pipreqs_mapping.txt https://raw.githubusercontent.com/bndr/pipreqs/master/pipreqs/mapping
.PHONY: pip-mapping
pip-mapping: pipreqs-mapping
@: