tritonshell/pkgs/utils/ttp.sh

31 lines
1 KiB
Bash
Raw Normal View History

2022-01-21 16:55:29 +00:00
#!/usr/bin/env bash
# helper function to set the docker, triton, manta and CNS env vars for the current triton profile
ttp() {
if [[ "$1" == "set" ]]; then
if [[ -n "$2" ]]; then
source unset-env.sh
triton profile set "$2"
fi
2022-03-03 01:09:40 +00:00
source triton-docker-env.sh
2022-01-21 16:55:29 +00:00
elif [[ "$1" == "unset" ]]; then
source unset-env.sh
elif [[ "$1" == "env" ]]; then
env | grep "DOCKER\|MANTA\|SDC\|TRITON" | sort
else
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
}