Update git and kubernetes aliases

This commit is contained in:
William Carroll 2018-01-08 15:14:36 -05:00
parent dd431f5f28
commit 3f3614b417

View file

@ -20,16 +20,23 @@ command -v gpg2 >/dev/null && alias gpg=gpg2 || \
# exa-specific aliases # exa-specific aliases
command -v exa >/dev/null && alias ls='exa' || \ if command -v exa >/dev/null || echo 'Missing dependency (exa). Failed to create dependent aliases.'; then
echo 'Missing dependency (exa). Failed to alias ls -> exa' alias ls='exa'
command -v exa >/dev/null && alias ll='exa -l' || \ alias ll='exa -l'
echo 'Missing dependency (exa). Failed to alias ll -> exa -l' && \ alias ll='ls -l'
alias ll='ls -l' # fallback to ls -l alias la='exa -la'
command -v exa >/dev/null && alias la='exa -la' || \ alias la='ls -la'
echo 'Missing dependency (exa). Failed to alias la -> exa -la' && \
alias la='ls -la' # fallback to ls -la # tree-views of dirs and subdirs
command -v exa >/dev/null && alias lt='exa --tree' || \ function lt {
echo 'Missing dependency (exa). Failed to alias lt -> exa --tree' if [ -z $1 ]; then
exa --tree
else
depth=$1
exa --tree --level ${depth}
fi
}
fi
if command -v kubectl >/dev/null; then if command -v kubectl >/dev/null; then
@ -39,18 +46,24 @@ if command -v kubectl >/dev/null; then
# the following functions rely on gcloud being installed # the following functions rely on gcloud being installed
if command -v gcloud >/dev/null; then if command -v gcloud >/dev/null; then
function kedit {
deployment=$1
kubectl edit deployments $deployment
}
function kswitch { function kswitch {
# environment should be "staging" or "public"
environment=$1 environment=$1
gcloud container clusters get-credentials $environment gcloud container clusters get-credentials $environment
} }
fi fi
# kubernetes functions # kubernetes functions
function kedit {
deployment=$1
kubectl edit deployments $deployment
}
function kdns {
# Returns the domain names of the ingress points
kubectl get ing
}
function kush { function kush {
name=$1 name=$1
cmd=${2-/bin/bash} cmd=${2-/bin/bash}
@ -71,8 +84,10 @@ alias glp="git log --graph --pretty=format:'%Cred%h%Creset -%Cblue %an %Creset -
alias gprom="git pull --rebase origin master" alias gprom="git pull --rebase origin master"
alias gcan='git commit --amend --no-edit' alias gcan='git commit --amend --no-edit'
alias gpf='git push --force' alias gpf='git push --force'
alias gpff='git push --force --no-verify' # aka git push fucking force
alias gds='git diff --staged' alias gds='git diff --staged'
alias gfx='git commit --fixup' alias gfx='git commit --fixup'
alias gsh='git show'
# elixir-specific aliases # elixir-specific aliases