

I did not explain that what each method perform separately, but all the methods has method descriptions. but you need setup.py file(you can google it, how to create setup.py)Ĩ. you can build and deploy this code on any environment where it runs as a server. This slackbot can also use for handling multiple jenkins jobs, also can use different purposes (Ex: building projects from gitHub etc.) (not only handling jenkins jobs)ħ. if your jenkins job expecting parameters (Ex: project name, type of device, type of tests) here is the commands I use from the slack, ( enkins-bot jenkins enkins-bot helpĦ. understand that what code is doing, and probably you need to handle/add logic that what command you need to pass to slackbot to run the jenkins job.ĥ. you can change the command whatever you like but you need to update that in your slackbot.pyĤ. you can also invite in to slack channels/groups.ģ. if you dont’ see slackbot in your slack, please invite it into slack(just type and invite).

check your Bot(jenkins-bot) is active in your slack. Important Notes:ġ.check the console logs, that slackbot started and up and running. Now that all of our code is in place we can run our SlackBot on the command line with the python slackbot.py command.

Please download source code over here and make changes as per your needs. virtualenv slcakbot source slackbot/bin/activate pip install slackclientĪll the files and required code provided below, you can keep all methods in one file(slackbot.py) as well ( it’s up to you). Note: if you are on Mac, Linux, open terminal and go to your home directory or any working directory you like and run below commands.

