Jump to content

Jenkins Workflow

Recommended Posts

This is a jenkins workflow I created that I hope helps others. I have seen other workflows that just gather status but I wanted to run jobs as well...I hope someone can use it! Let me know your feedback!


First thing that needs to be done is to setup the information needed to run the workflow. To do this run the following command:

  • jenkinsinfo
​This will allow you to set the following values:


  • hostname (required): The hostname of the jenkins server (ex. jenkins.mydomain.com)
  • username (required): The username used to login to the jenkins server
  • password (required): The password used to login to the jenkins server
  • protocol (required - default is https): The protocol the jenkins server sits on
  • gitrepo (optional - relative to your home directory): If specified this will gather the current branch name that is checked out and default it to your first parameter
Once the information above is specified, you can run the following command to gather all job statuses:

  • jenkins status
​In addition, you can specify the following command:

  • jenkins run <param1>  <param2>...
​This will return a list of any jobs that are configured to run using the api (token setup - http://stackoverflow.com/questions/21032349/how-can-i-set-the-jenkins-authentication-token)and the parameter names associated to each job. You can specify values for each parameter within the alfred prompt (if any), all separated by 2 spaces. If you have the gitrepo set, this will default to the first parameter value...you can override by typing something else for param1 OR retain that value by simply inserting 2 spaces and moving onto the next param.


There are some other jenkins workflows that do similar status checks, but I haven't found one that allows you to run jobs remotely which is why I created this.


Hope this helps someone out there :)










Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...