瀏覽代碼

[zsh] Add sure commands and atuin

Colin Powell 1 年之前
父節點
當前提交
f2c9172751
共有 1 個文件被更改,包括 44 次插入0 次删除
  1. 44 0
      zsh/.zshrc

+ 44 - 0
zsh/.zshrc

@@ -17,5 +17,49 @@ alias fsync="find . -type f -name '*.sync-conflict*'"
 alias atlas="ssh atlas.local"
 alias pandora="ssh pandora.unbl.ink"
 alias bastion="ssh bastion.unbl.ink"
+alias pull="git pull --rebase --autostash"
+alias asso="aws sso login --profile $argv"
+
+repogo() {
+  export PRIVATE_REPO_TOKEN="$(aws codeartifact get-authorization-token --domain sure --query authorizationToken --output text --profile registries-read)"
+  export CODEARTIFACT_AUTH_TOKEN="$PRIVATE_REPO_TOKEN"
+  poetry config http-basic.codeartifact aws $PRIVATE_REPO_TOKEN
+  aws codeartifact login --namespace sureapp --tool npm --repository npm --domain sure --domain-owner 348777858795 --profile registries-read
+}
+
+kush() {
+  if [[ $1 == "sbx" ]]
+  then
+    aws eks update-kubeconfig --name surepreme-sandbox-main-cluster --profile sure-inc
+  fi
+
+  if [[ $1 == "qa" ]]
+  then
+    aws eks update-kubeconfig --name farmers-qa-main-cluster --profile np-farmers
+  fi 
+
+  if [[ $1 == "prod" ]] 
+  then
+    echo "from platform_core.apps.core_protections.models import *" | pbcopy
+    aws eks update-kubeconfig --name surepreme-production-main-cluster --profile sure-inc
+    kubectl exec -it -n bastion $(kubectl get po -n bastion | grep "surepreme.*bastion" | head -n 1 | awk '{print $1}') -- python manage.py shell
+  fi
+
+  if (( $2 ));
+  then
+    if [[ $2 = "-p" ]]
+    then
+      echo "Import command is on your clipboard"
+      echo "from platform_core.apps.core_protections.models import *" | pbcopy
+      kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash -c "python manage.py shell"
+    else
+      kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash
+    fi
+  else
+    kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash
+  fi
+}
 
 [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
+
+eval "$(atuin init zsh)"