-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ca5808d
Showing
48 changed files
with
2,557 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
################################# | ||
################################# | ||
## Super Linter GitHub Actions ## | ||
################################# | ||
################################# | ||
name: Lint Code Base | ||
|
||
# | ||
# Documentation: | ||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions | ||
# | ||
|
||
############################# | ||
# Start the job on all push # | ||
############################# | ||
on: | ||
push: | ||
|
||
############### | ||
# Set the Job # | ||
############### | ||
jobs: | ||
build: | ||
# Name the Job | ||
name: Lint Code Base | ||
# Set the agent to run on | ||
runs-on: ubuntu-latest | ||
|
||
################## | ||
# Load all steps # | ||
################## | ||
steps: | ||
########################## | ||
# Checkout the code base # | ||
########################## | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
# Full git history is needed to get a proper list of changed files within `super-linter` | ||
fetch-depth: 0 | ||
|
||
################################ | ||
# Run Linter against code base # | ||
################################ | ||
- name: Lint Code Base | ||
uses: github/super-linter/slim@v4 | ||
env: | ||
VALIDATE_ALL_CODEBASmac-dev-playbook/tasks/packages.yml: false | ||
DEFAULT_BRANCH: master | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.retry | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
|
||
.PHONY: super-linter | ||
super-linter: | ||
docker run -e RUN_LOCAL=true -v $$(pwd):/tmp/lint github/super-linter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# MacOS Ansible Playbook | ||
|
||
This an Ansible Playbook to provision and customize my development environment on OSX. | ||
|
||
## What does this playbook provide ? | ||
|
||
It will : | ||
* create useful directories. | ||
* install packages (brew taps, asdf, npm, etc). | ||
* copy dotfiles which configure various applications (Git, npm, terraform, asdf) into your home dir. | ||
* copy in some zsh scripts (configurations, helper functions, aliases, etc) | ||
|
||
## Install Instructions | ||
|
||
* checkout this repo to `~/src/macos-devenv-ansible-provisioner`. | ||
* copy `roles/mac-dev-playbook/files/ansible/ansible.cfg` to `~/.ansible.cfg` | ||
* Create file `inventory` @ `~/.ansible/inventory` e.g. | ||
|
||
```text | ||
[localhost] | ||
yourMacHostName gpg_key=${your-local-gpg-key} | ||
``` | ||
* then go to `~/src/macos-devenv-ansible-provisioner`. | ||
* run `ansible-playbook main.yml --diff --verbose --inventory ~/.inventory --limit $(hostname)`. | ||
|
||
## Manual configurations | ||
|
||
* Configure iTerm2 <https://apple.stackexchange.com/questions/136928/using-alt-cmd-right-left-arrow-in-iterm> | ||
|
||
|
||
## Can I use it ? | ||
|
||
Use at your own risk, this playbook doesn't aim to be used by anyone else. Please be sure to backup your current ~/.zshrc.rc file before executing this play-book ( as it will be overwritten with one from this repo) | ||
|
||
### asdf : install all plugins at once | ||
|
||
```shell | ||
cut -d ' ' -f1 .tool-versions | xargs -I _ asdf plugin-add _ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- hosts: localhost | ||
connection: local | ||
roles: | ||
- mac-dev-playbook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
|
||
homebrew_taps: | ||
- homebrew/core | ||
- wagoodman/dive | ||
- hashicorp/tap | ||
|
||
homebrew_absent_packages: | ||
- tfenv | ||
# - kubernetes-cli | ||
- conftest | ||
- hub | ||
- krew | ||
- yq # use python-yq instead | ||
|
||
homebrew_installed_packages: | ||
# - ansible # Installed via Pip. | ||
- adr-tools | ||
- autojump | ||
- antigen # package manager for zsh | ||
- asdf # asdf is package manager | ||
- bash | ||
- bash-completion | ||
- bat # cat with wings | ||
- bats # Bats is a Batch Test Suite | ||
- direnv # augments existing shells with a new feature that can load and unload environment variables depending on the current directory. | ||
- k9s # k9s is a Kubernetes CLI | ||
- dive # Tools to explore docker layers with an UI | ||
- dos2unix # Convert files from DOS to Unix format | ||
- fluxcd/tap/flux # Flux is a Kubernetes Helm chart manager | ||
- git # Git is a version control system | ||
- github/gh/gh # GitHub CLI | ||
- go | ||
- gnu-sed # GNU version of sed | ||
- gnupg # gnupg is a tool for managing GnuPG keys | ||
- graphviz # Graphviz is a graph visualization tool | ||
- gpg-suite-no-mail # For signing commits | ||
- hashicorp/tap/terraform-ls # terraform-ls is a terraform plugin for vscode | ||
- hashicorp/tap/waypoint # waypoint | ||
# There is a bug, install it manually | ||
#- homebrew/cask-fonts/font-hack-nerd-font | ||
- highlight # Syntax highlighting for your terminal | ||
- npm | ||
- node | ||
- nvm # Node Version Manager | ||
- openssl # OpenSSL is a toolkit for implementing SSL/TLS | ||
- pigz # gzip with parallel support | ||
- jq # jq is a lightweight and flexible command-line JSON processor | ||
- tree # tree is a directory listing utility | ||
- vault # Vault is a tool for managing secrets | ||
- wget # wget is a command line downloader | ||
- python-yq # python-yq | ||
- zsh # zsh is a shell interpreter for interactive programs and scripts | ||
|
||
homebrew_cask_apps: | ||
# - firefox # Firefox is a web browser | ||
- google-cloud-sdk # Google Cloud SDK is a command-line interface for Google Cloud Platform | ||
- iterm2 # iTerm2 is a terminal replacement | ||
- intellij-idea # IntelliJ IDEA is a Java IDE | ||
- keystore-explorer # Keystore Explorer is a tool for managing Java keystores | ||
- visual-studio-code # Visual Studio Code is a code editor | ||
- vlc # VLC is a free and open source cross-platform multimedia player and framework | ||
|
||
npm_installed_packages: | ||
- tldr | ||
- yarn | ||
- meta | ||
|
||
# FIXME Use directly .tool-versions | ||
asdf_plugins: | ||
- { name: terraform } | ||
- { name: kubectl } | ||
- { name: terraform-docs } | ||
- { name: conftest } | ||
- { name: terraform-validator } | ||
- { name: fluxctl } | ||
- { name: hub } | ||
|
||
pip_packages: | ||
# - aiven-client # https://aiven.io/ | ||
- cookiecutter | ||
- howdoi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.8.9 |
26 changes: 26 additions & 0 deletions
26
roles/mac-dev-playbook/files/.zshrc.d/_oh-my-zsh-plugins.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env zsh | ||
|
||
# Plugins are listed here https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins | ||
plugins=( | ||
asdf | ||
autojump | ||
colored-man-pages | ||
colorize | ||
common-aliases | ||
cp | ||
docker | ||
docker-compose | ||
fzf | ||
gcloud | ||
gh | ||
git | ||
helm | ||
iterm2 | ||
kube-ps1 | ||
kubectl | ||
last-working-dir | ||
macos | ||
terraform | ||
web-search | ||
zsh-interactive-cd | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env zsh | ||
|
||
### FileSearch ### | ||
function f() { find . -iname "*$1*" ${@:2} } | ||
function r() { grep "$1" ${@:2} -R . } | ||
|
||
### mkdir and cd ### | ||
function mkcd() { mkdir -p "$@" && cd "$_"; } | ||
|
||
function runans() { | ||
ansible-playbook main.yml --diff --verbose --limit $(hostname) | ||
} | ||
|
||
alias cd..="cd .." | ||
alias ..="cd .." | ||
|
||
function cheat(){ | ||
echo "gitcheat" | ||
echo "syscheat" | ||
echo "syscheat" | ||
echo "k8scheat" | ||
echo "shellcheat" | ||
echo "gitmess" | ||
echo "good-readme" | ||
} | ||
|
||
alias gitcheat="cat ~/git-cheat-sheet.txt" | ||
alias syscheat="cat ~/sys-cheat-sheet.txt" | ||
alias osxcheat="cat ~/osx-cheat-sheet.txt" | ||
alias k8scheat="cat ~/k8s-cheat-sheet.txt" | ||
alias shellcheat="cat ~/shell-cheat-sheet.md" | ||
alias gitmess="cat ~/.gitmessage" | ||
alias zshshortcut="open http://www.geekmind.net/2011/01/shortcuts-to-improve-your-bash-zsh.html" | ||
alias good-readme="open https://github.com/othneildrew/Best-README-Template" | ||
|
||
# Makefile | ||
alias m="make" | ||
|
||
# Howdoi | ||
alias hdi="howdoi -c -n 2" | ||
|
||
# highlight | ||
alias yaml="highlight --force --syntax yaml" | ||
|
||
# Notify | ||
alias notify='osascript -e "display notification \"Script finished\" with title \"Over\""' | ||
alias n=notify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env zsh | ||
|
||
# Had to add this to get asdf to work on my mac | ||
|
||
source $(brew --prefix asdf)/libexec/asdf.sh | ||
|
||
## some packages to install | ||
# conftest | ||
# flux2 | ||
# fluxctl | ||
# helm | ||
# hub | ||
# kubectl | ||
# shellcheck | ||
# shfmt | ||
# terraform | ||
# terraform-docs | ||
# terraform-validator | ||
|
||
## Some functions to help | ||
function _asdf_install_plugin() { | ||
local ASDF_TOOLS_VERSIONS_FILENAME="$HOME/.tool-versions" | ||
for plugin in $(awk '{print $1}' ${ASDF_TOOLS_VERSIONS_FILENAME}); do \ | ||
asdf plugin add $plugin || true; \ | ||
done | ||
} | ||
|
||
function asdf_install_version() { | ||
_asdf_install_plugin | ||
local ASDF_TOOLS_VERSIONS_FILENAME="$HOME/.tool-versions" | ||
cat ${ASDF_TOOLS_VERSIONS_FILENAME} | while read -r plugin version; do \ | ||
asdf install ${plugin} ${version}; \ | ||
done | ||
} | ||
|
||
## Enable poetry | ||
|
||
export PATH="$HOME/.asdf/installs/poetry/1.1.13/bin:$PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env zsh | ||
|
||
#alias j='autojump' | ||
|
||
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env zsh | ||
|
||
# Add coreutils to PATH | ||
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env zsh | ||
|
||
eval "$(direnv hook zsh)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env zsh | ||
|
||
export DOCKER_HOST="unix:///var/run/docker.sock" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env zsh | ||
|
||
#### Paths ### | ||
export PATH="$PATH:/usr/local/share/python:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" | ||
export REPOS=$HOME/src | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env zsh | ||
|
||
alias gclo="gcloud" | ||
alias gcloalu="gcloud auth login --update-adc" | ||
|
||
# Autocompletion | ||
source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc' | ||
source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env zsh | ||
|
||
alias browse="g config --get remote.origin.url | gsed -r -e 's/git@github\.com:(\w+)\/(.*)(:\.git)?/https:\/\/github.com\/\1\/\2/g' | xargs open" | ||
|
||
alias gcml="gcm && gl" | ||
|
||
### Editor ### | ||
export EDITOR='code --wait' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env zsh | ||
|
||
eval "$(gh completion --shell zsh)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env zsh | ||
|
||
export GUILE_TLS_CERTIFICATE_DIRECTORY=/usr/local/etc/gnutls/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env zsh | ||
|
||
export PATH=$PATH:~/go/bin | ||
export GOROOT=/usr/local/opt/go/libexec | ||
export GOPATH=~/go/ | ||
export GO111MODULE=on | ||
|
||
alias got="go test" | ||
alias gotv="go test -cover" | ||
alias golang="howdoi golang" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env zsh | ||
|
||
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env zsh | ||
|
||
alias kst="kustomize" | ||
alias kstb="kst build" | ||
alias kstc="kst create" | ||
alias kste="kst edit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env zsh | ||
|
||
alias mgu="meta git update" | ||
alias mgp="meta git pull" | ||
alias mgup="gl && mgu && mgp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env zsh | ||
|
||
export PATH="$HOME/.npm-packages/bin:$PATH" |
Oops, something went wrong.