Compare commits
7
Commits
79bccb6ec5
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd7f896c7d | ||
|
|
f4080a4b95 | ||
|
|
8ac62992f9 | ||
|
|
8e771728c4 | ||
|
|
b8be14da88 | ||
|
|
75358b59dd | ||
|
|
e608a98743 |
+30
@@ -0,0 +1,30 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: run tests
|
||||
image: python:3.10-alpine
|
||||
commands:
|
||||
- export POETRY_HOME=/opt/poetry
|
||||
- python3 -m venv $POETRY_HOME
|
||||
- $POETRY_HOME/bin/pip install poetry==1.3.2
|
||||
- $POETRY_HOME/bin/poetry install
|
||||
- $POETRY_HOME/bin/poetry run pytest -s
|
||||
|
||||
- name: publishing
|
||||
image: python:3.10-alpine
|
||||
environment:
|
||||
PYPI_USERNAME:
|
||||
from_secret: PYPI_USERNAME
|
||||
PYPI_PASSWORD:
|
||||
from_secret: PYPI_PASSWORD
|
||||
commands:
|
||||
- export POETRY_HOME=/opt/poetry
|
||||
- python3 -m venv $POETRY_HOME
|
||||
- $POETRY_HOME/bin/pip install poetry==1.3.2
|
||||
- $POETRY_HOME/bin/poetry install
|
||||
- $POETRY_HOME/bin/poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
@@ -6,4 +6,10 @@
|
||||
Added the function that gets a list of tags from a repository.
|
||||
** 0.3.0 <2023-06-18 Sun>
|
||||
Added the filter option for a list of tags.
|
||||
** 0.3.1 <2023-06-19 Mon>
|
||||
Added the CI/CD configuration and tests.
|
||||
** 0.3.2 <2023-06-19 Mon>
|
||||
Updated the description.
|
||||
** 0.3.3 <2023-06-19 Mon>
|
||||
Fixed the error in README.rst.
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
docker_tags_getter
|
||||
=========
|
||||
==================
|
||||
|
||||
docker_tags_getter is the application that will help you to get tags from yours docker repository.
|
||||
|
||||
|
||||
@@ -48,6 +48,11 @@ def tags(
|
||||
help="[b]The tags[/] will be filtered.",
|
||||
show_default=False
|
||||
),
|
||||
full_name: bool = typer.Option(
|
||||
None, "--full-name", "-fn",
|
||||
help="[b]The tags[/] will be shown with their [b]namespace and repository[/].",
|
||||
show_default=False
|
||||
),
|
||||
):
|
||||
"""
|
||||
[green b]All tags[/] will be returned for the [yellow b]namespace[/].
|
||||
@@ -74,6 +79,10 @@ def tags(
|
||||
tags_filter = TagsFilter()
|
||||
tags = tags_filter.filter_list(tags)
|
||||
|
||||
prefix = ''
|
||||
if full_name:
|
||||
prefix = f'{namespace}/{repository}:'
|
||||
|
||||
for tag in tags:
|
||||
console.print(tag)
|
||||
console.print(f'{prefix}{tag}')
|
||||
|
||||
|
||||
Generated
+91
-1
@@ -124,6 +124,21 @@ files = [
|
||||
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "exceptiongroup"
|
||||
version = "1.1.1"
|
||||
description = "Backport of PEP 654 (exception groups)"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "exceptiongroup-1.1.1-py3-none-any.whl", hash = "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e"},
|
||||
{file = "exceptiongroup-1.1.1.tar.gz", hash = "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
test = ["pytest (>=6)"]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "3.4"
|
||||
@@ -136,6 +151,18 @@ files = [
|
||||
{file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iniconfig"
|
||||
version = "2.0.0"
|
||||
description = "brain-dead simple config-ini parsing"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"},
|
||||
{file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "markdown-it-py"
|
||||
version = "3.0.0"
|
||||
@@ -173,6 +200,34 @@ files = [
|
||||
{file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "23.1"
|
||||
description = "Core utilities for Python packages"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"},
|
||||
{file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pluggy"
|
||||
version = "1.0.0"
|
||||
description = "plugin and hook calling mechanisms for python"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
files = [
|
||||
{file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"},
|
||||
{file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
dev = ["pre-commit", "tox"]
|
||||
testing = ["pytest", "pytest-benchmark"]
|
||||
|
||||
[[package]]
|
||||
name = "pygments"
|
||||
version = "2.15.1"
|
||||
@@ -188,6 +243,29 @@ files = [
|
||||
[package.extras]
|
||||
plugins = ["importlib-metadata"]
|
||||
|
||||
[[package]]
|
||||
name = "pytest"
|
||||
version = "7.3.2"
|
||||
description = "pytest: simple powerful testing with Python"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "pytest-7.3.2-py3-none-any.whl", hash = "sha256:cdcbd012c9312258922f8cd3f1b62a6580fdced17db6014896053d47cddf9295"},
|
||||
{file = "pytest-7.3.2.tar.gz", hash = "sha256:ee990a3cc55ba808b80795a79944756f315c67c12b56abd3ac993a7b8c17030b"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
colorama = {version = "*", markers = "sys_platform == \"win32\""}
|
||||
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
|
||||
iniconfig = "*"
|
||||
packaging = "*"
|
||||
pluggy = ">=0.12,<2.0"
|
||||
tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
|
||||
|
||||
[package.extras]
|
||||
testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
|
||||
|
||||
[[package]]
|
||||
name = "requests"
|
||||
version = "2.31.0"
|
||||
@@ -229,6 +307,18 @@ pygments = ">=2.13.0,<3.0.0"
|
||||
[package.extras]
|
||||
jupyter = ["ipywidgets (>=7.5.1,<9)"]
|
||||
|
||||
[[package]]
|
||||
name = "tomli"
|
||||
version = "2.0.1"
|
||||
description = "A lil' TOML parser"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
|
||||
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typer"
|
||||
version = "0.9.0"
|
||||
@@ -284,4 +374,4 @@ zstd = ["zstandard (>=0.18.0)"]
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.9"
|
||||
content-hash = "9a11dcaec82f8878f39d103439a0655df2a47c50cd984889e8897b65140ef23d"
|
||||
content-hash = "7ceb8c42d937b3942cbda1632636bdf5a742914ce255fb2e6252effc2b54445c"
|
||||
|
||||
+7
-2
@@ -1,7 +1,7 @@
|
||||
[tool.poetry]
|
||||
name = "docker-tags-getter"
|
||||
version = "0.3.0"
|
||||
description = ""
|
||||
version = "0.3.5"
|
||||
description = "docker_tags_getter will help you to get tags from your docker repository."
|
||||
authors = ["Kostiantyn Klochko <kostya_klochko@ukr.net>"]
|
||||
readme = "README.rst"
|
||||
license = "LGPL-3.0-or-later"
|
||||
@@ -20,6 +20,11 @@ requests = "^2.31.0"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
dtg = "docker_tags_getter.main:main"
|
||||
docker_tags_getter = "docker_tags_getter.main:main"
|
||||
docker-tags-getter = "docker_tags_getter.main:main"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
pytest = "^7.3.2"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import pytest
|
||||
|
||||
@pytest.fixture
|
||||
def tags_architectures():
|
||||
def get_architectures_tags():
|
||||
tags = [
|
||||
"8.0.33-25.1",
|
||||
"8.0.33-25.1-aarch64",
|
||||
"8.0.33-25.1-multi"
|
||||
]
|
||||
|
||||
return tags
|
||||
return get_architectures_tags
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import pytest
|
||||
from docker_tags_getter.filters.tags_filter import TagsFilter
|
||||
|
||||
def test_filter_architectures(tags_architectures):
|
||||
tags = tags_architectures()
|
||||
tags_filter = TagsFilter()
|
||||
|
||||
assert 3 == len(tags)
|
||||
|
||||
tags = tags_filter.filter_list(tags)
|
||||
|
||||
assert 1 == len(tags)
|
||||
|
||||
Reference in New Issue
Block a user