mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-05 06:48:48 +00:00
Better configuration of github repo
This commit is contained in:
parent
14aead038e
commit
ed304f571a
2
.github/workflows/docker.yaml
vendored
2
.github/workflows/docker.yaml
vendored
@ -12,5 +12,5 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Build Docker Image
|
- name: Build Docker Image
|
||||||
run: docker build . --file docker/Dockerfile --tag inventree:$(date +%s)
|
run: cd docker && docker build . --tag inventree:$(date +%s)
|
||||||
|
|
@ -7,6 +7,8 @@ from django.core.management.base import BaseCommand
|
|||||||
from django.db import connections
|
from django.db import connections
|
||||||
from django.db.utils import OperationalError
|
from django.db.utils import OperationalError
|
||||||
|
|
||||||
|
import psycopg2
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
@ -26,6 +28,6 @@ class Command(BaseCommand):
|
|||||||
db_conn = connections['default']
|
db_conn = connections['default']
|
||||||
# prints success messge in green
|
# prints success messge in green
|
||||||
self.stdout.write(self.style.SUCCESS('InvenTree database connected'))
|
self.stdout.write(self.style.SUCCESS('InvenTree database connected'))
|
||||||
except OperationalError:
|
except (OperationalError, psycopg2.OperationalError):
|
||||||
self.stdout.write(self.style.ERROR("Database unavailable, waiting 5 seconds ..."))
|
self.stdout.write(self.style.ERROR("Database unavailable, waiting 5 seconds ..."))
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
FROM python:alpine as production
|
FROM python:alpine as production
|
||||||
|
|
||||||
# GitHub source
|
# GitHub source
|
||||||
ARG INVENTREE_REPO="https://github.com/inventree/InvenTree.git"
|
ARG repository="https://github.com/inventree/InvenTree.git"
|
||||||
ARG INVENTREE_VERSION="master"
|
ARG branch="master"
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
# InvenTree key settings
|
# InvenTree key settings
|
||||||
ENV INVENTREE_HOME="/home/inventree"
|
ENV INVENTREE_HOME="/home/inventree"
|
||||||
|
|
||||||
|
# GitHub settings
|
||||||
|
ENV INVENTREE_REPO="${repository}"
|
||||||
|
ENV INVENTREE_BRANCH="${branch}"
|
||||||
|
|
||||||
ENV INVENTREE_LOG_LEVEL="INFO"
|
ENV INVENTREE_LOG_LEVEL="INFO"
|
||||||
|
|
||||||
# InvenTree paths
|
# InvenTree paths
|
||||||
@ -57,7 +61,7 @@ RUN apk add --no-cache postgresql-contrib postgresql-dev libpq
|
|||||||
RUN apk add --no-cache mariadb-connector-c mariadb-dev
|
RUN apk add --no-cache mariadb-connector-c mariadb-dev
|
||||||
|
|
||||||
# Clone source code
|
# Clone source code
|
||||||
RUN git clone --branch ${INVENTREE_VERSION} --depth 1 ${INVENTREE_REPO} ${INVENTREE_SRC_DIR}
|
RUN git clone --branch ${INVENTREE_BRANCH} --depth 1 ${INVENTREE_REPO} ${INVENTREE_SRC_DIR}
|
||||||
|
|
||||||
# Setup Python virtual environment
|
# Setup Python virtual environment
|
||||||
RUN python3 -m venv ${INVENTREE_VENV}
|
RUN python3 -m venv ${INVENTREE_VENV}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user