Allows a GitHub application to communicate with a server and that server can trigger executions on a CI and control the creation of Check Suite and Run for each new creation and commit in a PR.
The first step before running the system is to install these programs:
- Ruby (+2.7 or +3.0)
- PostgreSQL (any version)
- Git
- Redis (https://redis.io/)
The project does not use any Ruby versioning services (RVM or Rbenv) and the gems must be available as Debian packages. We have a Gemfile to install the gems, but any gem must be available as a package.
Production / Development
- puma
- ruby-json
- ruby-jwt
- ruby-netrc
- ruby-octokit
- ruby-otr-activerecord
- ruby-pg
- ruby-sidekiq
- ruby-sidekiq-cron
- ruby-sinatra
Test
In addition to the gems listed above, we need these to run the tests locally:
- rubocop
- ruby-database-cleaner
- ruby-factory-bot
- ruby-faker
- ruby-rack-test
- ruby-rubocop-performance
- ruby-rspec
- ruby-webmock
This document provides instructions on how to configure the database for the GitHub Hook Server project.
Ensure you have the following installed on your system:
- PostgreSQL (any version)
-
Install PostgreSQL: Follow the instructions for your operating system to install PostgreSQL. You can find the installation guide on the official PostgreSQL website.
-
Create a Database: After installing PostgreSQL, create a new database for the project. You can do this using the
psql
command-line tool or any PostgreSQL client.RAKE_ENV=development psql -c "CREATE DATABASE github_hook_server_development;"
-
Configure Database Connection: Update the
config/database.yml
file with the database connection details. You can use the following configuration as a template:development: adapter: postgresql encoding: unicode database: github_hook_server_development pool: 5 username: postgres password: password host: localhost port: 5432
Replace the
username
,password
,host
, andport
values with your PostgreSQL connection details. -
Run Database Migrations: After configuring the database, run the database migrations to set up the necessary tables and schema.
bundle exec rake db:migrate
- Verify the Configuration: Start the application and verify that it can connect to the database without any errors.
RAILS_ENV=development rackup -o 0.0.0.0 -p 9292 config.ru
GitHub Hook is initialized at production mode running the following command:
RAILS_ENV=production RACK_ENV=production rackup config.ru -o 0.0.0.0 -p 4667
It is important that you have registered an application with GitHub for this tool to work correctly.
Just run the command: rackup -o 0.0.0.0 -p 9292 config.ru
Rubocop can be executed with the following command: rubocop -A
.
The '-A' parameter will automatically fix some code mistakes.
Rspec be executed with the following command: rspec ./spec --pattern '**/*_spec.rb'
This guide will walk you through the steps to install RVM (Ruby Version Manager) on your system.
Before you begin, ensure you have the following installed on your system:
curl
gpg
You can install these using your package manager. For example, on Debian-based systems, you can use:
sudo apt update
sudo apt install -y curl gpg
- Install RVM To install RVM, run the following command:
\curl -sSL https://get.rvm.io | bash -s stable
- Load RVM Scripts After the installation, you need to load the RVM scripts. Add the following line to your shell profile (~/.bashrc, ~/.zshrc, etc.):
source ~/.rvm/scripts/rvm
Then, reload your shell profile:
source ~/.bashrc # or source ~/.zshrc
- Verify the Installation To verify that RVM is installed correctly, run:
rvm --version
You should see the RVM version information.
Once RVM is installed, you can use it to install Ruby versions.
- Install a Ruby Version To install a specific version of Ruby, use the following command:
rvm autolibs disable
rvm install 3.3.1
- Use a Ruby Version To use a specific version of Ruby, run:
rvm use 3.3.1 --default
This sets the specified Ruby version as the default for your shell.
- Verify the Ruby Installation To verify that Ruby is installed correctly, run:
ruby --version
You should see the version of Ruby that you installed.
RVM allows you to manage multiple Ruby versions. You can switch between them as needed.
List Installed Ruby Versions
To list all installed Ruby versions, run:
rvm list
Switch Ruby Versions To switch to a different Ruby version, use:
rvm use <version>
Uninstalling RVM If you need to uninstall RVM, you can do so with the following command:
rvm implode