diff --git a/contrib/container/init.sh b/contrib/container/init.sh index f491d390c4..d6e802fdcd 100644 --- a/contrib/container/init.sh +++ b/contrib/container/init.sh @@ -10,25 +10,23 @@ fi # Create required directory structure (if it does not already exist) if [[ ! -d "$INVENTREE_STATIC_ROOT" ]]; then - echo "Creating directory $INVENTREE_STATIC_ROOT" + echo "INFO: Creating directory $INVENTREE_STATIC_ROOT" mkdir -p $INVENTREE_STATIC_ROOT fi if [[ ! -d "$INVENTREE_MEDIA_ROOT" ]]; then - echo "Creating directory $INVENTREE_MEDIA_ROOT" + echo "INFO: Creating directory $INVENTREE_MEDIA_ROOT" mkdir -p $INVENTREE_MEDIA_ROOT fi if [[ ! -d "$INVENTREE_BACKUP_DIR" ]]; then - echo "Creating directory $INVENTREE_BACKUP_DIR" + echo "INFO: Creating directory $INVENTREE_BACKUP_DIR" mkdir -p $INVENTREE_BACKUP_DIR fi # Check if "config.yaml" has been copied into the correct location -if [[ -f "$INVENTREE_CONFIG_FILE" ]]; then - echo "Loading config file : $INVENTREE_CONFIG_FILE" -else - echo "Copying config file from $INVENTREE_BACKEND_DIR/InvenTree/config_template.yml to $INVENTREE_CONFIG_FILE" +if [[ ! -f "$INVENTREE_CONFIG_FILE" ]]; then + echo "INFO: Copying config file from $INVENTREE_BACKEND_DIR/InvenTree/config_template.yml to $INVENTREE_CONFIG_FILE" cp $INVENTREE_BACKEND_DIR/InvenTree/config_template.yaml $INVENTREE_CONFIG_FILE fi @@ -39,11 +37,11 @@ if [[ -n "$INVENTREE_PY_ENV" ]]; then if [[ -d "$INVENTREE_PY_ENV" ]]; then # venv already exists - echo "Using Python virtual environment: ${INVENTREE_PY_ENV}" + echo "INFO: Using Python virtual environment: ${INVENTREE_PY_ENV}" source ${INVENTREE_PY_ENV}/bin/activate else # Setup a virtual environment (within the provided directory) - echo "Running first time setup for python environment" + echo "INFO: Running first time setup for python environment" python3 -m venv ${INVENTREE_PY_ENV} --system-site-packages --upgrade-deps # Ensure invoke tool is installed locally diff --git a/src/backend/InvenTree/InvenTree/version.py b/src/backend/InvenTree/InvenTree/version.py index e2c6c3da4e..e791ecbfe2 100644 --- a/src/backend/InvenTree/InvenTree/version.py +++ b/src/backend/InvenTree/InvenTree/version.py @@ -34,19 +34,8 @@ try: main_repo = Repo(pathlib.Path(__file__).parent.parent.parent.parent.parent) main_commit = main_repo[main_repo.head()] except NotGitRepository: - output = logger.warning - - try: - from django.conf import settings - - if settings.DOCKER: - output = logger.info - except Exception: - # We may not have access to settings at this point - pass - - output(git_warning_txt) - + if os.environ.get('INVENTREE_DOCKER', 'false') != 'true': + logger.warning(git_warning_txt) main_repo = None main_commit = None