Use ttp shell function from tritonshell
This commit is contained in:
parent
7e3afff152
commit
eca6d4d999
|
@ -54,18 +54,32 @@
|
||||||
alias wg-down="sudo systemctl stop wg-quick@wg0.service"
|
alias wg-down="sudo systemctl stop wg-quick@wg0.service"
|
||||||
|
|
||||||
# Helper function for docker on triton
|
# Helper function for docker on triton
|
||||||
ttdo () {
|
ttp() {
|
||||||
if [[ "$1" == "set" ]]; then
|
if [[ "$1" == "set" ]]; then
|
||||||
if [[ -n "$2" ]]; then
|
if [[ -n "$2" ]]; then
|
||||||
|
source unset-env.sh
|
||||||
triton profile set "$2"
|
triton profile set "$2"
|
||||||
fi
|
fi
|
||||||
source ~/CodeRoom/greenbaum.cloud/triton-docker.env.sh
|
source ~/CodeRoom/greenbaum.cloud/tritonshell/template/pkgs/utils/triton-docker.env.sh
|
||||||
elif [[ "$1" == "unset" ]]; then
|
elif [[ "$1" == "unset" ]]; then
|
||||||
eval "$(triton env --unset)" && unset TRITON_CNS_SEARCH_DOMAIN_PRIVATE TRITON_CNS_SEARCH_DOMAIN_PUBLIC
|
source ~/CodeRoom/greenbaum.cloud/tritonshell/template/pkgs/utils/unset-env.sh
|
||||||
elif [[ "$1" == "env" ]]; then
|
elif [[ "$1" == "env" ]]; then
|
||||||
env | grep "DOCKER\|TRITON\|SDC"
|
env | grep "DOCKER\|MANTA\|SDC\|TRITON" | sort
|
||||||
else
|
else
|
||||||
/usr/bin/docker $@
|
echo "this is a helper function to quickly switch triton profiles"
|
||||||
|
echo "and setup the required environment variables"
|
||||||
|
echo "for triton, manta and the remote docker host (API)"
|
||||||
|
echo
|
||||||
|
echo 'use "ttp set your-profile" to switch to a profile'
|
||||||
|
echo
|
||||||
|
echo 'use "ttp unset" to clear all environment variables used by these CLIs'
|
||||||
|
echo "useful if you'd like to run a docker command against the"
|
||||||
|
echo "local docker host"
|
||||||
|
echo
|
||||||
|
echo 'use "ttp env" to view the currently set environment variables'
|
||||||
|
echo "used by the triton & manta CLIs"
|
||||||
|
echo
|
||||||
|
echo 'use "ttp help" to view this help'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue