[7] add version to docker

pull/1282/head
meisnate12 2 years ago
parent dc5e52b146
commit 278037b8f0

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

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

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

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

@ -114,6 +114,7 @@ class ConfigFile:
self.default_dir = default_dir self.default_dir = default_dir
self.read_only = attrs["read_only"] if "read_only" in attrs else False self.read_only = attrs["read_only"] if "read_only" in attrs else False
self.version = attrs["version"] if "version" in attrs else None 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_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.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 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/", "/") repo = repo.replace("https://github.com/", "https://raw.githubusercontent.com/").replace("/tree/", "/")
self.custom_repo = repo self.custom_repo = repo
self.check_nightly = self.general["check_nightly"] 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() self.session = requests.Session()
if not self.general["verify_ssl"]: if not self.general["verify_ssl"]:

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

@ -76,6 +76,7 @@ def get_arg(env_str, default, arg_bool=False, arg_int=False):
else: else:
return default return default
env_version = get_arg("BRANCH_NAME", "master")
is_docker = get_arg("PMM_DOCKER", False, arg_bool=True) is_docker = get_arg("PMM_DOCKER", False, arg_bool=True)
is_linuxserver = get_arg("PMM_LINUXSERVER", 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[:]]) 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(" |___/ ") logger.info_center(" |___/ ")
system_ver = "Docker" if is_docker else "Linuxserver" if is_linuxserver else f"Python {platform.python_version()}" 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})") 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 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: if new_version:
logger.info(f" Newest Version: {new_version}") logger.info(f" Newest Version: {new_version}")
@ -209,6 +210,7 @@ def start(attrs):
attrs["time_obj"] = start_time attrs["time_obj"] = start_time
attrs["read_only"] = read_only_config attrs["read_only"] = read_only_config
attrs["version"] = version attrs["version"] = version
attrs["env_version"] = env_version
attrs["no_missing"] = no_missing attrs["no_missing"] = no_missing
attrs["no_report"] = no_report attrs["no_report"] = no_report
attrs["collection_only"] = collection_only attrs["collection_only"] = collection_only

Loading…
Cancel
Save