Skip to main content

A CLI tool for Jenkins

Project description

Jenkins Terminal Tool

A command-line tool for interacting with Jenkins, allowing you to configure Jenkins credentials, trigger builds, and get job statuses.

Features

  • Set Jenkins configuration parameters interactively or via command-line options
  • Trigger Jenkins jobs with parameters
  • Get the status of Jenkins jobs
  • Fetch and display Jenkins job console outputs
  • List the builds of a specified Jenkins job
  • Template job feature to automatically save and read last executed job

Installation

Using pip

  1. Install the tool:

    pip install jenkins-terminal
    
  2. Run the CLI tool:

    jenkins <command>
    

Usage

Configuration

You can set Jenkins configuration parameters either interactively or via command-line options.

Interactively

Run the following command and follow the prompts to enter your Jenkins URL, username, and API token:

jenkins config

Command-line options

You can also set the configuration parameters using command-line options:

jenkins config --username <username> --url <url> --token <token>

Trigger a Jenkins Job

Trigger a Jenkins job with parameters:

jenkins build [<job>] <key1>=<value1> <key2>=<value2> ...

You can also specify a YAML file containing job parameters:

jenkins build [<job>] <parameters.yaml>

The YAML file should contain the job parameters in the following format:

key1: value1
key2: value2

Get Jenkins Job Status

Get the status of a Jenkins job:

jenkins status [<job>] [--build-number/-b <number>]

Fetch Jenkins Job Console Output

Fetch and display the console output of the latest or a specific Jenkins job build:

jenkins console [<job>] [--build-number/-b <number>] [--max-lines/-l <number>]

List the builds of Jenkins Job

List the builds of a specified Jenkins job:

jenkins builds [<job>]

Acknowledgements

  • Typer - CLI library for Python
  • Rich - Rich text and beautiful formatting in the terminal
  • Jenkins - The leading open source automation server

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

jenkins_terminal-0.4.0-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

Supported by

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