Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC: Add auto-bump logic to CDK command #32721

Closed
wants to merge 20 commits into from
14 changes: 8 additions & 6 deletions tools/bin/bump_cdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
# Step 1: Get the connector selector from the command line

import argparse
import datetime
import os
import re
import subprocess
import sys
import datetime

parser = argparse.ArgumentParser(description="Bump CDK version for connectors")
parser.add_argument("--selector", required=True, help="Connector selector")
Expand Down Expand Up @@ -139,7 +139,7 @@
# write back
manifestFile = open(manifestFilePath, "w")
manifestFile.write(manifestFileObject)
manifestFile.close()
manifestFile.close()

# if there is a Dockerfile, bump the version there too (line starts with LABEL io.airbyte.version=)
dockerFilePath = f"./airbyte-integrations/connectors/{connector}/Dockerfile"
Expand All @@ -151,7 +151,7 @@
# write back
dockerFile = open(dockerFilePath, "w")
dockerFile.write(dockerFileObject)
dockerFile.close()
dockerFile.close()
else:
print(f"No dockerImageTag found, skipping bumping tag for {connector}")

Expand All @@ -163,9 +163,11 @@

# Get the documentation file path
just_the_name = connector.replace("source-", "").replace("destination-", "")
documentationFilePath = f"./docs/integrations/sources/{just_the_name}.md" if os.path.exists(
documentationFilePath = (
f"./docs/integrations/sources/{just_the_name}.md"
) else f"./docs/integrations/destinations/{just_the_name}.md"
if os.path.exists(f"./docs/integrations/sources/{just_the_name}.md")
else f"./docs/integrations/destinations/{just_the_name}.md"
)

documentationFile = open(documentationFilePath, "r")
documentationFileObject = documentationFile.read()
Expand All @@ -181,7 +183,7 @@
)
else:
print(f"No changelog table found, skipping adding changelog entry for {connector}")

# write back
documentationFile = open(documentationFilePath, "w")
documentationFile.write(documentationFileObject)
Expand Down