@@ -26,6 +26,13 @@ def clone(branch: str, tmp_dir: str) -> None:
26
26
)
27
27
28
28
29
+ def get_commit_hash (tmp_dir : str ) -> str :
30
+ ps = subprocess .run (["git" , "rev-parse" , "--short" , "HEAD" ], cwd = tmp_dir , capture_output = True )
31
+ if ps .returncode != 0 :
32
+ raise SystemExit (ps .returncode )
33
+ return ps .stdout .decode ("utf-8" ).strip ()
34
+
35
+
29
36
def build_manpages (tmp_dir : str ):
30
37
if return_code := subprocess .run (["sh" , "config" ], cwd = tmp_dir ).returncode != 0 :
31
38
raise SystemExit (return_code )
@@ -72,8 +79,9 @@ def copy_images(tmp_dir: str):
72
79
shutil .copytree (f"{ tmp_dir } /doc/man7/img" , "docs/man7/img" )
73
80
74
81
75
- def build_site (version : str ):
76
- return subprocess .run (["mike" , "deploy" , version ]).returncode
82
+ def build_site (commit : str , version : str ):
83
+ commit_msg = f"deploy openssl/openssl@{ commit } to { version } "
84
+ return subprocess .run (["mike" , "deploy" , "-m" , commit_msg , version ]).returncode
77
85
78
86
79
87
def main ():
@@ -83,12 +91,13 @@ def main():
83
91
create_dirs ()
84
92
with tempfile .TemporaryDirectory () as tmp_dir :
85
93
clone (branch , tmp_dir )
94
+ commit = get_commit_hash (tmp_dir )
86
95
if version not in ["1.0.2" , "1.1.1" ]:
87
96
build_manpages (tmp_dir )
88
97
convert_pod_to_md (tmp_dir )
89
98
if version not in ["1.0.2" , "1.1.1" ]:
90
99
copy_images (tmp_dir )
91
- return build_site (version )
100
+ return build_site (commit , version )
92
101
93
102
94
103
if __name__ == "__main__" :
0 commit comments