[fish] Update functions from sure

This commit is contained in:
2023-07-28 11:39:17 -04:00
parent 01da7bbadb
commit f289250a4d
10 changed files with 58 additions and 3 deletions

View File

@ -0,0 +1,3 @@
function al
aws sso login --profile $argv
end

View File

@ -0,0 +1,5 @@
function dnsupdate
for arg in $argv
  curl -X PUT "https://box.unbl.ink/admin/dns/custom/$arg.unbl.ink" --user colin@unbl.ink:$(pass personal/colin@unbl.ink)
end
end

View File

@ -0,0 +1,3 @@
function k
kubectl exec -it $(kubectl get pods | fzf | awk '{print $1}'|head -n 1) -- bash -c "python manage.py shell"
end

View File

@ -0,0 +1,4 @@
function kc
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"
end

View File

@ -0,0 +1,28 @@
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

View File

@ -0,0 +1,3 @@
function pt
poetry run pytest $argv
end

View File

@ -1 +1,3 @@
aws codeartifact login --namespace sureapp --tool npm --repository npm --domain sure --domain-owner 348777858795 --profile $AWS_PROFILE
function sure-npm-token
aws codeartifact login --namespace sureapp --tool npm --repository npm --domain sure --domain-owner 348777858795 --profile $argv
end

View File

@ -1 +1,3 @@
aws codeartifact login --namespace sureapp --tool npm --repository npm --domain sure --domain-owner 348777858795 --profile $AWS_PROFILE
function sure-npm-token
aws codeartifact login --namespace sureapp --tool npm --repository npm --domain sure --domain-owner 348777858795 --profile $argv
end

View File

@ -1,4 +1,6 @@
function sure-set-token
set -x PRIVATE_REPO_TOKEN "$(aws codeartifact get-authorization-token --domain sure --query authorizationToken --output text --profile registries-read)"
set -Ux PRIVATE_REPO_TOKEN "$(aws codeartifact get-authorization-token --domain sure --query authorizationToken --output text --profile registries-read)"
set -Ux 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
end

View File

@ -0,0 +1,3 @@
function v
fzf --bind 'enter:become(vim {})'
end