Skip to content

Commit f5082f5

Browse files
committed
support non-executable files during pipeline setup
If a file in the pipeline setup scripts directory starts with an underscore, then it is treated as a "non-executable" file and it will not be executed. This is required for #10637 where a large SQL setup script is needed to be referenced by one of the other scripts, but the SQL script itself must not be executed.
1 parent 7ec881f commit f5082f5

File tree

1 file changed

+5
-2
lines changed
  • datadog_checks_dev/datadog_checks/dev/tooling/commands/ci

1 file changed

+5
-2
lines changed

datadog_checks_dev/datadog_checks/dev/tooling/commands/ci/setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ def setup(checks, changed):
5151
echo_debug(f"Skip! No scripts for check `{check}` and platform `{cur_platform}`")
5252
continue
5353

54-
scripts = sorted(os.listdir(os.path.join(check_scripts_path, cur_platform)))
55-
echo_info(f'Setting up: {check} with these config scripts: {scripts}')
54+
setup_files = sorted(os.listdir(os.path.join(check_scripts_path, cur_platform)))
55+
scripts = [s for s in setup_files if not s.startswith("_")]
56+
non_exe = [s for s in setup_files if s.startswith("_")]
57+
non_exe_msg = f" (Non-executable setup files: {non_exe})" if non_exe else ""
58+
echo_info(f'Setting up: {check} with these config scripts: {scripts}{non_exe_msg}')
5659

5760
for script in scripts:
5861
script_file = os.path.join(check_scripts_path, cur_platform, script)

0 commit comments

Comments
 (0)