mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-18 02:36:31 +00:00
fix: package - various changes (#9802)
* fail on install * move site setting up to ensure site is set early * fix version file path * ensure subdirs are created too * ensure downloaded files are also collected into static * update order * bump qc workers * update version
This commit is contained in:
22
.github/workflows/qc_checks.yaml
vendored
22
.github/workflows/qc_checks.yaml
vendored
@@ -65,7 +65,7 @@ jobs:
|
|||||||
|
|
||||||
javascript:
|
javascript:
|
||||||
name: Style - Classic UI [JS]
|
name: Style - Classic UI [JS]
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
needs: ["pre-commit"]
|
needs: ["pre-commit"]
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ jobs:
|
|||||||
|
|
||||||
pre-commit:
|
pre-commit:
|
||||||
name: Style [pre-commit]
|
name: Style [pre-commit]
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
needs: paths-filter
|
needs: paths-filter
|
||||||
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.frontend == 'true' || needs.paths-filter.outputs.force == 'true'
|
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.frontend == 'true' || needs.paths-filter.outputs.force == 'true'
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ jobs:
|
|||||||
|
|
||||||
mkdocs:
|
mkdocs:
|
||||||
name: Style [Documentation]
|
name: Style [Documentation]
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
needs: paths-filter
|
needs: paths-filter
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ jobs:
|
|||||||
|
|
||||||
schema:
|
schema:
|
||||||
name: Tests - API Schema Documentation
|
name: Tests - API Schema Documentation
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
needs: paths-filter
|
needs: paths-filter
|
||||||
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true'
|
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true'
|
||||||
env:
|
env:
|
||||||
@@ -204,7 +204,7 @@ jobs:
|
|||||||
|
|
||||||
schema-push:
|
schema-push:
|
||||||
name: Push new schema
|
name: Push new schema
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
needs: [paths-filter, schema]
|
needs: [paths-filter, schema]
|
||||||
if: needs.schema.result == 'success' && github.ref == 'refs/heads/master' && needs.paths-filter.outputs.api == 'true' && github.repository_owner == 'inventree'
|
if: needs.schema.result == 'success' && github.ref == 'refs/heads/master' && needs.paths-filter.outputs.api == 'true' && github.repository_owner == 'inventree'
|
||||||
env:
|
env:
|
||||||
@@ -232,7 +232,7 @@ jobs:
|
|||||||
|
|
||||||
python:
|
python:
|
||||||
name: Tests - inventree-python
|
name: Tests - inventree-python
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
needs: ["pre-commit", "paths-filter"]
|
needs: ["pre-commit", "paths-filter"]
|
||||||
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true'
|
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true'
|
||||||
@@ -274,7 +274,7 @@ jobs:
|
|||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
name: Tests - DB [SQLite] + Coverage ${{ matrix.python_version }}
|
name: Tests - DB [SQLite] + Coverage ${{ matrix.python_version }}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
needs: ["pre-commit", "paths-filter"]
|
needs: ["pre-commit", "paths-filter"]
|
||||||
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true'
|
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true'
|
||||||
@@ -317,7 +317,7 @@ jobs:
|
|||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
name: Tests - DB [PostgreSQL]
|
name: Tests - DB [PostgreSQL]
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
needs: ["pre-commit", "paths-filter"]
|
needs: ["pre-commit", "paths-filter"]
|
||||||
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true'
|
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true'
|
||||||
|
|
||||||
@@ -361,7 +361,7 @@ jobs:
|
|||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
name: Tests - DB [MySQL]
|
name: Tests - DB [MySQL]
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
needs: ["pre-commit", "paths-filter"]
|
needs: ["pre-commit", "paths-filter"]
|
||||||
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true'
|
if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true'
|
||||||
@@ -505,7 +505,7 @@ jobs:
|
|||||||
|
|
||||||
platform_ui:
|
platform_ui:
|
||||||
name: Tests - Platform UI
|
name: Tests - Platform UI
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
needs: ["pre-commit", "paths-filter"]
|
needs: ["pre-commit", "paths-filter"]
|
||||||
if: needs.paths-filter.outputs.frontend == 'true' || needs.paths-filter.outputs.force == 'true'
|
if: needs.paths-filter.outputs.frontend == 'true' || needs.paths-filter.outputs.force == 'true'
|
||||||
@@ -561,7 +561,7 @@ jobs:
|
|||||||
|
|
||||||
platform_ui_build:
|
platform_ui_build:
|
||||||
name: Build - UI Platform
|
name: Build - UI Platform
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@@ -300,7 +300,7 @@ function update_or_install() {
|
|||||||
# Run update as app user
|
# Run update as app user
|
||||||
echo "# POI12| Updating InvenTree"
|
echo "# POI12| Updating InvenTree"
|
||||||
sudo -u ${APP_USER} --preserve-env=$SETUP_ENVS bash -c "cd ${APP_HOME} && pip install wheel"
|
sudo -u ${APP_USER} --preserve-env=$SETUP_ENVS bash -c "cd ${APP_HOME} && pip install wheel"
|
||||||
sudo -u ${APP_USER} --preserve-env=$SETUP_ENVS bash -c "cd ${APP_HOME} && invoke update | sed -e 's/^/# POI12| u | /;'"
|
sudo -u ${APP_USER} --preserve-env=$SETUP_ENVS bash -c "set -e && cd ${APP_HOME} && invoke update | sed -e 's/^/# POI12| u | /;'"
|
||||||
|
|
||||||
# Make sure permissions are correct again
|
# Make sure permissions are correct again
|
||||||
echo "# POI12| Set permissions for data dir and media: ${DATA_DIR}"
|
echo "# POI12| Set permissions for data dir and media: ${DATA_DIR}"
|
||||||
|
@@ -53,12 +53,12 @@ create_admin
|
|||||||
|
|
||||||
# run updates
|
# run updates
|
||||||
stop_inventree
|
stop_inventree
|
||||||
|
set_site
|
||||||
update_or_install
|
update_or_install
|
||||||
# Write config file
|
# Write config file
|
||||||
if [ "${SETUP_CONF_LOADED}" = "true" ]; then
|
if [ "${SETUP_CONF_LOADED}" = "true" ]; then
|
||||||
set_env
|
set_env
|
||||||
fi
|
fi
|
||||||
set_site
|
|
||||||
start_inventree
|
start_inventree
|
||||||
|
|
||||||
# show info
|
# show info
|
||||||
|
@@ -71,7 +71,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)
|
||||||
|
@@ -18,7 +18,7 @@ from django.conf import settings
|
|||||||
from .api_version import INVENTREE_API_TEXT, INVENTREE_API_VERSION
|
from .api_version import INVENTREE_API_TEXT, INVENTREE_API_VERSION
|
||||||
|
|
||||||
# InvenTree software version
|
# InvenTree software version
|
||||||
INVENTREE_SW_VERSION = '0.17.13'
|
INVENTREE_SW_VERSION = '0.17.14'
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger('inventree')
|
logger = logging.getLogger('inventree')
|
||||||
|
3
tasks.py
3
tasks.py
@@ -1360,7 +1360,7 @@ def frontend_download(
|
|||||||
# if clean, delete static/web directory
|
# if clean, delete static/web directory
|
||||||
if clean:
|
if clean:
|
||||||
shutil.rmtree(dest_path, ignore_errors=True)
|
shutil.rmtree(dest_path, ignore_errors=True)
|
||||||
dest_path.mkdir()
|
dest_path.mkdir(parents=True, exist_ok=True)
|
||||||
info(f'Cleaned directory: {dest_path}')
|
info(f'Cleaned directory: {dest_path}')
|
||||||
|
|
||||||
# unzip build to static folder
|
# unzip build to static folder
|
||||||
@@ -1385,6 +1385,7 @@ def frontend_download(
|
|||||||
info(f'Downloaded frontend build to temporary file: {dst.name}')
|
info(f'Downloaded frontend build to temporary file: {dst.name}')
|
||||||
|
|
||||||
handle_extract(dst.name)
|
handle_extract(dst.name)
|
||||||
|
static(c)
|
||||||
|
|
||||||
def check_already_current(tag=None, sha=None):
|
def check_already_current(tag=None, sha=None):
|
||||||
"""Check if the currently available frontend is already the requested one."""
|
"""Check if the currently available frontend is already the requested one."""
|
||||||
|
Reference in New Issue
Block a user