Compare commits

...

17 Commits

Author SHA1 Message Date
MorganGeek
3738f1cb7b skip interactive vim install 2020-07-05 08:52:38 +02:00
MorganGeek
d5a5a180a3 split bootstrap logic 2020-07-05 08:45:22 +02:00
MorganGeek
74319d622c load global git config early 2020-07-03 12:10:57 +02:00
MorganGeek
7fde8a6578 redirect github https urls 2020-07-03 12:09:33 +02:00
MorganGeek
d03e4f65b8 reduce code duplication for detecting macos 2020-07-03 11:38:59 +02:00
MorganGeek
12df752a95 always exclude gitignore 2020-07-03 11:33:04 +02:00
MorganGeek
1b5dbc0aa8 use env variables to find home folder 2020-07-03 11:31:33 +02:00
MorganGeek
967fd46455 apps setup must occur first 2020-07-03 11:30:44 +02:00
MorganGeek
2aed87a6ec GitHub Actions cannot access app store 2020-07-03 11:28:11 +02:00
MorganGeek
8bc12c4a70 force using Code folder inside home dir 2020-06-29 18:45:59 +02:00
MorganGeek
068ed6a9b3 force using Code folder inside home dir 2020-06-29 18:42:57 +02:00
MorganGeek
57cae533b4 force using Code folder inside home dir 2020-06-29 18:38:51 +02:00
MorganGeek
d02cd7d932 force using Code folder inside home dir 2020-06-29 18:36:16 +02:00
MorganGeek
410650677c force using $HOME folder as base dir 2020-06-29 18:26:36 +02:00
MorganGeek
adf6be522b fix git checkout path 2020-06-29 18:07:39 +02:00
MorganGeek
eb2d11966f fix GitHub CI syntax for checkout path 2020-06-29 18:05:51 +02:00
MorganGeek
e299ebef7e add GitHub CI pipeline 2020-06-29 18:00:46 +02:00
5 changed files with 281 additions and 201 deletions

21
.github/workflows/test.yaml vendored Normal file
View File

@ -0,0 +1,21 @@
on: [push]
name: CI
jobs:
build_and_test:
runs-on: macos-latest
steps:
- uses: actions/checkout@master
- name: Mimic
shell: bash
run: |
ln -snf /Users/runner/work/dotfiles ~/Code
- name: Run bootstrap
shell: bash
run: |
~/Code/dotfiles/dot_scripts/bootstrap.sh
env:
REPO: ${{github.workspace}}
DOTFILES_REF: ${{github.sha}}
HOMEBREW_BUNDLE_BREW_SKIP: "node"

View File

@ -59,12 +59,16 @@ cask "wireshark"
cask "font-hack-nerd-font" # provides fonts used by vim-devicons https://vimawesome.com/plugin/vim-devicons https://github.com/ryanoasis/nerd-fonts#font-installation cask "font-hack-nerd-font" # provides fonts used by vim-devicons https://vimawesome.com/plugin/vim-devicons https://github.com/ryanoasis/nerd-fonts#font-installation
# Mac app store # Mac app store
# Github actions cannot install these.
unless ENV.has_key?('CI') then
mas '1Password', id:1333542190
mas 'Keynote', id: 409183694 mas 'Keynote', id: 409183694
mas 'iMovie', id: 408981434 mas 'iMovie', id: 408981434
mas 'Microsoft Remote Desktop', id: 1295203466 mas 'Microsoft Remote Desktop', id: 1295203466
mas 'Pages', id: 409201541 mas 'Pages', id: 409201541
mas 'GarageBand', id: 682658836 mas 'GarageBand', id: 682658836
mas 'Numbers', id: 409203825 mas 'Numbers', id: 409203825
end
brew "zsh" brew "zsh"
brew "git-ftp" brew "git-ftp"
@ -105,8 +109,12 @@ brew "htop"
brew "moreutils" brew "moreutils"
brew "asciidoc" brew "asciidoc"
brew "bash-snippets" brew "bash-snippets"
# Mac App Store command line interface
brew "mas" # Github actions cannot install these.
unless ENV.has_key?('CI') then
brew "mas" # Mac App Store command line interface
end
# Using pyenv to be able to install specific python versions https://stackoverflow.com/questions/49794432/how-to-setup-a-pipenv-python-3-6-project-if-os-python-version-is-3-5 # Using pyenv to be able to install specific python versions https://stackoverflow.com/questions/49794432/how-to-setup-a-pipenv-python-3-6-project-if-os-python-version-is-3-5
brew "pyenv" brew "pyenv"
# Google CLI https://github.com/jarun/googler # Google CLI https://github.com/jarun/googler

