docker.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. import os
  10. from pathlib import Path
  11. from ci import tarball_uploader
  12. from materialize import mzbuild, ui
  13. from materialize.rustc_flags import Sanitizer
  14. from materialize.xcompile import Arch
  15. from .deploy_util import MZ_CLI_VERSION
  16. def main() -> None:
  17. bazel = ui.env_is_truthy("CI_BAZEL_BUILD")
  18. bazel_remote_cache = os.getenv("CI_BAZEL_REMOTE_CACHE")
  19. bazel_lto = ui.env_is_truthy("CI_BAZEL_LTO")
  20. repos = [
  21. mzbuild.Repository(
  22. Path("."),
  23. Arch.X86_64,
  24. coverage=False,
  25. sanitizer=Sanitizer.none,
  26. bazel=bazel,
  27. bazel_remote_cache=bazel_remote_cache,
  28. bazel_lto=bazel_lto,
  29. ),
  30. mzbuild.Repository(
  31. Path("."),
  32. Arch.AARCH64,
  33. coverage=False,
  34. sanitizer=Sanitizer.none,
  35. bazel=bazel,
  36. bazel_remote_cache=bazel_remote_cache,
  37. bazel_lto=bazel_lto,
  38. ),
  39. ]
  40. print("--- Tagging Docker images")
  41. deps = [[repo.resolve_dependencies([repo.images["mz"]])["mz"]] for repo in repos]
  42. mzbuild.publish_multiarch_images(f"v{MZ_CLI_VERSION.str_without_prefix()}", deps)
  43. if tarball_uploader.is_latest_version(MZ_CLI_VERSION):
  44. mzbuild.publish_multiarch_images("latest", deps)
  45. if __name__ == "__main__":
  46. main()