diff --git a/environment.sh b/environment.sh index 7b9a1e5..168f5eb 100755 --- a/environment.sh +++ b/environment.sh @@ -10,13 +10,22 @@ echo "Loading IOC environment for BL45P ..." # a mapping between genenric IOC repo roots and the related container registry export EC_REGISTRY_MAPPING='github.com=ghcr.io gitlab.diamond.ac.uk=gcr.io/diamond-privreg/controls/ioc' +# the namespace to use for kubernetes deployments export EC_K8S_NAMESPACE=bl45p +# the git organisation used for beamline repositories export EC_GIT_ORG=https://github.com/epics-containers +# the git repo for this beamline (or accelerator domain) +export EC_DOMAIN_REPO=git@github.com:epics-containers/bl45p.git +# declare your centralised log server Web UI export EC_LOG_URL='https://graylog2.diamond.ac.uk/search?rangetype=relative&fields=message%2Csource&width=1489&highlightMessage=&relative=172800&q=pod_name%3A{ioc_name}*' -# export EC_CONTAINER_CLI=podman (uncomment to enforce a specific container cli) -# export EC_DEBUG=1 (uncomment to enable debug output) +# enforce a specific container cli - defaults to whatever is available +# export EC_CONTAINER_CLI=podman +# enable debug output in all 'ec' commands +# export EC_DEBUG=1 # the following configures kubernetes inside DLS. +# replace this with however your cluster is configured - essenially needs to +# ~/.kube/config if module --version &> /dev/null; then if module avail pollux > /dev/null; then module unload pollux > /dev/null @@ -24,13 +33,16 @@ if module --version &> /dev/null; then fi fi -# must be in a venv and this is the reliable check -if python3 -c 'import sys; sys.exit(0 if sys.base_prefix==sys.prefix else 1)' -then - echo "ERROR: Please activate a virtualenv and re-run" -else - if ! ec --version &> /dev/null; then +# check if epics-containers-cli (ec command) is installed and install if not +if ! ec --version &> /dev/null; then + # must be in a venv and this is the reliable check + if python3 -c 'import sys; sys.exit(0 if sys.base_prefix==sys.prefix else 1)'; then + echo "ERROR: Please activate a virtualenv and re-run" + return + elif ! ec --version &> /dev/null; then pip install epics-containers-cli fi - ec --install-completion ${SHELL} &> /dev/null fi + +# enable shell completion for ec commands +source <(ec --show-completion ${SHELL})