mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Filter out the CI-related stuff from official docker
This commit is contained in:
parent
259baa1f49
commit
7b65bebe2d
@ -174,6 +174,8 @@ def generate_docker_directories(
|
|||||||
image_type: str = "server",
|
image_type: str = "server",
|
||||||
) -> None:
|
) -> None:
|
||||||
arg_version = "ARG VERSION="
|
arg_version = "ARG VERSION="
|
||||||
|
start_filter = "#docker-official-library:off"
|
||||||
|
stop_filter = "#docker-official-library:on"
|
||||||
for version, directory in version_dirs.items():
|
for version, directory in version_dirs.items():
|
||||||
branch = docker_branch if use_docker_from_branch else version.describe
|
branch = docker_branch if use_docker_from_branch else version.describe
|
||||||
logging.debug(
|
logging.debug(
|
||||||
@ -187,17 +189,31 @@ def generate_docker_directories(
|
|||||||
)
|
)
|
||||||
(directory / "README.md").unlink(missing_ok=True)
|
(directory / "README.md").unlink(missing_ok=True)
|
||||||
for df in directory.glob("Dockerfile.*"):
|
for df in directory.glob("Dockerfile.*"):
|
||||||
content = df.read_text().splitlines()
|
original_content = df.read_text().splitlines()
|
||||||
for idx, line in enumerate(content):
|
content = []
|
||||||
|
filtering = False
|
||||||
|
for line in original_content:
|
||||||
|
# Change the ARG VERSION= to a proper version
|
||||||
if line.startswith(arg_version):
|
if line.startswith(arg_version):
|
||||||
logging.debug(
|
logging.debug(
|
||||||
"Found '%s' in line %s:%s, setting to version %s",
|
"Found '%s' in line %s:%s, setting to version %s",
|
||||||
arg_version,
|
arg_version,
|
||||||
df.name,
|
df.name,
|
||||||
idx,
|
original_content.index(line),
|
||||||
version,
|
version,
|
||||||
)
|
)
|
||||||
content[idx] = f'{arg_version}"{version}"'
|
content.append(f'{arg_version}"{version}"')
|
||||||
|
continue
|
||||||
|
# Filter out CI-related part from official docker
|
||||||
|
if line == start_filter:
|
||||||
|
filtering = True
|
||||||
|
continue
|
||||||
|
if line == stop_filter:
|
||||||
|
filtering = False
|
||||||
|
continue
|
||||||
|
if not filtering:
|
||||||
|
content.append(line)
|
||||||
|
|
||||||
df.write_text("\n".join(content) + "\n")
|
df.write_text("\n".join(content) + "\n")
|
||||||
if build_images:
|
if build_images:
|
||||||
git_runner(
|
git_runner(
|
||||||
|
Loading…
Reference in New Issue
Block a user