GithubHelp home page GithubHelp logo

rossbeale / jenkins-slack-command Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joshdholtz/jenkins-slack-command

0.0 3.0 0.0 268 KB

Start a build in Jenkins using a Slack Command

License: MIT License

Ruby 100.00%

jenkins-slack-command's Introduction

jenkins-slack-command

Twitter: @KauseFx License

Start a build in Jenkins using a Slack Command

Slack Command

Incoming Webhook

Features

  • Start a build
    • /jenkins MyAwesomeApp
  • Start a parameterized build
    • /jenkins MyAwesomeApp 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
    • Label should be 'Jenkins' or whatevs
  • Create a new "Inbound Webhook" (Optional)
    • Set the channel you would like to post to
    • Set the bot name Jenkins or whatevs

2. Setup environment variables on your Heroku instance

  • Required environment variables
  • SLACK_TOKEN - token from your "Slash Command"
  • JENKINS_URL - URL to your Heroku instnace
  • JENKINS_TOKEN - API token of your user in Jenkins
    • The API token is available in your personal configuration page. Click your name on the top right corner on every page, then click "Configure" to see your API token. (The URL $root/me/configure is a good shortcut.) You can also change your API token from here.
  • Optional environment variables
    • SLACK_WEBHOOK_URL - your incoming webhook URL

3. Spin up Heroku instance

Deploy

4. Execute command in Slack

/jenkins MyAwesomeApp

FAQ

How do I access my Jenkins server from behind a router?

I used ngrok.com with basic authentication to expose my Jenkins server

Can I integrate with fastlane and call different lanes?

You can! Make a parameterized build with a name called lane (or whatever you want to call it). Make this a string or choice parameter with all your build lanes available as choices (beta, inhouse, app_store). Then use this $lane in your build shell command in your job's configuration - bundle exec fasltane $lane.

To call this from Slack, all you need to do is send /jenkins MyAwesomeApp lane=beta.

Author

Josh Holtz, [email protected], @joshdholtz

License

jenkins-slack-command is available under the MIT license. See the LICENSE file for more info.

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.