DEV Community

loading...

Triggering Jenkins Jobs From Slack

deegupta123 profile image Deepak Gupta ・2 min read

What about triggering your builds once you get an update from the Development Team on Slack and from their itself you triggered the job, so that all the needful can be done and reports added in your job configuration can be mailed back to developers!!!

So here we go :

  1. In Jenkins go to configure page and create API token, which helps you to configure your Job to Trigger Build remotely where you mention your token name.
    Alt Text
    Alt Text

  2. Coming to slack, in apps search for Slash Commands where you can configure and add to trigger build of your job from slack
    Alt Text

  3. In configuration, choose a command name of your choice and then click on add slash command integration.
    Alt Text

  4. Here you will make the entry in the URL mentioning your https://jenkins-user:token_no@jenkins_url/job/job_name/build?token=token_name
    Alt Text

  5. And at last, you can add an Autocomplete help task which helps you to find your added command easily while triggering, Click save. Go back to Slack and try run your command with the given name and your build will be triggered.

Alt Text
Alt Text
Alt Text

Hope You gonna try and make your builds easy to trigger. Keep Building

Discussion (0)

Forem Open with the Forem app