Giter Site home page Giter Site logo

snitch's Introduction

Snitch

Documentation Coverage Status Go Report Card Build Status

Keep updated about each deploy via Tsuru.

This program will notify your team and many tools when someone has deployed any application via Tsuru.

Quick Start

First one, you have to create a hook's configuration file. This file describe wich hook will be dispatched and the your configurations (e.g webhook_url).

You can add this code into your file, hardcode mode:

slack:
  webhook_url: http://your.webhook.here

or using environment variable:

slack:
  webhook_url: $SLACK_WEBHOOK_URL

So now, You must add this code into your file (tsuru.yaml or tsuru.yml) located in the root of the application at hook's section.

hooks:
  build:
    - curl -sSL https://github.com/lucasgomide/snitch/releases/download/0.1.0/snitch_0.1.0_linux_amd64.tar.gz | tar xz
    - ./snitch_linux/snitch -c path/snitch_config.yml

Put the hook's configuration file path as argument for the -c option.

Options

-c

This option indicates where's the file with the hook's configurations see more.

-app-name-contains

Use it to validate if the snitch should be run. If you tsuru app name does not match it the value of -app-name-contains, the program will stop, and no errors will be raised.

Hook's Configurations

Here is all avaliables hook's configurations and your descriptions. Remember that you may use environment variables to define the options's values.

  • Slack

    • webhook_url Indicates the Webhook URL to dispatch messages to Slack.
  • Sentry

    • host Tell to Snitch your sentry host (e.g http://sentry.io or http://sentry.self.hosted)
    • organization_slug The organization slug is a unique ID used to identify your organization. (You'll find it at your sentry's configuration, probably)
    • project_slug The Project Slug is a unique ID used to identify your project (You'll find it at your project config)
    • auth_token The token used to authenticate on Sentry API. To generate a new token, you have to access manager auth tokens then create a token. If you are using Sentry self hosted, you need change the domain sentry.io to your own domain, example: sentry.snitch.com/api. Find more information on Sentry documentation
    • env The application's environment variable (e.g development, production)
  • Rollbar

    • access_token The access token with post_server_item scope. You can find more here
    • env The application's environment variable (e.g development, production)
  • NewRelic

    • host Tell to Snitch your NewRelic API host (e.g https://api.newrelic.com)
    • application_id The application ID is a unique ID used to identify your application in APM. (You'll find it at the end of the application's page URL)
    • api_key The API Key to use the NewRelic REST API. You can find more here
    • revision The application's current revision (e.g 0.0.1r42)
  • HangoutsChat

    • webhook_url Indicates the Webhook URL to dispatch messages to HangoutsChat Room.

Example

Snitch App Sample

snitch's People

Contributors

joaodaher avatar lucasgomide avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

snitch's Issues

Rename ReadConfigFile

This function save into struct the config parsed, in order to semantic reasons ReadConfigFile doesn't sound good to me

better doc to Sentry API

Sentry has a bad/confused documentation about deploys and releases.
Make better doc to Sentry API

Client.Timeout exceeded while awaiting headers

Some requests to Tsuru API exceeded Client.Timeout, then has been logged message on prompt.

Snitch: Get http://xx.x.x.x:8080/deploys?app=xxxxx&limit=1: net/http: 
request canceled (Client.Timeout exceeded while awaiting headers

Golint: Refactor config keys

lint suggested

lucasgomide/snitch/hook/newrelic.go:16:2: struct field ApplicationId should be ApplicationID
lucasgomide/snitch/hook/newrelic.go:17:2: struct field ApiKey should be APIKey
lucasgomide/snitch/hook/slack.go:14:2: struct field WebhookUrl should be WebhookURL
lucasgomide/snitch/hook/slack_test.go:9:5: var webhookUrl should be webhookURL

In order to fix it, we need refactor func executeHook(h types.Hook, deploy []types.Deploy, conf interface{}) to don't use reflect

Golint: Tsuru API

lint suggested

lucasgomide/snitch/tsuru/api.go:13:6: type name will be used as tsuru.TsuruAPI by other packages, and that stutters; consider calling this API
lucasgomide/snitch/tsuru/api.go:13: warning: exported type TsuruAPI should have comment or be unexported (golint)

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.