Skip to main content

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

  1. Initialization and how to use:

    JenkinsClient(host, user, password)
    

    Input params description:

  2. 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

  1. 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
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qubership_pipelines_common_library-0.0.1.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file qubership_pipelines_common_library-0.0.1.tar.gz.

File metadata

File hashes

Hashes for qubership_pipelines_common_library-0.0.1.tar.gz
Algorithm Hash digest
SHA256 301fdbfb71852624406c305c5f1863ac9d5c43d6e8bfc2f5a73120511b2810d4
MD5 ebac3aaa4f4c5faa9a667a6ab81d3778
BLAKE2b-256 cabe333d326deca1b698261e421e18d13520740582df4b5fc756fbc84ae0d84d

See more details on using hashes here.

File details

Details for the file qubership_pipelines_common_library-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for qubership_pipelines_common_library-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3efe84e3f35b2655c5ef9d33b3b80813c6e3bcfa2a06dfe6798a8bdba2b44852
MD5 15878033bccadd619e7e486e63877a22
BLAKE2b-256 d240a0a6f7fe971f41dfdfc8d3c1639eac99df431624cb92fac70d12b404d01c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page