Skip to content

Commit

Permalink
Merge pull request #2048 from SUSE/valkey_major
Browse files Browse the repository at this point in the history
Add major and minor tags to valkey container
  • Loading branch information
dcermak authored Nov 25, 2024
2 parents 9d88626 + 978369b commit a717cbf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/bci_build/package/package_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,9 @@
"6": "0.21.3",
"7": "0.21.3",
"Tumbleweed": "0.22.2"
},
"valkey": {
"Tumbleweed": "8.0",
"version_format": "minor"
}
}
13 changes: 12 additions & 1 deletion src/bci_build/package/valkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
from bci_build.package import ApplicationStackContainer
from bci_build.package import OsContainer
from bci_build.package import OsVersion
from bci_build.package import ParseVersion
from bci_build.package import Replacement
from bci_build.package import _build_tag_prefix
from bci_build.package.helpers import generate_package_version_check
from bci_build.package.versions import format_version
from bci_build.package.versions import get_pkg_version

VALKEY_CONTAINERS = [
ApplicationStackContainer(
Expand All @@ -25,17 +29,24 @@
is_latest=os_version in CAN_BE_LATEST_OS_VERSION,
version="%%valkey_version%%",
version_in_uid=False,
tag_version=format_version(
valkey_version := get_pkg_version("valkey", os_version), ParseVersion.MINOR
),
additional_versions=[format_version(valkey_version, ParseVersion.MAJOR)],
replacements_via_service=[
Replacement(
regex_in_build_description="%%valkey_version%%", package_name="valkey"
)
],
license="BSD-3-Clause",
package_list=["valkey", "valkey-compat-redis"],
package_list=["valkey"],
entrypoint=["/usr/bin/valkey-server"],
entrypoint_user="valkey",
exposes_ports=[TCP(6379)],
volumes=["/data"],
build_stage_custom_end=generate_package_version_check(
"valkey", valkey_version, ParseVersion.MINOR, use_target=True
),
custom_end=textwrap.dedent(
f"""
{DOCKERFILE_RUN} install -o valkey -g valkey -m 750 -d /data
Expand Down

0 comments on commit a717cbf

Please sign in to comment.