Giter Site home page Giter Site logo

gem_collector's Introduction

GemCollector

Gem Version Build Status

Collect gems used by applications.

  • Collect Gemfile.lock of the repository via GitHub webhook
  • Show gem versions of the repository
  • Show repositories using the gem
  • Show "how up-to-date?" of the repository
  • Create a issue to repositories using the gem

Usage

There're two ways to add GemCollector webhook to repository.

Add webhook from repository setting

Visit https://github.com/:user/:repo/settings/hooks and add https://gem-collector.example.com/github-webhook with push event.

Add webhook from GemCollector

Visit https://gem-collector.example.com/repositories/new and enter repository location. It will automatically add ENV['WEBHOOK_URL'] with push event.

Installation

Gemfile

Add this line to your application's Gemfile:

gem 'gem_collector'

Octokit

Put config/octokit.yml like below.

default: &default
  github.com:
    access_token: <%= ENV['GITHUB_ACCESS_TOKEN'] %>
    webhook_secret: <%= ENV['GITHUB_WEBHOOK_SECRET'] %>
  github-enterprise.example.com:
    api_endpoint: https://github-enterprise.example.com/api/v3
    web_endpoint: https://github-enterprise.example.com
    access_token: <%= ENV['GHE_ACCESS_TOKEN'] %>

development:
  <<: *default

production:
  <<: *default

Database

Configure database.yml. GemCollector requires PostgreSQL.

# config/database.yml
development:
  adapter: postgresql
  encoding: unicode
  database: gem_collector_development

production:
  url: <%= ENV['DATABASE_URL'] %>

ActiveJob

Configure ActiveJob adapter. We're using Barbeque, but other adapters should work.

# config/initializers/barbeque.rb
Rails.application.configure do
  config.active_job.queue_adapter = :barbeque
end

BarbequeClient.configure do |config|
  config.application = 'gem-collector'
  config.default_queue = 'default'
  config.endpoint =
    if Rails.env.production?
      ENV.fetch('BARBEQUE_ENDPOINT')
    else
      ENV.fetch('BARBEQUE_ENDPOINT', 'http://localhost:3003')
    end
end

Environment variables

  • WEBHOOK_URL (required when /repositories/new is used)
    • URL to be added when the repository is registered from /repositories/new
    • Example: https://gem-collector.example.com/github-webhook
  • DEFAULT_GITHUB_SITE (optional: default to github.com)
    • Placeholder site for /repositories/new
    • Example: github-enterprise.example.com

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.

gem_collector's People

Contributors

eagletmt avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.