-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy_files.py
47 lines (40 loc) · 1.58 KB
/
deploy_files.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/env python
# SPDX-FileCopyrightText: © 2022 ELABIT GmbH <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
# This script was/is used to have the github repo cloned into the dev
# CMK site and then deploy the files to the site.
from pathlib import Path
import os
import shutil
project_root = Path(__file__).parent
omd_root = Path(os.getenv("OMD_ROOT"))
cmk_custom_share = omd_root / "local/share/check_mk"
cmk_custom_agent_based = omd_root / "local/lib/check_mk/base/plugins/agent_based"
share_patterns = [
"agents/special/agent_*",
"checks/agent_*",
"web/plugins/wato/datasource_*",
"web/plugins/wato/discovery_*",
"web/plugins/wato/check_parameters_*",
]
for p in share_patterns:
files = project_root.glob(p)
for file in files:
rel_path = file.relative_to(project_root)
dest_path = cmk_custom_share / file.relative_to(project_root)
print("{} -> {}".format(str(rel_path), str(dest_path)))
shutil.copy(str(file), dest_path)
# AGENT BASED
agent_based_pattern = "agent_based/*"
files = project_root.glob(agent_based_pattern)
for file in files:
rel_path = file.relative_to(project_root)
print("{} -> {}".format(str(rel_path), str(cmk_custom_agent_based)))
shutil.copy(str(file), cmk_custom_agent_based)
# Not used anymore.
# Better clone the WSDL repo on your own from https://github.com/gematik/api-telematik.git
# # WSDL
# wsdl_dir = "lib/wsdl"
# src = project_root / wsdl_dir
# print("{} -> {}".format(str(wsdl_dir), omd_root / "local/lib/wsdl"))
# shutil.copytree(str(src), omd_root / "local/lib/wsdl", dirs_exist_ok=True)