MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / sync_description

Method sync_description

misc/python/materialize/mzbuild.py:924–948  ·  view source on GitHub ↗

Sync the description to Docker Hub if the image is publishable and a README.md file exists.

(self)

Source from the content-addressed store, hash-verified

922 self.depends_on.append(match.group(1).decode())
923
924 def sync_description(self) -> None:
925 """Sync the description to Docker Hub if the image is publishable
926 and a README.md file exists."""
927
928 if not self.publish:
929 ui.say(f"{self.name} is not publishable")
930 return
931
932 readme_path = self.path / "README.md"
933 has_readme = readme_path.exists()
934 if not has_readme:
935 ui.say(f"{self.name} has no README.md or description")
936 return
937
938 docker_config = os.getenv("DOCKER_CONFIG")
939 spawn.runv(
940 [
941 "docker",
942 "pushrm",
943 f"--file={readme_path}",
944 *([f"--config={docker_config}/config.json"] if docker_config else []),
945 *([f"--short={self.description}"] if self.description else []),
946 self.docker_name(),
947 ]
948 )
949
950 def docker_name(self, tag: str | None = None) -> str:
951 """Return the name of the image on Docker Hub at the given tag."""

Callers 1

mainFunction · 0.80

Calls 2

docker_nameMethod · 0.95
existsMethod · 0.80

Tested by

no test coverage detected