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

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.dev1.tar.gz.

File metadata

File hashes

Hashes for qubership_pipelines_common_library-0.0.1.dev1.tar.gz
Algorithm Hash digest
SHA256 847f12407dd732507d1b4f946849030fcadac0bca9c94a959cfab9a891e533f8
MD5 3ff6d29aaedbd1c63760681e5eca8995
BLAKE2b-256 2a9ed644a089e64c964c270a536b25f6744ae0714f36e9a04bb85747d8fa2883

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qubership_pipelines_common_library-0.0.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 17c0aae712b1a03bb56e7b682c2e461c30790b158f1d210f1ee12c1b58584588
MD5 c1f31e1f08e6127ce62bd1b58b640e84
BLAKE2b-256 32a0813bf8ad3a54a4fa5b74ccc4369665a490b2629cfc3f680da74a2b54e843

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