Git Product home page Git Product logo

jenkinsslack's Introduction

JenkinsSlack

Start a build in Jenkins using a Slack Command

Features

  • Start a build
    • /jenkins buildName
  • Start a parameterized build
    • /jenkins buildName param1=value1 param2=value2

In Progress

  • Error handling when staring the build fails

Installation

1. Setup Slack integrations

  • Create a new "Slash Command"
    • Name command /jenkins
    • Set the URL to the url of your Heroku instance (created in step 3)
    • Method should be POST
  • Create a new "Inbound Webhook"
    • Set the channel you would like to post to
    • Set the bot name Anything That You Like

2. Setup environment variables on your Heroku instance

  • Required environment variables
  • SLACK_TOKEN - token from your "Slash Command"
  • JENKINS_URL - URL to your jenkins host
    • NOTE: if your jenkins requires authentication url will look like http://user:auth-token@your-jenkins-host:port. To obtain user authentication token click your name on the top right corner on every page, then click "Configure" to see your API token. (The URL $host/me/configure is a good shortcut.),
  • JENKINS_TOKEN - API token for jenkins job.
    • NOTE: you will need to enable remote builds for every job you would like to invoke remotely. Turn on "Trigger builds remotely (e.g., from scripts)" checkbox under Bild Triggers section in job configuration. Then input any random token and save. You will need to use the same token for all jobs you are planning to build from slack remotely, otherwise jenkins will fail with authentication error.
  • SLACK_WEBHOOK_URL - your incoming webhook URL

3. Spin up Heroku instance

Deploy

  • Or You can even deploy it in you local, but Make sure the Above said environment variables is set

4. Execute command in Slack

/jenkins <buildName>

jenkinsslack's People

Contributors

tonythomas28 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.