Skip to content

Commit

Permalink
add local component-cli to path
Browse files Browse the repository at this point in the history
`cli.py pipeline component_descriptor` command was originally used for
migration from (deprecated) "component-cli" (golang binary) to
drop-in-replacement in this repository (bin/component-cli). Back then,
it made sense for the command to not implicitly add aforementioned
replacement to PATH.

With migration being done over a year ago, it appears adequate to make
the command more convenient, and let it add component-cli to PATH. Add
it to end of path to still allow callers to use local component-cli.
  • Loading branch information
ccwienk committed Dec 16, 2024
1 parent 18919dc commit eb24560
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/gardener_ci/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
logger = logging.getLogger('pipeline-cli')

own_dir = os.path.abspath(os.path.dirname(__file__))
cc_utils_root = os.path.join(own_dir, '../..')


def _branch_cfg(
Expand Down Expand Up @@ -438,6 +439,13 @@ def component_descriptor(
'ADD_DEPENDENCIES_CMD': dependencies_cmd,
}

component_cli_path = os.path.join(
cc_utils_root,
'bin',
)
path = f'{os.environ.get('PATH', '')}:{component_cli_path}'
env['PATH'] = path

subprocess.run(
(component_descriptor_script,),
env=env,
Expand Down

0 comments on commit eb24560

Please sign in to comment.