[7] add version to docker

This commit is contained in:
meisnate12 2023-01-19 10:48:49 -05:00
parent dc5e52b146
commit 278037b8f0
7 changed files with 16 additions and 5 deletions

View file

@ -38,6 +38,8 @@ jobs:
with:
context: ./
file: ./Dockerfile
build-args: |
"BRANCH=develop"
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/plex-meta-manager:develop

View file

@ -38,6 +38,8 @@ jobs:
with:
context: ./
file: ./Dockerfile
build-args: |
"BRANCH=nightly"
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/plex-meta-manager:nightly

View file

@ -1,4 +1,6 @@
FROM python:3.11-slim-buster
ARG BRANCH_NAME=master
ENV BRANCH_NAME ${BRANCH_NAME}
ENV TINI_VERSION v0.19.0
ENV PMM_DOCKER True
COPY . /

View file

@ -1 +1 @@
1.18.3-develop6
1.18.3-develop7

View file

@ -114,6 +114,7 @@ class ConfigFile:
self.default_dir = default_dir
self.read_only = attrs["read_only"] if "read_only" in attrs else False
self.version = attrs["version"] if "version" in attrs else None
self.env_version = attrs["env_version"] if "env_version" in attrs else None
self.no_missing = attrs["no_missing"] if "no_missing" in attrs else None
self.no_report = attrs["no_report"] if "no_report" in attrs else None
self.ignore_schedules = attrs["ignore_schedules"] if "ignore_schedules" in attrs else False
@ -385,7 +386,7 @@ class ConfigFile:
repo = repo.replace("https://github.com/", "https://raw.githubusercontent.com/").replace("/tree/", "/")
self.custom_repo = repo
self.check_nightly = self.general["check_nightly"]
self.latest_version = util.current_version(self.version, nightly=self.check_nightly)
self.latest_version = util.current_version(self.version, env_version=self.env_version, nightly=self.check_nightly)
self.session = requests.Session()
if not self.general["verify_ssl"]:

View file

@ -103,9 +103,11 @@ parental_labels = [f"{t.capitalize()}:{v}" for t in parental_types for v in pare
previous_time = None
start_time = None
def current_version(version, nightly=False):
if nightly:
def current_version(version, env_version=None, nightly=False):
if nightly or env_version == "nightly":
return get_nightly()
elif env_version == "develop":
return get_develop()
elif version[2] > 0:
new_version = get_develop()
if version[1] != new_version[1] or new_version[2] >= version[2]:

View file

@ -76,6 +76,7 @@ def get_arg(env_str, default, arg_bool=False, arg_int=False):
else:
return default
env_version = get_arg("BRANCH_NAME", "master")
is_docker = get_arg("PMM_DOCKER", False, arg_bool=True)
is_linuxserver = get_arg("PMM_LINUXSERVER", False, arg_bool=True)
run_arg = " ".join([f'"{s}"' if " " in s else s for s in sys.argv[:]])
@ -192,7 +193,7 @@ def start(attrs):
logger.info_center(" |___/ ")
system_ver = "Docker" if is_docker else "Linuxserver" if is_linuxserver else f"Python {platform.python_version()}"
logger.info(f" Version: {version[0]} ({system_ver})")
latest_version = util.current_version(version)
latest_version = util.current_version(version, env_version=env_version)
new_version = latest_version[0] if latest_version and (version[1] != latest_version[1] or (version[2] and version[2] < latest_version[2])) else None
if new_version:
logger.info(f" Newest Version: {new_version}")
@ -209,6 +210,7 @@ def start(attrs):
attrs["time_obj"] = start_time
attrs["read_only"] = read_only_config
attrs["version"] = version
attrs["env_version"] = env_version
attrs["no_missing"] = no_missing
attrs["no_report"] = no_report
attrs["collection_only"] = collection_only