Compare commits

..

No commits in common. "383e96efec17a907b6586cbc3c2b098e4c849a89" and "07d93ee063c5d329024d6ecb9c0e6072be95152b" have entirely different histories.

9 changed files with 21 additions and 40 deletions

View File

@ -7,6 +7,7 @@ format = """\
$git_commit\
$git_state\
$git_status\
$aws\
$kubernetes\
$helm\
$golang\
@ -43,8 +44,6 @@ format = '[$symbol$context \($namespace\)]($style) '
symbol = "ﴱ "
style = "bold blue"
disabled = false
[kubernetes.context_aliases]
"gs-(?P<cluster>.+)" = "$cluster [MC]"
[terraform]
format = "[$symbol$version]($style) "

View File

@ -7,12 +7,12 @@ plugins=(
zsh-autosuggestions
)
autoload -U compinit && compinit
fpath=($fpath ~/.zsh/completion)
DISABLE_UNTRACKED_FILES_DIRTY="true"
SHOW_AWS_PROMPT=false
source $ZSH/oh-my-zsh.sh
source `brew --prefix switch`/switch.sh
# History
HISTFILE="$HOME/.zsh_history"

View File

@ -24,8 +24,6 @@ alias bandwhich='sudo bandwhich'
alias top='btm'
alias ps='procs'
alias dig='dog'
alias kubectx='switch'
alias kctx='switch'
alias machine-info='macchina -t Boron --bar'
alias watch='watch '
@ -41,11 +39,7 @@ lt() {
}
alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY amazon/aws-cli'
git() {
if [ "$1" = "take" ]; then
/usr/local/bin/git clone $2
cd $(basename $2 | sed 's/\.git$//')
else
/usr/local/bin/git $@
fi
git-clone() {
git clone $1
cd "$(basename "$1" .git)"
}

View File

@ -1,7 +1,6 @@
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/goworkspace/bin:$HOME/.cargo/bin:/usr/local/kubebuilder/bin:$HOME/.asdf/shims"
export EDITOR='vim'
export VISUAL='code'
export GPG_TTY=$(tty)
# AWS
if [ -f ~/.aws/profile ]; then

View File

@ -1,5 +1,4 @@
alias k='kubectl '
alias kgs='kubectl-gs '
alias kshell='kubectl run -it shell --image bash --restart Never --rm -- sh'
kiam () {
@ -71,6 +70,12 @@ kube-forward() {
source <(kubectl completion zsh)
## Merge multiple kubeconfigs
function join_by { local d=$1; shift; echo -n "$1"; shift; printf "%s" "${@/#/$d}"; }
KUBECONFIG="$HOME/.kube/config"
OTHER_CLUSTERS="$(join_by :$HOME/.kube/clusters/ $(echo $HOME/.kube/clusters/$(/bin/ls $HOME/.kube/clusters)))"
export KUBECONFIG=$KUBECONFIG:$OTHER_CLUSTERS
## Kubectl exec
kx () {
local pod=($(kubectl get pods --all-namespaces -owide | fzf | awk '{print $1, $2}'))
@ -94,6 +99,13 @@ kall () {
kubectl get all --all-namespaces
}
kctx () {
KUBECONFIG="$HOME/.kube/config"
OTHER_CLUSTERS="$(join_by :$HOME/.kube/clusters/ $(echo $HOME/.kube/clusters/$(ls $HOME/.kube/clusters)))"
export KUBECONFIG=$KUBECONFIG:$OTHER_CLUSTERS
kubectx $@
}
k-version-test() {
VERSION=""
FILES=""

View File

@ -1,9 +1,5 @@
[user]
name = Marcus Noble
signingkey = B8F2DB8A7AEBAF78
[commit]
gpgsign = true
[core]
editor = /usr/bin/vim
@ -30,9 +26,8 @@
org-name = "!git remote -v | grep -m 1 -o ':.*/' | sed 's:^.\\(.*\\).$:\\1:'"
branch-name = "!git rev-parse --abbrev-ref HEAD"
changelog-changed = "!test $(git diff --name-only HEAD origin/$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') | grep CHANGELOG.md | wc -l | xargs) = 1"
main-branch = "!git remote show origin|grep HEAD|sed 's/.* //'"
main = "!git remote set-head origin --auto && git checkout $(git main-branch) && git pull"
main = "!git remote set-head origin --auto && git checkout $(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') && git pull"
publish = "!func(){ if [[ $(git branch-name) != \"$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')\" ]]; then git push -u origin $(git branch-name) && (git changelog-changed || echo '\n\n⚠ Dont forget to update changelog ⚠️ ') ; else echo "Wat?!"; fi; }; func"
cleanup = "!git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done"
dont-change-file = "!git update-index --assume-unchanged"
@ -50,3 +45,5 @@
[url "ssh://git@github.com"]
insteadOf = https://github.com
[url "ssh://git@gitlab.et-scm.com/"]
insteadOf = https://gitlab.et-scm.com

View File

@ -1,8 +0,0 @@
kind: SwitchConfig
version: v1alpha1
kubeconfigName: "*.yaml"
kubeconfigStores:
- kind: filesystem
kubeconfigName: "*.yaml"
paths:
- ~/.kube/clusters/

4
.zshrc
View File

@ -1,7 +1,3 @@
if [ ! -z ~/.additional_dotfiles/credentials ]; then
source ~/.additional_dotfiles/credentials
fi
for filename in ~/.dotfiles/*; do
source $filename
done

View File

@ -36,7 +36,6 @@ pre-reqs: ## Install all required binaries.
which btm > /dev/null || cargo install bottom; \
which procs > /dev/null || brew install procs; \
which dog > /dev/null || brew install dog; \
which switcher > /dev/null || brew install danielfoehrkn/switch/switch; \
brew install gpg gawk coreutils; \
git clone https://github.com/zsh-users/zsh-autosuggestions $${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions; \
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting; \
@ -73,7 +72,6 @@ upgrade: ## Upgrade all required binaries.
which btm > /dev/null && cargo install bottom; \
which procs > /dev/null && brew upgrade procs; \
which dog > /dev/null && brew upgrade dog; \
which switcher > /dev/null && brew upgrade switch; \
cd $${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && git pull && cd -; \
cd $${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && git pull && cd -; \
cd ~/.oh-my-zsh && git pull && cd -; \
@ -98,12 +96,6 @@ dotfiles: ## Installs the dotfiles.
f=$$(basename $$file); \
ln -sfn $$file $(HOME)/.k9s/$$f; \
done; \
mkdir -p $(HOME)/.kube; \
for file in $(shell find $(CURDIR)/.kube -type f); do \
f=$$(basename $$file); \
ln -sfn $$file $(HOME)/.kube/$$f; \
done; \
.PHONY: help
help: