Skip to content

Commit

Permalink
#548 fix .overrides directory being included in cf
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Aug 25, 2022
1 parent 184845c commit 0006c09
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tools/cloudharness_utilities/codefresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def create_k8s_rollout_commands():
cmds[i] = cmds[i].replace("$ENV", "-".join(envs))
cmds[i] = cmds[i].replace("$PARAMS", " ".join(params))
cmds[i] = cmds[i].replace("$PATHS", " ".join(os.path.relpath(
root_path, '.') for root_path in root_paths))
root_path, '.') for root_path in root_paths if DEFAULT_MERGE_PATH not in root_path))

if save:
codefresh_abs_path = join(
Expand Down
1 change: 1 addition & 0 deletions tools/cloudharness_utilities/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ROOT = os.path.dirname(HERE)

APPLICATION_TEMPLATE_PATH = 'application-templates'
DEFAULT_MERGE_PATH = ".overrides"

HELM_PATH = "helm"
HELM_CHART_PATH = HELM_PATH
Expand Down
8 changes: 3 additions & 5 deletions tools/cloudharness_utilities/preprocessing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from email.mime import base
from genericpath import exists
import os

Expand All @@ -9,12 +8,11 @@
from cloudharness_utilities.helm import KEY_APPS, KEY_TASK_IMAGES

from .utils import app_name_from_path, merge_app_directories, merge_configuration_directories, find_subdirs
from .constants import APPS_PATH, HELM_CHART_PATH, DEPLOYMENT_CONFIGURATION_PATH, DEPLOYMENT_PATH, \
BASE_IMAGES_PATH, STATIC_IMAGES_PATH
from .constants import APPS_PATH,BASE_IMAGES_PATH, STATIC_IMAGES_PATH, DEFAULT_MERGE_PATH



def preprocess_build_overrides(root_paths, helm_values, merge_build_path=".overrides"):
def preprocess_build_overrides(root_paths, helm_values, merge_build_path=DEFAULT_MERGE_PATH):
if not isabs(merge_build_path):
merge_build_path = join(os.getcwd(), merge_build_path)
if len(root_paths) < 2:
Expand Down Expand Up @@ -73,7 +71,7 @@ def merge_appdir(root_path, base_path):

return (root_paths + [merge_build_path]) if merged else root_paths

def get_build_paths(root_paths, helm_values, merge_build_path=".overrides"):
def get_build_paths(root_paths, helm_values, merge_build_path=DEFAULT_MERGE_PATH):
"""
Gets the same paths from preprocess_build_overrides
"""
Expand Down

0 comments on commit 0006c09

Please sign in to comment.