mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 03:56:43 +00:00
Fix for tasks.py - docker (#6380)
* Instrument tasks.py * Enforce no_frontend * Run docker CI step if tasks.py changes
This commit is contained in:
parent
e85dd73f62
commit
e1e63fa644
1
.github/workflows/docker.yaml
vendored
1
.github/workflows/docker.yaml
vendored
@ -46,6 +46,7 @@ jobs:
|
|||||||
- docker.dev.env
|
- docker.dev.env
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
- requirements.txt
|
- requirements.txt
|
||||||
|
- tasks.py
|
||||||
|
|
||||||
|
|
||||||
# Build the docker image
|
# Build the docker image
|
||||||
|
@ -13,9 +13,9 @@ ARG base_image=python:3.10-alpine3.18
|
|||||||
FROM ${base_image} as inventree_base
|
FROM ${base_image} as inventree_base
|
||||||
|
|
||||||
# Build arguments for this image
|
# Build arguments for this image
|
||||||
|
ARG commit_tag=""
|
||||||
ARG commit_hash=""
|
ARG commit_hash=""
|
||||||
ARG commit_date=""
|
ARG commit_date=""
|
||||||
ARG commit_tag=""
|
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
|
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
|
||||||
|
9
tasks.py
9
tasks.py
@ -422,8 +422,11 @@ def update(
|
|||||||
# - INVENTREE_DOCKER is set (by the docker image eg.) and not overridden by `--frontend` flag
|
# - INVENTREE_DOCKER is set (by the docker image eg.) and not overridden by `--frontend` flag
|
||||||
# - `--no-frontend` flag is set
|
# - `--no-frontend` flag is set
|
||||||
if (os.environ.get('INVENTREE_DOCKER', False) and not frontend) or no_frontend:
|
if (os.environ.get('INVENTREE_DOCKER', False) and not frontend) or no_frontend:
|
||||||
pass
|
print('Skipping frontend update!')
|
||||||
|
frontend = False
|
||||||
|
no_frontend = True
|
||||||
else:
|
else:
|
||||||
|
print('Updating frontend...')
|
||||||
# Decide if we should compile the frontend or try to download it
|
# Decide if we should compile the frontend or try to download it
|
||||||
if node_available(bypass_yarn=True):
|
if node_available(bypass_yarn=True):
|
||||||
frontend_compile(c)
|
frontend_compile(c)
|
||||||
@ -947,6 +950,8 @@ def frontend_compile(c):
|
|||||||
Args:
|
Args:
|
||||||
c: Context variable
|
c: Context variable
|
||||||
"""
|
"""
|
||||||
|
print('Compiling frontend code...')
|
||||||
|
|
||||||
frontend_install(c)
|
frontend_install(c)
|
||||||
frontend_trans(c)
|
frontend_trans(c)
|
||||||
frontend_build(c)
|
frontend_build(c)
|
||||||
@ -1037,6 +1042,8 @@ def frontend_download(
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
print('Downloading frontend...')
|
||||||
|
|
||||||
# globals
|
# globals
|
||||||
default_headers = {'Accept': 'application/vnd.github.v3+json'}
|
default_headers = {'Accept': 'application/vnd.github.v3+json'}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user