Skip to content

Commit c0471ac

Browse files
Improve some commit msgs
1 parent 64131c4 commit c0471ac

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

gitopscli/commands/create_preview.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ def create_preview_command(
7373
branch_preview_env_already_exist = os.path.exists(root_git.get_full_file_path(new_preview_folder_name))
7474
logging.info("Is preview env already existing for branch? %s", branch_preview_env_already_exist)
7575
if not branch_preview_env_already_exist:
76-
__create_new_preview_env(branch, new_preview_folder_name, preview_template_folder_name, root_git)
76+
__create_new_preview_env(
77+
branch, new_preview_folder_name, preview_template_folder_name, root_git, gitops_config.application_name
78+
)
7779
new_image_tag = apps_git.get_last_commit_hash()
7880
logging.info("Using image tag from last app repo commit: %s", new_image_tag)
7981
route_host = None
@@ -154,7 +156,7 @@ def __no_deployment_needed(apps_git, new_image_tag, parent_id, pr_id):
154156

155157

156158
def __create_new_preview_env(
157-
branch, new_preview_folder_name, preview_template_folder_name, root_git,
159+
branch, new_preview_folder_name, preview_template_folder_name, root_git, app_name,
158160
):
159161
shutil.copytree(
160162
root_git.get_full_file_path(preview_template_folder_name), root_git.get_full_file_path(new_preview_folder_name),
@@ -163,11 +165,11 @@ def __create_new_preview_env(
163165
logging.info("Looking for Chart.yaml at: %s", chart_file_path)
164166
if root_git.get_full_file_path(chart_file_path):
165167
update_yaml_file(root_git.get_full_file_path(chart_file_path), "name", new_preview_folder_name)
166-
root_git.commit(f"Initiated new preview env for branch {branch}'")
168+
root_git.commit(f"Create new preview env for application: {app_name} and branch: {branch}")
167169

168170

169171
def __create_pullrequest(branch, gitops_config, root_git):
170-
title = "Updated preview environemnt for " + gitops_config.application_name
172+
title = "Updated preview environment for " + gitops_config.application_name
171173
description = f"""
172174
This Pull Request is automatically created through [gitopscli](https://github.com/baloise-incubator/gitopscli).
173175
"""

gitopscli/commands/delete_preview.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ def delete_preview_command(
7272
else:
7373
logging.info("There was no preview with name: %s", new_preview_folder_name)
7474
sys.exit(0)
75-
root_git.commit(f"Deleted preview environment for {gitops_config.application_name} and branch {branch}.")
75+
root_git.commit(
76+
f"Deleted preview environment for application: {gitops_config.application_name} and branch: {branch}."
77+
)
7678
root_git.push(branch)
7779
logging.info("Pushed branch %s", branch)
7880

@@ -86,7 +88,7 @@ def delete_preview_command(
8688

8789

8890
def __create_pullrequest(branch, gitops_config, root_git):
89-
title = "Updated preview environemnt for " + gitops_config.application_name
91+
title = "Deleted preview environment for " + gitops_config.application_name
9092
description = f"""
9193
This Pull Request is automatically created through [gitopscli](https://github.com/baloise-incubator/gitopscli).
9294
"""

0 commit comments

Comments
 (0)