Skip to content

Commit

Permalink
update bump_connectors_version.py to correctly update Dockerfile and … (
Browse files Browse the repository at this point in the history
  • Loading branch information
aimethed authored Oct 24, 2024
1 parent 9853060 commit 631c590
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tools/bump_versions/bump_connectors_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
common.update_yaml(yaml_files, new_version)

# Bump the versions in the Dockerfiles
dockerfiles = glob.glob("Dockerfile")
dockerfiles = glob.glob(f"{connector}/Dockerfile")
common.update_dockerfile(dockerfiles, new_version)
10 changes: 5 additions & 5 deletions tools/bump_versions/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def output_xml(soup, filename):

def update_yaml(yaml_files, new_version):
for yml in yaml_files:
subprocess.run(["sed", "-i", f"s/\(SemanticVersion:\s*\).*/\\1{new_version}/", yml])
subprocess.run(["sed", "-i", f"s/\(CodeUri:.*-\)[0-9]*\.[0-9]*\.[0-9]*\(-\?.*\.jar\)/\\1{new_version}\\2/", yml])
subprocess.run(["sed", "-i", f"s/\(ImageUri:.*:\)[0-9]*\.[0-9]*\.[0-9]*\(\'\)/\\1{new_version}\\2/", yml])
subprocess.run(["sed", "-i", '', f"s/\(SemanticVersion:\s*\).*/\\1{new_version}/", yml])
subprocess.run(["sed", "-i", '', f"s/\(CodeUri:.*-\)[0-9]*\.[0-9]*\.[0-9]*\(-\?.*\.jar\)/\\1{new_version}\\2/", yml])
subprocess.run(["sed", "-i", '', f"s|\(athena-federation-repository-.*:\)[0-9]*\.[0-9]*\.[0-9]*\(\'\)|\\1{new_version}\\2|", yml])


def update_dockerfile(dockerfiles, new_version):
for file in dockerfiles:
subprocess.run(["sed", "-i", f"s/\(COPY\s.*-\)[0-9]*\.[0-9]*\.[0-9]*\(\.jar.*\)/\\1{new_version}\\2/", file])
subprocess.run(["sed", "-i", f"s/\(RUN\sjar\sxf.*-\)[0-9]*\.[0-9]*\.[0-9]*\(\.jar\)/\\1{new_version}\\2/", file])
subprocess.run(["sed", "-i", '', f"s|\(target\/.*-\)[0-9]*\.[0-9]*\.[0-9]*|\\1{new_version}|", file])
subprocess.run(["sed", "-i", '', f"s|\(xf\s*.*-\)[0-9]*\.[0-9]*\.[0-9]*|\\1{new_version}|", file])


def update_project_version(soup, new_version):
Expand Down

0 comments on commit 631c590

Please sign in to comment.