This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new bad0052  automate ballista version update in user doc (#926)
bad0052 is described below

commit bad0052b2a17069b07ec058d24f2d709f9703db3
Author: QP Hou <[email protected]>
AuthorDate: Mon Aug 23 04:11:23 2021 -0700

    automate ballista version update in user doc (#926)
---
 dev/update_ballista_versions.py | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/dev/update_ballista_versions.py b/dev/update_ballista_versions.py
index f4319e2..7023541 100755
--- a/dev/update_ballista_versions.py
+++ b/dev/update_ballista_versions.py
@@ -55,6 +55,17 @@ def update_cargo_toml(cargo_toml: str, new_version: str):
         f.write(tomlkit.dumps(doc))
 
 
+def update_docker_compose(docker_compose_path: str, new_version: str):
+    print(f'Updating ballista versions in {docker_compose_path}')
+    with open(docker_compose_path, "r+") as fd:
+        data = fd.read()
+        pattern = 
re.compile(r'(^\s+image:\sballista:)\d+\.\d+\.\d+(-SNAPSHOT)?', re.MULTILINE)
+        data = pattern.sub(r"\g<1>"+new_version, data)
+        fd.truncate(0)
+        fd.seek(0)
+        fd.write(data)
+
+
 def main():
     parser = argparse.ArgumentParser(description='Update ballista crate 
versions.')
     parser.add_argument('new_version', type=str, help='new ballista version')
@@ -78,15 +89,9 @@ def main():
     for cargo_toml in ballista_crates:
         update_cargo_toml(cargo_toml, new_version)
 
-    docker_compose_path = os.path.join(repo_root, 
"benchmarks/docker-compose.yaml")
-    print(f'Updating ballista versions in {docker_compose_path}')
-    with open(docker_compose_path, "r+") as fd:
-        data = fd.read()
-        pattern = 
re.compile(r'(^\s+image:\sballista:)\d+\.\d+\.\d+(-SNAPSHOT)?', re.MULTILINE)
-        data = pattern.sub(r"\g<1>"+new_version, data)
-        fd.truncate(0)
-        fd.seek(0)
-        fd.write(data)
+    for path in ("benchmarks/docker-compose.yaml", 
"docs/user-guide/src/distributed/docker-compose.md"):
+        path = os.path.join(repo_root, path)
+        update_docker_compose(path, new_version)
 
 
 if __name__ == "__main__":

Reply via email to