2017-10-21 09:33:34 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-01-29 17:29:29 +00:00
|
|
|
# Save the current shell options.
|
|
|
|
oldstate=$(set +o)
|
|
|
|
|
2018-02-06 12:06:00 +00:00
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
2017-10-21 09:33:34 +01:00
|
|
|
|
|
|
|
# This script can be used to prepare the environment for use with kayobe. This
|
|
|
|
# includes setting environment variables and activating the python virtual
|
|
|
|
# environment. This script should be sourced rather than executed in a
|
|
|
|
# subprocess. e.g. source dev/environment-setup.sh
|
|
|
|
|
2021-09-07 08:44:35 +01:00
|
|
|
# Arguments passed to this script are passed through to the kayobe-env script
|
|
|
|
# in kayobe-config. This can be used to set the Kayobe environment.
|
|
|
|
|
2017-10-21 09:33:34 +01:00
|
|
|
PARENT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
2018-02-06 12:06:00 +00:00
|
|
|
source "${PARENT}/functions"
|
2017-10-21 09:33:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
function main {
|
|
|
|
config_init
|
2021-09-07 08:44:35 +01:00
|
|
|
environment_setup "$@"
|
2017-10-21 09:33:34 +01:00
|
|
|
}
|
|
|
|
|
2021-09-07 08:44:35 +01:00
|
|
|
main "$@"
|
2019-01-29 17:29:29 +00:00
|
|
|
|
|
|
|
# Restore previous shell options.
|
|
|
|
eval "$oldstate"
|