Start your Jenkins builds from terminal

I've earlier written about a little script I created that allows you to monitor Jenkins from the terminal.

Now, the script has been extended with an interactive mode that allows you to start Jenkins jobs.

Entering the interactive mode

When starting the script, you'll end up on the monitor. To be able to start the different jobs, you have to enter the interactive mode.

To enter this mode, press ctrl + c.

Now you can select the job you want to start by moving up and down using the w and s keys. To start building the selected job, simply press b.

Setting up the script

Let's take a recap of how to set up cJenkins.

Get the script

First, you need to download the script. You'll find the script here.

Run it

To run it, you simply execute the script with the username and password together with jenkins' url as an argument.

$ python cjenkins -u <username> -p <password> -l <jenkins 1 address> .. <jenkins n address> 

The script also supports several jenkins'. To manage this, just list them as arguments to the script.

Alias it

To make it more convenient, you should alias the command. That way you don't have to write such a long command everytime you want to start the monitor.

alias jen="/<path>/ <arguments for cjenkins>"  

Now, you can just type jen to open the monitor.

You should also add the alias to your .bash_profile to make sure it's always there.

That's all you have to do. I hope you find it useful.