|
2 | 2 |
|
3 | 3 | import datetime |
4 | 4 |
|
5 | | -from bci_build.containercrate import ContainerCrate |
6 | 5 | from bci_build.os_version import CAN_BE_LATEST_OS_VERSION |
7 | 6 | from bci_build.os_version import OsVersion |
8 | 7 | from bci_build.package import DOCKERFILE_RUN |
|
12 | 11 | from bci_build.package import PackageType |
13 | 12 | from bci_build.package import Replacement |
14 | 13 | from bci_build.package import _build_tag_prefix |
| 14 | +from bci_build.package.obs_package import ObsPackage |
15 | 15 | from bci_build.registry import publish_registry |
16 | 16 |
|
17 | 17 | # last version needs to be the newest |
@@ -50,14 +50,11 @@ def _get_sac_supported_until( |
50 | 50 | ) |
51 | 51 |
|
52 | 52 |
|
53 | | -TOMCAT_CONTAINERS = [ |
54 | | - ApplicationStackContainer( |
| 53 | +def _create_tomcat_container( |
| 54 | + os_version: OsVersion, tomcat_ver: str, jre_version: int |
| 55 | +) -> ApplicationStackContainer: |
| 56 | + return ApplicationStackContainer( |
55 | 57 | name="apache-tomcat", |
56 | | - package_name=( |
57 | | - f"apache-tomcat-{tomcat_ver.partition('.')[0]}-image" |
58 | | - if os_version.is_tumbleweed |
59 | | - else f"sac-apache-tomcat-{tomcat_ver.partition('.')[0]}-image" |
60 | | - ), |
61 | 58 | _publish_registry=publish_registry(os_version, app_collection=True), |
62 | 59 | pretty_name="Apache Tomcat", |
63 | 60 | custom_description=( |
@@ -125,15 +122,29 @@ def _get_sac_supported_until( |
125 | 122 | entrypoint_user="tomcat", |
126 | 123 | logo_url="https://tomcat.apache.org/res/images/tomcat.png", |
127 | 124 | ) |
128 | | - for tomcat_ver, os_version, jre_version in ( |
129 | | - ("10.1", OsVersion.TUMBLEWEED, 22), |
130 | | - ("10.1", OsVersion.TUMBLEWEED, 21), |
131 | | - ("10.1", OsVersion.TUMBLEWEED, 17), |
132 | | - ("9", OsVersion.TUMBLEWEED, 17), |
133 | | - ("10.1", OsVersion.SP6, 21), |
134 | | - ("10.1", OsVersion.SP6, 17), |
135 | | - # (10.1, OsVersion.SP7, 21), |
136 | | - ) |
137 | | -] |
138 | 125 |
|
139 | | -TOMCAT_CRATE = ContainerCrate(TOMCAT_CONTAINERS) |
| 126 | + |
| 127 | +TOMCAT_CONTAINERS: list[ObsPackage | ApplicationStackContainer] = [ |
| 128 | + ObsPackage.from_bcis( |
| 129 | + bcis=[ |
| 130 | + _create_tomcat_container(os_version, tomcat_ver, jre_version) |
| 131 | + for tomcat_ver, os_version, jre_version in ( |
| 132 | + ("10.1", OsVersion.TUMBLEWEED, 22), |
| 133 | + ("10.1", OsVersion.TUMBLEWEED, 21), |
| 134 | + ("10.1", OsVersion.TUMBLEWEED, 17), |
| 135 | + ) |
| 136 | + ], |
| 137 | + package_name="apache-tomcat-10-image", |
| 138 | + ), |
| 139 | + _create_tomcat_container(OsVersion.TUMBLEWEED, "9", 17), |
| 140 | + ObsPackage.from_bcis( |
| 141 | + package_name="sac-apache-tomcat-image", |
| 142 | + bcis=[ |
| 143 | + _create_tomcat_container(os_version, tomcat_ver, jre_version) |
| 144 | + for tomcat_ver, os_version, jre_version in ( |
| 145 | + ("10.1", OsVersion.SP6, 21), |
| 146 | + ("10.1", OsVersion.SP6, 17), |
| 147 | + ) |
| 148 | + ], |
| 149 | + ), |
| 150 | +] |
0 commit comments