4 Commits

Author SHA1 Message Date
ramius
b182c6e1c2 Merge pull request #2 from ramiuslr/feat/strict_version_and_tag
Feat/strict version and tag
2025-05-21 16:42:55 +02:00
179b035c44 Add example to readme 2025-05-21 16:36:49 +02:00
7a84ada939 Use python slim image 2025-05-21 16:32:15 +02:00
a09dcde365 Add other bad keywords to exclusions 2025-05-12 14:51:38 +02:00
4 changed files with 39 additions and 12 deletions

View File

@@ -2,7 +2,7 @@ name: ci
on:
push:
branches: [ "master" ]
branches: [ "*" ]
tags: [ "*" ]
pull_request:

View File

@@ -1,11 +1,16 @@
# Init image
FROM python:3
FROM python:slim
WORKDIR /app
# Install requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN wget -O /usr/bin/regctl https://github.com/regclient/regclient/releases/latest/download/regctl-linux-amd64
RUN python - <<EOF
from urllib.request import urlopen;
from pathlib import Path;
Path("/usr/bin/regctl").write_bytes(urlopen("https://github.com/regclient/regclient/releases/latest/download/regctl-linux-amd64").read())
EOF
RUN chmod 755 /usr/bin/regctl
# Import app

View File

@@ -14,6 +14,30 @@ All images are exposed to `http://0.0.0.0:8000/all` in JSON format.
If you want to get only images needing update, look at `http://0.0.0.0:8000/updates`.
Here is a quick example of what you get on the `/all` endpoint (dockup don't have local tag because it is a locally built image):
```json
[
{
"name": "dockup",
"repo": "dockup-dockup",
"local_tag": "latest",
"remote_tag": null
},
{
"name": "wikijs-wiki-1",
"repo": "ghcr.io/requarks/wiki",
"local_tag": "2.5.307",
"remote_tag": "2.5.307"
},
{
"name": "wikijs-db-1",
"repo": "postgres",
"local_tag": "17.4-alpine",
"remote_tag": "17.5-alpine"
}
]
```
# Requirements
This program needs [regctl](https://github.com/regclient/regclient.git).
It is shipped with container image by default, however you'll need to install it by yourself if running script directly.

16
dockup
View File

@@ -136,15 +136,13 @@ def get_remote_tags(images):
for tag in tags:
# Skip mismatched suffixes
if local_suffix and not tag.endswith(local_suffix):
continue
# Skip non-production versions
if any(
bad_keyword in tag.lower()
for bad_keyword in ["test", "rc", "alpha"]
):
continue
if local_suffix:
if not tag.endswith(local_suffix):
continue
else:
# Skip tags with suffixes if local has none
if "-" in tag:
continue
# Validate version structure
if is_valid_semver(