29 lines
1.1 KiB
Fish
29 lines
1.1 KiB
Fish
function kush
|
|
|
|
switch $argv[1]
|
|
case "sbx"
|
|
aws eks update-kubeconfig --name surepreme-sandbox-main-cluster --profile sure-inc
|
|
case "qa"
|
|
aws eks update-kubeconfig --name farmers-qa-main-cluster --profile np-farmers
|
|
case "prod"
|
|
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
|
|
end
|
|
|
|
if test (count $argv) -gt 1
|
|
if [ $argv[2] = "-p" ]
|
|
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
|
|
end
|
|
else
|
|
kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash
|
|
end
|
|
|
|
|
|
|
|
end
|