kayobe-config/kayobe-env
Bharat Kunwar afeee3c07e Make source kayobe-env zsh compatible
The config falls back to zsh of $BASH_SOURCE is not found

Change-Id: Icfcb55cb2be7971c578c93740a4cdd600d3e36b9
Story: 2006173
Task: 35693
2019-07-08 10:22:14 +01:00

35 lines
1.3 KiB
Plaintext

# Copyright (c) 2017 StackHPC Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
KAYOBE_CONFIG_ROOT=$(dirname $(realpath ${BASH_SOURCE[0]:-${(%):-%x}}))
echo "Using Kayobe config from $KAYOBE_CONFIG_ROOT"
export KAYOBE_CONFIG_PATH=$KAYOBE_CONFIG_ROOT/etc/kayobe
export KOLLA_CONFIG_PATH=$KAYOBE_CONFIG_ROOT/etc/kolla
# NOTE: These paths can be modified depending on the local environment.
# These defaults are set based on the following directory structure:
#
# ${base_path}/
# src/
# kayobe/
# kayobe-config/
# kolla-ansible/
# venvs/
# kayobe/
# kolla-ansible/
base_path=$(realpath $KAYOBE_CONFIG_ROOT/../../)
export KOLLA_SOURCE_PATH=${KOLLA_SOURCE_PATH:-${base_path}/src/kolla-ansible}
export KOLLA_VENV_PATH=${KOLLA_VENV_PATH:-${base_path}/venvs/kolla-ansible}