Lots of changes
This commit is contained in:
parent
7a0806ce75
commit
edfbcee609
@ -7,7 +7,6 @@ format = """\
|
|||||||
$git_commit\
|
$git_commit\
|
||||||
$git_state\
|
$git_state\
|
||||||
$git_status\
|
$git_status\
|
||||||
$aws\
|
|
||||||
$kubernetes\
|
$kubernetes\
|
||||||
$helm\
|
$helm\
|
||||||
$golang\
|
$golang\
|
||||||
@ -44,6 +43,8 @@ format = '[$symbol$context \($namespace\)]($style) '
|
|||||||
symbol = "ﴱ "
|
symbol = "ﴱ "
|
||||||
style = "bold blue"
|
style = "bold blue"
|
||||||
disabled = false
|
disabled = false
|
||||||
|
[kubernetes.context_aliases]
|
||||||
|
"gs-(?P<cluster>.+)" = "$cluster [MC]"
|
||||||
|
|
||||||
[terraform]
|
[terraform]
|
||||||
format = "[$symbol$version]($style) "
|
format = "[$symbol$version]($style) "
|
||||||
|
@ -7,12 +7,12 @@ plugins=(
|
|||||||
zsh-autosuggestions
|
zsh-autosuggestions
|
||||||
)
|
)
|
||||||
autoload -U compinit && compinit
|
autoload -U compinit && compinit
|
||||||
fpath=($fpath ~/.zsh/completion)
|
|
||||||
|
|
||||||
DISABLE_UNTRACKED_FILES_DIRTY="true"
|
DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||||
SHOW_AWS_PROMPT=false
|
SHOW_AWS_PROMPT=false
|
||||||
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
source `brew --prefix switch`/switch.sh
|
||||||
|
|
||||||
# History
|
# History
|
||||||
HISTFILE="$HOME/.zsh_history"
|
HISTFILE="$HOME/.zsh_history"
|
||||||
|
@ -24,6 +24,8 @@ alias bandwhich='sudo bandwhich'
|
|||||||
alias top='btm'
|
alias top='btm'
|
||||||
alias ps='procs'
|
alias ps='procs'
|
||||||
alias dig='dog'
|
alias dig='dog'
|
||||||
|
alias kubectx='switch'
|
||||||
|
alias kctx='switch'
|
||||||
|
|
||||||
alias machine-info='macchina -t Boron --bar'
|
alias machine-info='macchina -t Boron --bar'
|
||||||
alias watch='watch '
|
alias watch='watch '
|
||||||
@ -39,7 +41,11 @@ 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'
|
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-clone() {
|
git() {
|
||||||
git clone $1
|
if [ "$1" = "take" ]; then
|
||||||
cd "$(basename "$1" .git)"
|
/usr/local/bin/git clone $2
|
||||||
|
cd $(basename $2 | sed 's/\.git$//')
|
||||||
|
else
|
||||||
|
/usr/local/bin/git $@
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
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 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 EDITOR='vim'
|
||||||
export VISUAL='code'
|
export VISUAL='code'
|
||||||
|
export GPG_TTY=$(tty)
|
||||||
|
|
||||||
# AWS
|
# AWS
|
||||||
if [ -f ~/.aws/profile ]; then
|
if [ -f ~/.aws/profile ]; then
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
alias k='kubectl '
|
alias k='kubectl '
|
||||||
|
alias kgs='kubectl-gs '
|
||||||
alias kshell='kubectl run -it shell --image bash --restart Never --rm -- sh'
|
alias kshell='kubectl run -it shell --image bash --restart Never --rm -- sh'
|
||||||
|
|
||||||
kiam () {
|
kiam () {
|
||||||
@ -70,12 +71,6 @@ kube-forward() {
|
|||||||
|
|
||||||
source <(kubectl completion zsh)
|
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
|
## Kubectl exec
|
||||||
kx () {
|
kx () {
|
||||||
local pod=($(kubectl get pods --all-namespaces -owide | fzf | awk '{print $1, $2}'))
|
local pod=($(kubectl get pods --all-namespaces -owide | fzf | awk '{print $1, $2}'))
|
||||||
@ -99,13 +94,6 @@ kall () {
|
|||||||
kubectl get all --all-namespaces
|
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() {
|
k-version-test() {
|
||||||
VERSION=""
|
VERSION=""
|
||||||
FILES=""
|
FILES=""
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
[user]
|
[user]
|
||||||
name = Marcus Noble
|
name = Marcus Noble
|
||||||
|
signingkey = B8F2DB8A7AEBAF78
|
||||||
|
|
||||||
|
[commit]
|
||||||
|
gpgsign = true
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
editor = /usr/bin/vim
|
editor = /usr/bin/vim
|
||||||
@ -26,8 +30,9 @@
|
|||||||
org-name = "!git remote -v | grep -m 1 -o ':.*/' | sed 's:^.\\(.*\\).$:\\1:'"
|
org-name = "!git remote -v | grep -m 1 -o ':.*/' | sed 's:^.\\(.*\\).$:\\1:'"
|
||||||
branch-name = "!git rev-parse --abbrev-ref HEAD"
|
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"
|
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 symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') && git pull"
|
main = "!git remote set-head origin --auto && git checkout $(git main-branch) && 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"
|
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"
|
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"
|
dont-change-file = "!git update-index --assume-unchanged"
|
||||||
@ -45,5 +50,3 @@
|
|||||||
|
|
||||||
[url "ssh://git@github.com"]
|
[url "ssh://git@github.com"]
|
||||||
insteadOf = https://github.com
|
insteadOf = https://github.com
|
||||||
[url "ssh://git@gitlab.et-scm.com/"]
|
|
||||||
insteadOf = https://gitlab.et-scm.com
|
|
||||||
|
8
.kube/switch-config.yaml
Normal file
8
.kube/switch-config.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
kind: SwitchConfig
|
||||||
|
version: v1alpha1
|
||||||
|
kubeconfigName: "*.yaml"
|
||||||
|
kubeconfigStores:
|
||||||
|
- kind: filesystem
|
||||||
|
kubeconfigName: "*.yaml"
|
||||||
|
paths:
|
||||||
|
- ~/.kube/clusters/
|
4
.zshrc
4
.zshrc
@ -1,3 +1,7 @@
|
|||||||
|
if [ ! -z ~/.additional_dotfiles/credentials ]; then
|
||||||
|
source ~/.additional_dotfiles/credentials
|
||||||
|
fi
|
||||||
|
|
||||||
for filename in ~/.dotfiles/*; do
|
for filename in ~/.dotfiles/*; do
|
||||||
source $filename
|
source $filename
|
||||||
done
|
done
|
||||||
|
8
Makefile
8
Makefile
@ -37,6 +37,7 @@ pre-reqs: ## Install all required binaries.
|
|||||||
which procs > /dev/null || brew install procs; \
|
which procs > /dev/null || brew install procs; \
|
||||||
which dog > /dev/null || brew install dog; \
|
which dog > /dev/null || brew install dog; \
|
||||||
which asdf > /dev/null || brew install asdf; \
|
which asdf > /dev/null || brew install asdf; \
|
||||||
|
which switcher > /dev/null || brew install danielfoehrkn/switch/switch; \
|
||||||
brew install gpg gawk coreutils; \
|
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-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; \
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting; \
|
||||||
@ -79,6 +80,7 @@ upgrade: ## Upgrade all required binaries.
|
|||||||
which procs > /dev/null && brew upgrade procs; \
|
which procs > /dev/null && brew upgrade procs; \
|
||||||
which dog > /dev/null && brew upgrade dog; \
|
which dog > /dev/null && brew upgrade dog; \
|
||||||
which asdf > /dev/null && brew upgrade asdf; \
|
which asdf > /dev/null && brew upgrade asdf; \
|
||||||
|
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-autosuggestions && git pull && cd -; \
|
||||||
cd $${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && git pull && cd -; \
|
cd $${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && git pull && cd -; \
|
||||||
asdf plugin update --all; \
|
asdf plugin update --all; \
|
||||||
@ -104,6 +106,12 @@ dotfiles: ## Installs the dotfiles.
|
|||||||
f=$$(basename $$file); \
|
f=$$(basename $$file); \
|
||||||
ln -sfn $$file $(HOME)/.k9s/$$f; \
|
ln -sfn $$file $(HOME)/.k9s/$$f; \
|
||||||
done; \
|
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
|
.PHONY: help
|
||||||
help:
|
help:
|
||||||
|
Loading…
Reference in New Issue
Block a user