/gitlab-hook

Web appliction that listens to post-hooks from GitLab and tweets about it.

Primary LanguageRuby

GitLab Hook

  • If you're missing GitHub Twitter hook when using GitLab, you just found a solution.

Installation

Twitter

  • Log into https://dev.twitter.com/apps
  • Click on Create a new application.
  • Fill out everything needed and click on Create your Twitter application.
  • Now in Settings tab, set Access: to Read and Write and save it.
  • Keep this page open or copy all the tokens and keys from Details tab. You'll need them in a while.

Bit.ly

  • If you don't have account on bit.ly, create one.
  • Log into your account, and copy your Api Key from Settings tab.

Your computer

  • Clone this repository: git clone git@github.com:SmartMedia/gitlab-hook.git
  • Create Heroku Cedar application: heroku create <APP_NAME> --stack cedar
  • Setup variables based on your Twitter Details and Bitly Settings tab:
  • For GITLAB_ACCESS_TOKEN use some random string.
heroku config:add \
GITLAB_ACCESS_TOKEN='' \
BITLY_USERNAME='' \
BITLY_API_KEY='' \
TWITTER_CONSUMER_KEY='' \
TWITTER_CONSUMER_SECRET='' \
TWITTER_OAUTH_TOKEN='' \
TWITTER_OAUTH_TOKEN_SECRET=''
  • Put your
  • If you want to test localy, setup the same variables used by application in all *.yml.erb files in config directory.
  • git push heroku

GitLab

  • Open your project.
  • Select Hooks tab.
  • Fill out URL of your Heroku app with access_token parameter. (eg. http://<APP_NAME>.herokuapp.com/?access_token=<GITLAB_ACCESS_TOKEN>)
  • Press "Test Hook"
  • Enjoy your Twitter timeline.