qubership-pipelines-common-library 0.1.6__tar.gz → 0.1.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/PKG-INFO +3 -1
  2. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/pyproject.toml +2 -1
  3. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/execution/exec_command.py +4 -4
  4. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/git_client.py +18 -1
  5. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/utils/utils_context.py +4 -1
  6. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/LICENSE +0 -0
  7. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/README.md +0 -0
  8. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/__init__.py +0 -0
  9. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/__init__.py +0 -0
  10. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/artifactory_client.py +0 -0
  11. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/execution/__init__.py +0 -0
  12. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/execution/exec_context.py +0 -0
  13. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/execution/exec_context_file.py +0 -0
  14. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/execution/exec_info.py +0 -0
  15. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/execution/exec_logger.py +0 -0
  16. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/github_client.py +0 -0
  17. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/gitlab_client.py +0 -0
  18. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/jenkins_client.py +0 -0
  19. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/kube_client.py +0 -0
  20. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/log_client.py +0 -0
  21. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/minio_client.py +0 -0
  22. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/utils/__init__.py +0 -0
  23. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/utils/rest.py +0 -0
  24. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/utils/utils.py +0 -0
  25. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/utils/utils_dictionary.py +0 -0
  26. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/utils/utils_file.py +0 -0
  27. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/utils/utils_json.py +0 -0
  28. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/utils/utils_string.py +0 -0
  29. {qubership_pipelines_common_library-0.1.6 → qubership_pipelines_common_library-0.1.8}/qubership_pipelines_common_library/v1/webex_client.py +0 -0
@@ -1,10 +1,12 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: qubership-pipelines-common-library
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Qubership Pipelines common library
5
+ License: Apache-2.0
5
6
  Author: Igor Lebedev
6
7
  Author-email: lebedev.light@gmail.com
7
8
  Requires-Python: >=3.11,<4.0
9
+ Classifier: License :: OSI Approved :: Apache Software License
8
10
  Classifier: Programming Language :: Python :: 3
9
11
  Classifier: Programming Language :: Python :: 3.11
10
12
  Classifier: Programming Language :: Python :: 3.12
@@ -1,9 +1,10 @@
1
1
  [tool.poetry]
2
2
  name = "qubership-pipelines-common-library"
3
- version = "0.1.6"
3
+ version = "0.1.8"
4
4
  description = "Qubership Pipelines common library"
5
5
  authors = ["Igor Lebedev <lebedev.light@gmail.com>"]
6
6
  readme = "README.md"
7
+ license = "Apache-2.0"
7
8
  packages = [{include = "qubership_pipelines_common_library"}]
8
9
 
9
10
  [tool.poetry.dependencies]
@@ -25,11 +25,11 @@ class ExecutionCommand:
25
25
  SUCCESS_MSG = "Status: SUCCESS"
26
26
  FAILURE_MSG = "Status: FAILURE"
27
27
 
28
- def __init__(self, context_path: str = None, input_params: dict = None, folder_path: str = None,
29
- parent_context_to_reuse: ExecutionContext = None):
28
+ def __init__(self, context_path: str = None, input_params: dict = None, input_params_secure: dict = None,
29
+ folder_path: str = None, parent_context_to_reuse: ExecutionContext = None):
30
30
  if not context_path:
31
- context_path = create_execution_context(input_params=input_params, folder_path=folder_path,
32
- parent_context_to_reuse=parent_context_to_reuse)
31
+ context_path = create_execution_context(input_params=input_params, input_params_secure=input_params_secure,
32
+ folder_path=folder_path, parent_context_to_reuse=parent_context_to_reuse)
33
33
  self.context = ExecutionContext(context_path)
34
34
 
35
35
  def run(self):
@@ -60,6 +60,10 @@ class GitClient:
60
60
  )
61
61
 
62
62
  def commit_and_push(self, commit_message: str):
63
+ self.commit(commit_message)
64
+ self.push()
65
+
66
+ def commit(self, commit_message: str):
63
67
  """"""
64
68
  if not self._is_cloned():
65
69
  raise Exception("Cannot commit without preliminary cloning")
@@ -73,7 +77,20 @@ class GitClient:
73
77
  self.repo.config_writer().set_value("user", "name", self.username).release()
74
78
  self.repo.config_writer().set_value("user", "email", self.email).release()
75
79
  self.repo.git.commit('-a', '-m', commit_message)
76
- self.repo.git.push(self.repo.remote().name, self.repo.active_branch.name)
80
+
81
+ def push(self):
82
+ """"""
83
+ if not self._is_cloned():
84
+ raise Exception("Cannot push without preliminary cloning")
85
+ logging.debug(f"Push into remote = {self.repo.remote().name} and branch = {self.repo.active_branch.name}")
86
+ self.repo.git.push(self.repo.remote().name, self.repo.active_branch.name)
87
+
88
+ def pull(self, **kwargs):
89
+ """"""
90
+ if not self._is_cloned():
91
+ raise Exception("Cannot pull without preliminary cloning")
92
+ logging.debug(f"Pull with options: {kwargs}")
93
+ self.repo.git.pull(**kwargs)
77
94
 
78
95
  def get_file_content_utf8(self, relative_path: str):
79
96
  """"""
@@ -38,9 +38,11 @@ def init_context(context_path):
38
38
  UtilsFile.write_yaml(context_path, context)
39
39
 
40
40
 
41
- def create_execution_context(input_params: dict = None, folder_path: str = None, parent_context_to_reuse: ExecutionContext = None):
41
+ def create_execution_context(input_params: dict = None, input_params_secure: dict = None, folder_path: str = None,
42
+ parent_context_to_reuse: ExecutionContext = None):
42
43
  """params:
43
44
  input_params: dict (will be merged into created input params)
45
+ input_params_secure: dict (will be merged into created secure input params)
44
46
  folder_path: str (optional, will generate new temp)
45
47
  parent_context_to_reuse: ExecutionContext (optional, to propagate existing input params)
46
48
  """
@@ -71,6 +73,7 @@ def create_execution_context(input_params: dict = None, folder_path: str = None,
71
73
 
72
74
  input_params_file.content = recursive_merge(input_params_file.content, input_params)
73
75
  input_params_file.save(context_file.get("paths.input.params"))
76
+ input_params_secure_file.content = recursive_merge(input_params_secure_file.content, input_params_secure)
74
77
  input_params_secure_file.save(context_file.get("paths.input.params_secure"))
75
78
 
76
79
  ExecutionContextFile().init_params().save(context_file.get("paths.output.params"))