Qubership Pipelines common library
Project description
Qubership Pipelines Common Library
Common python library of clients used by all Qubership pipelines/modules
Library clients description
JenkinsClient
-
Initialization and how to use:
JenkinsClient(host, user, password)
Input params description:
- host - url to Jenkins host environment (example https://self-hosted-jenkins.qubership.org )
- user - username for Jenkins instance
- password - password or token for Jenkins instance
-
Methods description:
-
turn_off_job(job_name)
Input params description:
- job_name - Name of job which need disable.
Output: -
-
turn_on_job(job_name)
Input params description:
- job_name - Name of job which need enable.
Output: -
-
get_job_config(job_name)
Input params description:
- job_name - Name of job which config required.
Output: Job config in XML format.
-
run_pipeline(job_name, job_params)
Input params description:
- job_name - Name of job which config required.
- job_params - Dictionary with params for job start Job params example json:
{"PARAM1":"value1","PARAM2":"value2","PARAM3":"value3"}
NOTE: all parameters and values should be in double quotes
Output: -
-
get_pipeline_execution_status(build_id, job_name)
Input params description:
- build_id - Build id which need to get
- job_name - Name of job which config required.
Output: Execution result status
-
wait_pipeline_execution(build_id, job_name, timeout_seconds, break_status_list)
Input params description:
- build_id - Build id which need to get
- job_name - Name of job which config required.
- timeout_seconds - delay in seconds which execution will wait
- break_status_list - list of string statuses which will break execution if execution status will be in list
Output:
{"build_id":"build_id","build_result":"build result"}
-
cancel_pipeline_execution(build_id, job_name, timeout)
Input params description:
- build_id - Build id which need to get
- job_name - Name of job which config required.
- timeout - optional parameter which indicates timeout delay before stop execution, 0 by default
Output: -
GitClient
-
Initialization and how to use:
GitClient(host, username, password, email)
Input params description:
- host - url to Git host (example https://git.qubership.org)
- user - username for Git
- password - password or token for Git
- email - user mail
-
Methods description:
-
clone(repo_path, branch, temp_path)
Input params description:
- repo_path - Path to repo which should be cloned.
- branch - branch name which need to be cloned
- temp_path - Path to temp folder
Output: -
-
commit_and_push(commit_message)
Input params description:
- commit_message - Message for commit to active repo branch.
Output: -
-
get_file_content_utf8(relative_path)
Input params description:
- relative_path - Path to file which need to get.
Output: File content for input file path.
-
set_file_content_utf8(relative_path, content)
Input params description:
- relative_path - Path to file which need to get.
- content - file content which need to be set.
Output: -
-
delete_by_path(relative_path)
Input params description:
- relative_path - Path to file or directory which need to remove.
Output: -
-
trigger_pipeline(project_id, pipeline_params)
Input params description:
- project_id - Git project ID or path to project.
- pipeline_params - params for start pipelines Pipeline params example json:
{"ref":"master","variables":[{"key": "param_name1", "value": "param_value1"}, {"key": "param_name2", "value": "param_value2"}]}
-
cancel_pipeline_execution(project_id, pipeline_id, timeout)
Input params description:
- project_id - Git project ID or path to project.
- pipeline_id - Pipeline ID which need to cancel.
- timeout - optional parameter which indicates timeout delay before stop execution, 0 by default
Output: pipeline execution info
-
wait_pipeline_execution(project_id, pipeline_id, timeout_seconds, break_status_list)
Input params description:
- project_id - Git project ID or path to project.
- pipeline_id - Pipeline ID which need to wait.
- timeout_seconds - delay in seconds which execution will wait
- break_status_list - list of string statuses which will break execution if execution status will be in list
Output: pipeline execution info
-
get_pipeline_status(project_id, pipeline_id)
Input params description:
- project_id - Git project ID or path to project.
- pipeline_id - Pipeline ID which need to get.
Output: pipeline execution status
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qubership_pipelines_common_library-0.0.1.dev1.tar.gz.
File metadata
- Download URL: qubership_pipelines_common_library-0.0.1.dev1.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.8.18 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
847f12407dd732507d1b4f946849030fcadac0bca9c94a959cfab9a891e533f8
|
|
| MD5 |
3ff6d29aaedbd1c63760681e5eca8995
|
|
| BLAKE2b-256 |
2a9ed644a089e64c964c270a536b25f6744ae0714f36e9a04bb85747d8fa2883
|
File details
Details for the file qubership_pipelines_common_library-0.0.1.dev1-py3-none-any.whl.
File metadata
- Download URL: qubership_pipelines_common_library-0.0.1.dev1-py3-none-any.whl
- Upload date:
- Size: 40.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.8.18 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17c0aae712b1a03bb56e7b682c2e461c30790b158f1d210f1ee12c1b58584588
|
|
| MD5 |
c1f31e1f08e6127ce62bd1b58b640e84
|
|
| BLAKE2b-256 |
32a0813bf8ad3a54a4fa5b74ccc4369665a490b2629cfc3f680da74a2b54e843
|