Open In App

Project Idea | Versatile Jenkins CLI

Project Title: Versatile Jenkins CLI

Introduction:
Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing and delivering or deploying software.
The objective of this article is to create a user-friendly CLI without any external dependencies for implementing the basic features of Jenkins. It uses the Linux style of commands to operate the following features.



Diagram: 



Tools Used:

API for the following features:

  1. Saving the configuration file:

    Jenkins-URL + “/job/” + JOBName + “/config.xml”

  2. Listing Jobs:

    Jenkins-URL+ “/api/json?tree=jobs[name]”

  3. Building a Job:
    • Unparameterised Job:

      Jenkins-URL + “/job/” + JOBName + “/build”

    • Parameterised Job:

      Jenkins-URL + “/job/” + JOBName + “/buildWithParameters?” + parametervalue

  4. Build History:

    Jenkins-URL + “/job/” + JOBName + “/api/json?tree=allBuilds[*]”

  5. Displaying Output Console For a Particular Job:

    Jenkins-URL + “/job/” + JOBName + “/” + BuildNumber + “/logText/progressiveText?start=0”

Application:
This project can be used anywhere i.e. both in Windows and Linux operating system as the python script does not have any kind of external dependencies. It is a user-friendly interface as just using certain appropriate commands we can access the entire details of a particular job without actually using the Jenkins Software.

  1. Github Repository Link: https://github.com/viralivora/Jenkins-CLI
  2. Research work done:
    • Learning about Jenkins API as the API’s are not well documented.
    • Going through HTTP Protocols and HTTP RFC’s
    • Curl Commands

Relevant Articles for further understanding:

Note: This project idea is contributed by Virali Vora for ProGeek Cup 2.0- A project competition by GeeksforGeeks.

Article Tags :