View File

@ -27,8 +27,11 @@
[help] [help]
autocorrect = -1 # not more git psuh autocorrect = -1 # not more git psuh
[init] [init]
templateDir = /Users/morganwattiez/.git-template templateDir = ~/.git-template
[core] [core]
pager = diff-so-fancy | less --tabs=4 -RFX pager = diff-so-fancy | less --tabs=4 -RFX
excludesfile = ~/.gitignore
[diff] [diff]
noprefix = true noprefix = true
[url "git@github.com:"]
insteadOf = https://github.com/

View File

@ -3,50 +3,62 @@
echo "Hello $(whoami)! Let's get you set up." echo "Hello $(whoami)! Let's get you set up."
echo "create vim directory is missing"
mkdir -vp "$HOME/.vim"
echo "mkdir -p $HOME/Code" echo "mkdir -p $HOME/Code"
mkdir -p ~/Code mkdir -p ~/Code
ln -snf ~/Code/dotfiles/dot_scripts ~/.scripts ln -snf ~/Code/dotfiles/dot_scripts ~/.scripts
ln -snf ~/Code/dotfiles/dot_gitconfig ~/.gitconfig
chmod +x ~/.scripts/*.sh chmod +x ~/.scripts/*.sh
if [[ $(uname) == "Linux" ]]; then
IS_LINUX=true
else
IS_LINUX=false
fi
if [[ $(uname) == "Darwin" ]]; then
IS_MAC=true
else
IS_MAC=false
fi
# Install missing package (Linux) # Install missing package (Linux)
case "$(uname -s)" in function installLinuxPackages() {
Linux) if [ "$IS_LINUX" = true ]; then
echo "(Linux) Installing Development Tools" echo "(Linux) Installing Development Tools"
yum install sudo -y yum install sudo -y
sudo yum groupinstall 'Development Tools' -y sudo yum groupinstall 'Development Tools' -y
sudo yum install git which zip unzip ruby curl file docker gcc make libxcrypt-compat vim-enhanced -y sudo yum install git which zip unzip ruby curl file docker gcc make libxcrypt-compat vim-enhanced -y
;; fi
esac }
# Install HomeBrew # Install HomeBrew
case "$(uname -s)" in function installBrew() {
Darwin) if [ "$IS_MAC" = true ]; then
echo "(Mac OS X) installing homebrew" echo "(Mac OS X) installing homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Prevent `Error: Your Homebrew is outdated. Please run `brew update`.` # Prevent `Error: Your Homebrew is outdated. Please run `brew update`.`
echo "Updating Homebrew" echo "Updating Homebrew"
brew update brew update
;;
esac
# Path to ruby # Path to ruby
export PATH="/usr/local/opt/ruby/bin:$PATH" export PATH="/usr/local/opt/ruby/bin:$PATH"
fi
}
# Create symbolic links # Create symbolic links
function createSymbolicLinks() {
echo "Creating symbolic links" echo "Creating symbolic links"
ln -snf ~/Code/dotfiles/dot_profile ~/.profile ln -snf ~/Code/dotfiles/dot_profile ~/.profile
ln -snf ~/.local/share/chezmoi/ ~/dotfiles ln -snf ~/.local/share/chezmoi/ ~/dotfiles
ln -snf ~/Code/dotfiles/Gemfile ~/Gemfile ln -snf ~/Code/dotfiles/Gemfile ~/Gemfile
ln -snf ~/Code/dotfiles/README.md ~/README.md ln -snf ~/Code/dotfiles/README.md ~/README.md
ln -snf ~/Code/dotfiles/dot_bash_profile ~/.bash_profile ln -snf ~/Code/dotfiles/dot_bash_profile ~/.bash_profile
ln -snf ~/Code/dotfiles/dot_gitconfig ~/.gitconfig
ln -snf ~/Code/dotfiles/dot_macos ~/.macos ln -snf ~/Code/dotfiles/dot_macos ~/.macos
ln -snf ~/Code/dotfiles/dot_scripts ~/.scripts
ln -snf ~/Code/dotfiles/dot_scripts/checkci.sh /usr/local/bin/checkci ln -snf ~/Code/dotfiles/dot_scripts/checkci.sh /usr/local/bin/checkci
ln -snf ~/Code/dotfiles/dot_vimrc ~/.vimrc ln -snf ~/Code/dotfiles/dot_vimrc ~/.vimrc
# custom linters ln -snf ~/Code/dotfiles/dot_vim/ale_linters ~/.vim/ale_linters # custom linters
ln -snf ~/Code/dotfiles/dot_vim/ale_linters ~/.vim/ale_linters
ln -snf ~/Code/dotfiles/dot_zsh_aliases ~/.zsh_aliases ln -snf ~/Code/dotfiles/dot_zsh_aliases ~/.zsh_aliases
ln -snf ~/Code/dotfiles/dot_zsh_functions ~/.zsh_functions ln -snf ~/Code/dotfiles/dot_zsh_functions ~/.zsh_functions
ln -snf ~/Code/dotfiles/dot_zshrc ~/.zshrc ln -snf ~/Code/dotfiles/dot_zshrc ~/.zshrc
@ -58,43 +70,44 @@ ln -snf ~/Code/dotfiles/private_dot_3llo/config.sh ~/.3llo_config
ln -snf ~/Code/dotfiles/dot_ansiweatherrc ~/.ansiweatherrc ln -snf ~/Code/dotfiles/dot_ansiweatherrc ~/.ansiweatherrc
ln -snf ~/Code/dotfiles/dot_p10k.zsh ~/.p10k.zsh ln -snf ~/Code/dotfiles/dot_p10k.zsh ~/.p10k.zsh
ln -snf ~/Code/dotfiles/dot_git-template ~/.git-template ln -snf ~/Code/dotfiles/dot_git-template ~/.git-template
}
# Other symblinks + Install Docker Desktop for Mac
case "$(uname -s)" in
Darwin)
echo "(Mac OS X) Adding symbolic links"
ln -snf "$HOME/.config/Code/User/settings.json" "$HOME/Library/Application Support/Code/User/settings.json"
ln -snf "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Mackup/Library/Application Support/Code/User/snippets" "$HOME/Library/Application Support/Code/User/snippets"
ln -snf "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Mackup/.mackup.cfg" "$HOME/.mackup.cfg"
echo "(Mac OS X) Installing Docker"
~/.scripts/install_docker_for_mac.sh
;;
esac
# Install dependencies (apps, fonts, ...) with Brew # Install dependencies (apps, fonts, ...) with Brew
case "$(uname -s)" in function installMacSoftware() {
Darwin) if [ "$IS_MAC" = true ]; then
echo "(Mac OS X) Installing Docker"
~/.scripts/install_docker_for_mac.sh
echo "(Mac OS X) Brew installing stuff (apps, fonts, ...)" echo "(Mac OS X) Brew installing stuff (apps, fonts, ...)"
ln -snf ~/Code/dotfiles/Brewfile ~/Brewfile ln -snf ~/Code/dotfiles/Brewfile ~/Brewfile
brew bundle brew bundle
;; # Configure Mac specific symbolic links
esac echo "(Mac OS X) Adding symbolic links"
mkdir -pv "$HOME/Library/Application Support/Code/User/snippets"
ln -snf "$HOME/.config/Code/User/settings.json" "$HOME/Library/Application Support/Code/User/settings.json"
ln -snf "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Mackup/Library/Application Support/Code/User/snippets" "$HOME/Library/Application Support/Code/User/snippets"
ln -snf "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Mackup/.mackup.cfg" "$HOME/.mackup.cfg"
fi
}
# Install dependencies (apps, fonts, ...) for CentOS # Install dependencies (apps, fonts, ...) for CentOS
case "$(uname -s)" in function installLinuxSoftware() {
Linux) if [ "$IS_LINUX" = true ]; then
echo "(CentOS) Installing stuff (apps, ...)" echo "(CentOS) Installing stuff (apps, ...)"
chmod +x ~/Code/dotfiles/centos.sh chmod +x ~/Code/dotfiles/centos.sh
~/Code/dotfiles/centos.sh ~/Code/dotfiles/centos.sh
;; fi
esac }
# Switch to ZSH # Switch to ZSH
function switchToZsh() {
sudo -v
echo "switching to ZSH" echo "switching to ZSH"
command -v zsh >>/etc/shells command -v zsh >>/etc/shells
chsh -s "$(command -v zsh)" chsh -s "$(command -v zsh)"
}
# Use SDKMan to install development tools # Use SDKMan to install development tools
function installSDKMan() {
echo "Installing SDKMan as development tools manager" echo "Installing SDKMan as development tools manager"
curl -s "https://get.sdkman.io" | bash curl -s "https://get.sdkman.io" | bash
@ -105,9 +118,9 @@ sdk install java 8.0.222-zulu
sdk install kotlin sdk install kotlin
echo "SDKMan updating" echo "SDKMan updating"
sdk selfupdate sdk selfupdate
}
case "$(uname -s)" in function installRubyOnLinux() {
Linux) if [ "$IS_LINUX" = true ]; then
echo '(Linux) Installing ruby' echo '(Linux) Installing ruby'
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import - curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
@ -116,15 +129,18 @@ Linux)
rvm reload rvm reload
rvm requirements run rvm requirements run
rvm install 2.3.7 rvm install 2.3.7
;; fi
esac }
# Install bundler for managing ruby dependencies and Gemfile # Install bundler for managing ruby dependencies and Gemfile
function installBundler() {
echo "Installing bundler for managing ruby dependencies and Gemfile" echo "Installing bundler for managing ruby dependencies and Gemfile"
sudo gem install bundler sudo gem install bundler
bundle install bundle install
}
# Install Oh My Zsh and some cool dependencies # Install Oh My Zsh and some cool dependencies
function installOhMyZsh() {
echo "Installing Oh My Zsh + customizing themes and plugins" echo "Installing Oh My Zsh + customizing themes and plugins"
echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' ~/.zshrc >>! echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' ~/.zshrc >>!
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
@ -133,49 +149,54 @@ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_CUSTOM/
git clone https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM/plugins/zsh-autosuggestions" git clone https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM/plugins/zsh-autosuggestions"
ln -snf ~/Code/dotfiles/dot_zshrc ~/.zshrc ln -snf ~/Code/dotfiles/dot_zshrc ~/.zshrc
ln -snf ~/Code/dotfiles/dot_zshrc.pre-oh-my-zsh ~/.zshrc.pre-oh-my-zsh ln -snf ~/Code/dotfiles/dot_zshrc.pre-oh-my-zsh ~/.zshrc.pre-oh-my-zsh
}
function installVimPlugins() {
echo "Installing Vundle + VIM Plugins" echo "Installing Vundle + VIM Plugins"
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim +PluginInstall +qall >/dev/null vim +'PluginInstall --sync' +qa >/dev/null
#https://github.com/ycm-core/YouCompleteMe/blob/master/README.md#installation #https://github.com/ycm-core/YouCompleteMe/blob/master/README.md#installation
cd "$HOME/.vim/bundle/YouCompleteMe" || exit cd "$HOME/.vim/bundle/YouCompleteMe" || exit
./install.py --all ./install.py --all
cd "$HOME" || exit cd "$HOME" || exit
git clone https://github.com/dbeniamine/cheat.sh-vim.git ~/.vim/cheat.sh-vim git clone https://github.com/dbeniamine/cheat.sh-vim.git ~/.vim/cheat.sh-vim
}
# Install no-more-secrets # Install no-more-secrets
function installNoMoreSecrets() {
echo "Installing no-more-secrets (for fun)" echo "Installing no-more-secrets (for fun)"
git clone https://github.com/bartobri/no-more-secrets.git ~/Code/no-more-secrets git clone https://github.com/bartobri/no-more-secrets.git ~/Code/no-more-secrets
cd "$HOME/Code/no-more-secrets" || exit cd "$HOME/Code/no-more-secrets" || exit
make nms sneakers make nms sneakers
sudo make install sudo make install
cd "$HOME" || exit cd "$HOME" || exit
}
# OSX Defaults # OSX Defaults
case "$(uname -s)" in function overrideMacOsDefaults() {
Darwin) if [ "$IS_MAC" = true ]; then
echo "(Mac OS X) Loading preferences" echo "(Mac OS X) Loading preferences"
sudo sh .macos sudo sh .macos
;; fi
esac }
# Customize /etc/hosts # Customize /etc/hosts
function overrideEtcHosts() {
echo "Overriding /etc/hosts" echo "Overriding /etc/hosts"
curl https://someonewhocares.org/hosts/hosts -o /etc/hosts curl https://someonewhocares.org/hosts/hosts -o /etc/hosts
}
function installSoftware() {
# Install pip and pipenv # Install pip and pipenv
echo "Installing pip and pipenv" echo "Installing pip and pipenv"
sudo easy_install pip sudo easy_install pip
sudo pip install --upgrade pip sudo pip install --upgrade pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3 get-pip.py sudo python3 get-pip.py
case "$(uname -s)" in if [ "$IS_MAC" = true ]; then
Darwin)
echo "(Mac OS X) Updating PATH for loading pip user installed packages" echo "(Mac OS X) Updating PATH for loading pip user installed packages"
ln -snf /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin/pip pip3 ln -snf /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin/pip pip3
export PATH="$PATH:/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/bin/:/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin" export PATH="$PATH:/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/bin/:/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin"
;; fi
esac
echo "Upgrading pip" echo "Upgrading pip"
sudo pip install --upgrade pip sudo pip install --upgrade pip
echo "Pip installing stuff" echo "Pip installing stuff"
@ -226,12 +247,39 @@ go get -u -v github.com/camptocamp/terraboard
sudo curl -L git.io/scope -o /usr/local/bin/scope sudo curl -L git.io/scope -o /usr/local/bin/scope
sudo chmod a+x /usr/local/bin/scope sudo chmod a+x /usr/local/bin/scope
#scope launch }
# Upgrade # Upgrade
function upgradeSoftware() {
echo "Upgrading apps" echo "Upgrading apps"
~/.scripts/upgrade.sh ~/.scripts/upgrade.sh
}
# Reload # Reload
function reloadConfig() {
echo "Reloading config" echo "Reloading config"
~/.scripts/reload.sh ~/.scripts/reload.sh
}
function doIt() {
installLinuxPackages;
installBrew;
createSymbolicLinks;
installMacSoftware;
installLinuxSoftware;
switchToZsh;
installSDKMan;
installRubyOnLinux;
installBundler;
installOhMyZsh;
installVimPlugins;
installNoMoreSecrets;
overrideMacOsDefaults;
overrideEtcHosts;
installSoftware;
upgradeSoftware;
reloadConfig;
}
doIt;

View File

@ -1,4 +1,4 @@
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="/Users/morganwattiez/.sdkman" export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "/Users/morganwattiez/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/morganwattiez/.sdkman/bin/sdkman-init.sh" [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"