Skip to content

Commit 15b9277

Browse files
Addres review comments
1 parent e0ca6eb commit 15b9277

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@ logs
9595
*.run.log
9696

9797
# locally packaged chart
98-
mongodb-kubernetes-*.tgz
98+
mongodb-kubernetes-*.tgz

scripts/release/helm_registry_login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def helm_registry_login(helm_registry: str, region: str):
5757

5858

5959
def main():
60-
parser = argparse.ArgumentParser(description="A temporary script to demonstrate argument parsing.")
60+
parser = argparse.ArgumentParser(description="Script to login to the dev/staging helm registries.")
6161
parser.add_argument("--build_scenario", type=str, help="Build scenario (e.g., patch, staging etc).")
6262
args = parser.parse_args()
6363

scripts/release/publish_helm_chart.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,28 +85,23 @@ def publish_helm_chart(chart_info: HelmChartInfo):
8585
chart_name, chart_version = update_chart_and_get_metadata(CHART_DIR)
8686
tgz_filename = f"{chart_name}-{chart_version}.tgz"
8787

88-
try:
89-
logger.info(f"Packaging chart: {chart_name} with Version: {chart_version}")
90-
package_command = ["helm", "package", CHART_DIR]
91-
run_command(package_command)
92-
93-
logger.info(f"Pushing chart to registry: {oci_registry}")
94-
push_command = ["helm", "push", tgz_filename, oci_registry]
95-
run_command(push_command)
96-
97-
logger.info(f"Helm Chart {chart_name}:{chart_version} was published successfully!")
98-
finally:
99-
# Cleanup the local .tgz file regardless of push success/failure
100-
if os.path.exists(tgz_filename):
101-
logger.info(f"Cleaning up local file: {tgz_filename}")
102-
os.remove(tgz_filename)
88+
logger.info(f"Packaging chart: {chart_name} with Version: {chart_version}")
89+
package_command = ["helm", "package", CHART_DIR]
90+
run_command(package_command)
10391

92+
logger.info(f"Pushing chart to registry: {oci_registry}")
93+
push_command = ["helm", "push", tgz_filename, oci_registry]
94+
run_command(push_command)
95+
96+
logger.info(f"Helm Chart {chart_name}:{chart_version} was published successfully!")
10497
except Exception as e:
10598
raise Exception(f"Failed publishing the helm chart {e}")
10699

107100

108101
def main():
109-
parser = argparse.ArgumentParser(description="A temporary script to demonstrate argument parsing.")
102+
parser = argparse.ArgumentParser(
103+
description="Script to publish helm chart to the OCI container registry, based on the build scenario."
104+
)
110105
parser.add_argument("--build_scenario", type=str, help="Build scenario (e.g., patch, staging etc).")
111106
args = parser.parse_args()
112107

0 commit comments

Comments
 (0)