kopia lustrzana https://github.com/jedie/PyInventory
rodzic
e877d8babd
commit
217e677622
|
@ -1,2 +1,3 @@
|
|||
PROJECT_NAME=pyinventory
|
||||
PYTHON_PACKAGE_NAME=inventory
|
||||
PROJECT_PACKAGE_NAME=pyinventory
|
||||
PROJECT_VERSION=0.7.0rc1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
FROM python:3.9-slim-buster
|
||||
# https://hub.docker.com/_/python
|
||||
FROM python:3.9-slim-buster
|
||||
|
||||
# for pip cache:
|
||||
ENV XDG_CACHE_HOME=/var/cache
|
||||
|
@ -7,7 +7,8 @@ ENV XDG_CACHE_HOME=/var/cache
|
|||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# Install deps
|
||||
RUN apt-get update \
|
||||
RUN set -x \
|
||||
&& apt-get update \
|
||||
&& apt-mark auto $(apt-mark showinstall) \
|
||||
&& apt-get install -y postgresql-client-11 python3-pip \
|
||||
&& apt autoremove \
|
||||
|
@ -16,11 +17,21 @@ RUN apt-get update \
|
|||
&& python3 -m pip install -U pip \
|
||||
&& pip install -U psycopg2-binary
|
||||
|
||||
RUN addgroup --system django \
|
||||
# Create user for application server:
|
||||
RUN set -x \
|
||||
&& addgroup --system django \
|
||||
&& adduser --system --no-create-home --disabled-password --ingroup django --shell /bin/bash django
|
||||
|
||||
WORKDIR /django
|
||||
|
||||
RUN pip install "pyinventory>=0.6.0"
|
||||
ARG PROJECT_PACKAGE_NAME
|
||||
ENV PROJECT_PACKAGE_NAME=${PROJECT_PACKAGE_NAME}
|
||||
|
||||
ARG PROJECT_VERSION
|
||||
ENV PROJECT_VERSION=${PROJECT_VERSION}
|
||||
|
||||
# Install project:
|
||||
RUN set -x \
|
||||
&& pip install "${PROJECT_PACKAGE_NAME}>=${PROJECT_VERSION}"
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ if [ -d "/dist/" ] ; then
|
|||
else
|
||||
(
|
||||
set -x
|
||||
pip3 install -U "${PYTHON_PACKAGE_NAME}"
|
||||
pip3 install -U "${PROJECT_PACKAGE_NAME}>=${PROJECT_VERSION}"
|
||||
)
|
||||
fi
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@ services:
|
|||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- PROJECT_PACKAGE_NAME=${PROJECT_PACKAGE_NAME}
|
||||
- PROJECT_VERSION=${PROJECT_VERSION}
|
||||
restart: unless-stopped
|
||||
hostname: django
|
||||
ports:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "PyInventory"
|
||||
version = "0.7.0"
|
||||
version = "0.7.0rc1"
|
||||
description = "Web based management to catalog things including state and location etc. using Python/Django."
|
||||
authors = ["JensDiemer <git@jensdiemer.de>"]
|
||||
packages = [
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
:license: GNU GPL v3 or above, see LICENSE for more details.
|
||||
"""
|
||||
|
||||
__version__ = "0.7.0"
|
||||
__version__ = "0.7.0rc1"
|
||||
|
||||
# https://docs.djangoproject.com/en/2.0/ref/applications/#configuring-applications-ref
|
||||
default_app_config = "inventory.apps.InventoryConfig"
|
||||
|
|
|
@ -46,6 +46,11 @@ def test_version(package_root=None, version=None):
|
|||
string=f'version = "{version}"'
|
||||
)
|
||||
|
||||
assert_file_contains_string(
|
||||
file_path=Path(package_root, 'deployment', '.env'),
|
||||
string=f'PROJECT_VERSION={version}'
|
||||
)
|
||||
|
||||
|
||||
def test_poetry_check(package_root=None):
|
||||
if package_root is None:
|
||||
|
|
Ładowanie…
Reference in New Issue