()
| 9 | |
| 10 | @cache |
| 11 | def build_hash() -> str: |
| 12 | if environ.get("CODEBUILD_RESOLVED_SOURCE_VERSION") is not None: |
| 13 | build_hash = environ["CODEBUILD_RESOLVED_SOURCE_VERSION"] |
| 14 | else: |
| 15 | try: |
| 16 | build_hash = run_cmd_output(["git", "rev-parse", "HEAD"]).strip() |
| 17 | except Exception as e: |
| 18 | warn("Failed to get build hash:", e) |
| 19 | build_hash = "unknown" |
| 20 | info("build_hash =", build_hash) |
| 21 | return build_hash |
| 22 | |
| 23 | |
| 24 | @cache |