Skip to main content

A CLI tool to manage and have fun with Jenkins server

Project description

portfolio_view

yojenkins

PYPI Version Python Versions PYPI Status Licence

yojenkins is a cross-platform command line interface (CLI) tool to monitor, manage, and have fun with a Jenkins server. It makes it possible to interact with Jenkins server without using the browser based Jenkins UI.

This tool is able to be integrated into a script as middleware in order to automate Jenkins related tasks and enable Jenkins configuration as code.

yojenkins will liberate you and your browser from the Jenkins Web UI

With yojenkins you can manage:

  • Authentication: Authentication structure similar to AWS CLI
  • Server: Create, shutdown, view queue, and more
  • User accounts: Create, delete, add/remove permission, and more
  • Nodes/agents: Create, delete, shut down server, and more
  • Credentials: Create, update, delete, list, and more
  • Folders: Create items, delete items, disable, enable, and more
  • Jobs: Create, delete, trigger, monitor, search, and more
  • Builds: Monitor, abort, tail logs, follow logs, and more
  • Stages: Get info, get logs, view steps, view status
  • Steps: Get info
  • Other tools and functions: Run groovy scripts remotely, run custom REST calls, setup a shared library, view command usage history, and more

NOTE: This project is in pre-alpha release phase. Please report any issues, odd behavior, or suggestions. Read more about the release cycle. See Bug Reports and Feature Requests

Overview

Quick Start

  • (Optional) Start up a local Jenkins server using Docker

    • yojenkins server server-deploy
      
  • Configure your first profile. Profiles are stored in the home directory in the .yojenkins directory

    • yojenkins auth configure
      
  • Generate a Jenkins server API token and add it to your first profile

    • yojenkins auth token --profile <PROFILE NAME>
      
  • Verify that you can access the Jenkins server

    • yojenkins auth verify
      
  • Now start trying some things

    • Get sever info:       yojenkins server info
      Get your user info:   yojenkins auth user --pretty
      Search a job:         yojenkins job search some-job-name --fullname --yaml --list
      Monitor a build:      yojenkins build monitor some-job-name --latest --sound
      

Installation

  1. Install system dependencies for simpleaudio sound Python package for job and build monitor

    • Platform Command
      MacOS and Windows Not needed
      Ubuntu sudo apt update && apt-get install -y python3-dev python3-pip libasound2-dev
      CentOS sudo yum update && yum install -y python3-devel gcc alsa-lib-devel
  2. Install yojenkins

    • Option 1 (Recommended): Install from Python Package Index (PYPI) using pip

      • pip install yojenkins
        
    • Option 2: Download all files from this GitHub repository and install using the included setup.py

      •   python setup.py install
        

Usage

Each top level command has sub-commands. For example, yojenkins server has sub-commands server-deploy and server-start. To see the sub-commands of a command, or to see the options of a command, use the --help option.

                        YOJENKINS (Version: 0.0.0)

  yojenkins is a tool that is focused on interfacing with Jenkins server from
  the comfort of the beloved command line.  This tool can also be used as a
  middleware utility, generating and passing Jenkins information or automating
  tasks.

  QUICK START:

    1. Configure yo profile:  yojenkins auth configure
    2. Add yo API token:      yojenkins auth token --profile <PROFILE NAME>
    3. Verify yo creds:       yojenkins auth verify
    4. Explore yojenkins

Options:
  -v, --version  Show the version
  --help         Show this message and exit.

Commands:
  account     Manage user accounts
  auth        Manage authentication and profiles
  build       Manage builds
  credential  Manage credentials
  folder      Manage folders
  job         Manage jobs
  node        Manage nodes
  server      Manage server
  stage       Manage build stages
  step        Manage stage steps
  tools       Tools and more

Jenkins Plugin Requirements

If you are using yojenkins on a pre-existing Jenkins server, make sure that the following Jenkins plugin are installed for yojenkins to use all its functionalities. However, these plugins tend to be installed by default.

In order to check/install a plugin, go to Manage Jenkins > Manage Plugins > Installed OR Available

  1. Folders (cloudbees-folder)
  2. Next Build Number (next-build-number)
  3. Promoted Builds (promoted-builds)
  4. Role-based Authorization Strategy (role-strategy)
  5. GitHub Branch Source Plugin (github-branch-source)

Local Jenkins Server Setup Using Docker

yojenkins offers an easy way to quickly set up a local Jenkins server within a Docker container. This server is setup and ready to go to tinker with yojenkins.

NOTE: You must have Docker installed and running. See Docker installation guide.

Run the following command to set up a local Jenkins server:

yojenkins server server-deploy

Use --help for available options, and use --debug to troubleshoot any issues.

 


Bug Reports

As with any other software, issues do come up during various usage scenarios that may not be accounted for during development and testing. Help from real users is enormously helpful.

Please report and bugs and odd behaviors with either of these:

If possible, please include the command that caused the issue, running it with the --debug option. For example, yojenkins server server-deploy --debug

Note, that your issue may already be in queue, so please check the project FIXME.

Feature Requests

This is a very young project, and we are always looking for new features and improvements. Please feel free to open an issue and suggest a feature. Please be as specific as possible, and include as much information as possible.

Note, your suggestion may be part of the Project plan, so be sure to check the TODO to see if it is already planned.

Contributing

This project is an on-going effort, slowly adding various features and improvements. If you would like to contribute, please fork the project, make your changes, and submit a pull request.

Any help, ideas, or user testing is much appreciated!

There is definitely work to be done. If you don't happen to have a great genius idea for the next big change, or if you spot an issue you are able to fix, please checkout the TODO and FIXME or add your own ideas. For guides and information on how to get started and help out, check out the dev_things directory.

Contributors

Licence

This project is licensed under the GNU General Public License Version 3 License. Please see the LICENSE file for details. Also a complete history of this licence.

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

yojenkins-0.0.45.tar.gz (958.4 kB view details)

Uploaded Source

Built Distribution

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

yojenkins-0.0.45-py3-none-any.whl (958.3 kB view details)

Uploaded Python 3

File details

Details for the file yojenkins-0.0.45.tar.gz.

File metadata

  • Download URL: yojenkins-0.0.45.tar.gz
  • Upload date:
  • Size: 958.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for yojenkins-0.0.45.tar.gz
Algorithm Hash digest
SHA256 55b97c61fc392ef9a62f846028c29146b62de8500ec9e98e215705c611817b2f
MD5 05991bb661b7c22b03fbe1fc8183440f
BLAKE2b-256 88e59dcdb96343b6e90fc7608251fbc9db9188f3c3563f839fab5150e409b388

See more details on using hashes here.

File details

Details for the file yojenkins-0.0.45-py3-none-any.whl.

File metadata

  • Download URL: yojenkins-0.0.45-py3-none-any.whl
  • Upload date:
  • Size: 958.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for yojenkins-0.0.45-py3-none-any.whl
Algorithm Hash digest
SHA256 b70f149c443d7004831e0dab4e18ad52d6edcf5ac730587f661c12708236e1f6
MD5 dff9c78693268daf7663586ab068be38
BLAKE2b-256 b460d8ae54b9918ab0619760bfa8219f632c7e39ac968e3315b94fe2fc08dffe

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