GithubHelp home page GithubHelp logo

leefaus / notifications-backup Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 190 KB

Enablement Examples for Extending GitHub with Ruby/Rails

Ruby 54.23% JavaScript 1.03% CSS 27.68% CoffeeScript 0.79% HTML 16.27%

notifications-backup's Introduction

README

This is a set of Ruby/Rails example applications GitHub uses during their 1 day partner enablement. These applications are WIP, so leverage at your own risk.

To get started:

  • Install Ruby gte 2.2.4
  • gem install bundler
  • Create a Heroku account
  • Install the Heroku Toolbelt CLI

From a Terminal

  • heroku login
  • git clone https://github.com/leefaus/notifications

Webhook Example

Setup and Deploying

  • cd notifications
  • git checkout webhook-example
  • bundle install
  • heroku create
  • Copy the URL from the above command and paste the URL into config/environments/production.rb
    • config.action_cable_url
    • config.action_cable.allowed_request_origins
  • git commit -a -m "update websocket URLs"
  • heroku plugins:install heroku-redis
  • heroku addons:create heroku-redis:hobby-dev
  • git push heroku webhook-example:master
  1. Wait for the application to start by running.
  2. Once running, open your browser to https://<HEROKU_URL>/webhook
  3. Trigger a Webhook in GitHub to send the notification to the URL 2

Oauth Example

Setup and Deploying

  • git checkout oauth-example
  • Login to GitHub.com or GitHub Enterprise
  • Create a new Oauth Application
  • The Homepage URL should be your HEROKU_URL
  • The Authorization Callback URL should be https://<HEROKU_URL>/users/auth/github/callback
  • Once the application is created, save the client_id AND client_secret to be used later in the application.yml
  • bundle install
  • bundle exec figaro install
  • Create the following key/value pairs corresponding to your install in the config/application.yml
    • github_client_id: <value>
    • github_application_secret: <value>
    • github_enterprise_url: <value>
    • heroku_application: <value>
  • figaro heroku:set
  • git commit -a -m "figaro environment variables"
  • git push --force heroku oauth-example:master
  • heroku run rails db:migrate
  • Open a browser and point to https://<HEROKU_URL>/
  • Click the Sign In via GitHub button in the right hand corner
    • You should be redirected to either GitHub.com or GitHub Enterprise
    • Authorize the application
    • Click the Sign Out button
    • Done...

API Example

Setup and Deploying

  • Create a Personal Access Token
  • git checkout api-example
  • bundle install
  • bundle exec figaro install
  • Create the following key/value pairs corresponding to your install in the config/application.yml
    • github_client_id: <value>
    • github_application_secret: <value>
    • github_enterprise_url: <value>
    • github_oauth_personal_token: <value>
    • heroku_application: <value>
  • figaro heroku:create
  • git commit -a -m "figaro environment variables"
  • git push --force api-example:master
  • Open a browser to https://<HEROKU_URL>/status
  • Login to GitHub if required
  • Create a commit and pull request in GitHub
    • Copy the SHA from GitHub and paste it into the status field in your Heroku application
    • Click the Create button

notifications-backup's People

Contributors

mwiesen avatar

Stargazers

Jonas Hecht avatar Huỳnh Văn Toàn avatar Matthew J. McCullough avatar

Watchers

James Cloos avatar

Forkers

continuouslee

notifications-backup's Issues

Add-on needs heroku paid account?

@leefaus

At this step in the webhook-example:

heroku addons:create heroku-redis:hobby-dev

I get this answer on the command line:

~/github/notifications (webhook-example) $ heroku addons:create heroku-redis:hobby-dev ! Please verify your account to install this add-on plan (please enter a credit card) For more information, see https://devcenter.heroku.com/categories/billing Verify now at https://heroku.com/verify ~/github/notifications (webhook-example) $

svn2git fails with error

Given authors.txt, trying to run:

$> svn2git  https://github.com/leefaus/notifications --authors ../authors.txt
Index mismatch: 1afd97a0b278ae3d0718288a6fdee80f0996ff1b != 2b96b94891711ab6a8318298dded9dbc65df6456
rereading 58413be4ab527f5a422a7dd79691f90eaad303c0
        M       config/initializers/devise.rb
Failed to strip path 'branches/webhook-example' ((?^:^branches\/oauth\-example(/|$)))

Workaround:

svn2git --nobranches --notags  https://github.com/leefaus/notifications --authors ../authors.txt

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.