mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 03:26:45 +00:00
chore(contrib): include pkg source in pkg logging (#9035)
* fix(backend): wrong path for version was used * chore(contrib): Include Pkg source in pkg logging
This commit is contained in:
parent
8bea3caec4
commit
a3be8e986b
@ -120,6 +120,18 @@ function detect_local_env() {
|
|||||||
echo "# POI02| Printing local envs - after #++#"
|
echo "# POI02| Printing local envs - after #++#"
|
||||||
printenv
|
printenv
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Print branch and dir from VERSION file
|
||||||
|
if [ -f "${APP_HOME}/VERSION" ]; then
|
||||||
|
echo "# POI02| Loading environment variables from VERSION file"
|
||||||
|
content=$(cat "${APP_HOME}/VERSION")
|
||||||
|
# use grep to get the branch and target
|
||||||
|
INVENTREE_PKG_BRANCH=($(echo $content | grep -oP 'INVENTREE_PKG_BRANCH=\K[^ ]+'))
|
||||||
|
INVENTREE_PKG_TARGET=($(echo $content | grep -oP 'INVENTREE_PKG_TARGET=\K[^ ]+'))
|
||||||
|
echo "Running in a package environment build on branch $INVENTREE_PKG_BRANCH for target $INVENTREE_PKG_TARGET"
|
||||||
|
else
|
||||||
|
echo "# POI02| VERSION file not found"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function detect_envs() {
|
function detect_envs() {
|
||||||
|
@ -70,7 +70,7 @@ BASE_DIR = config.get_base_dir()
|
|||||||
CONFIG = config.load_config_data(set_cache=True)
|
CONFIG = config.load_config_data(set_cache=True)
|
||||||
|
|
||||||
# Load VERSION data if it exists
|
# Load VERSION data if it exists
|
||||||
version_file = BASE_DIR.parent.joinpath('VERSION')
|
version_file = BASE_DIR.parent.parent.parent.joinpath('VERSION')
|
||||||
if version_file.exists():
|
if version_file.exists():
|
||||||
print('load version from file')
|
print('load version from file')
|
||||||
load_dotenv(version_file)
|
load_dotenv(version_file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user