浏览代码

[zsh] New aliases and clean up Sure functions

Colin Powell 1 年之前
父节点
当前提交
c187f6bf8e
共有 3 个文件被更改,包括 13 次插入21 次删除
  1. 1 1
      emacs/.config/doom/custom.el
  2. 1 0
      emacs/.config/doom/packages.el
  3. 11 20
      zsh/.zshrc

+ 1 - 1
emacs/.config/doom/custom.el

@@ -4,7 +4,7 @@
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  '(magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'")
- '(package-selected-packages '(w3m vulpea ef-themes))
+ '(package-selected-packages '(nov w3m vulpea ef-themes))
  '(safe-local-variable-values '((pytest-global-name . "docker-compose run --rm test --"))))
 (custom-set-faces
  ;; custom-set-faces was added by Custom.

+ 1 - 0
emacs/.config/doom/packages.el

@@ -13,6 +13,7 @@
 (package! ef-themes)
 (package! nyan-mode)
 (package! w3m)
+(package! nov)
 (package! ace-link)
 (package! git-link)
 (package! blacken)

+ 11 - 20
zsh/.zshrc

@@ -25,6 +25,7 @@ alias push="git push"
 alias asso="aws sso login --profile $argv"
 alias bookpull="rsync --delete -avzichP root@atlas.local:/tank/books/ ~/.calibre/"
 alias bookpush="rsync --delete -avzichP ~/.calibre/ root@atlas.local:/tank/books/"
+alias chglg="git add ./changelog/ && git commit -m 'Add changelog' && git push"
 
 
 newemail () {
@@ -50,35 +51,22 @@ sush() {
   if [[ $1 == "sbx" ]]
   then
     asso sure-inc
-    aws eks update-kubeconfig --name surepreme-sandbox-main-cluster --profile sure-inc
+    aws eks update-kubeconfig --name surepreme-sandbox-k8s-use1 --profile sure-inc
+    kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash
   fi
 
   if [[ $1 == "qa" ]]
   then
     asso np-farmers
-    aws eks update-kubeconfig --name farmers-qa-main-cluster --profile np-farmers
+    aws eks update-kubeconfig --name farmers-qa-k8s-use1 --profile np-farmers
+    kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash
   fi
 
   if [[ $1 == "prod" ]]
   then
     asso sure-inc
-    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
+    aws eks update-kubeconfig --name surepreme-production-k8s-use1 --profile sure-inc
+    kubectl exec -it -n bastion $(kubectl get pod -n bastion | grep "surepreme.*bastion" | head -n 1 | awk '{print $1}') -- bash
   fi
 }
 
@@ -95,7 +83,7 @@ refresh_sure_db() {
     echo "This will likely take about 10 minutes"
     asso np-farmers
 	aws s3 cp --profile np-farmers s3://farmers-qa-rds-exports/pg_dumps/farmers_latest.pgdump /tmp/qa_farmers_latest.pgdump
-    dropdb -U sure surepreme
+    dropdb -U sure surepreme --force
     createdb -U sure surepreme
     psql -U sure surepreme -c "CREATE EXTENSION postgis"
     pg_restore -d surepreme /tmp/qa_farmers_latest.pgdump
@@ -105,4 +93,7 @@ refresh_sure_db() {
 
 [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
 
+for f in ~/.dotfiles.sure/bash/*.sh; do source $f; done
+for f in ~/.dotfiles.sure/direnv/*.sh; do source $f; done
+
 eval "$(atuin init zsh)"