Skip to content

Latest commit

 

History

History
94 lines (52 loc) · 2.76 KB

File metadata and controls

94 lines (52 loc) · 2.76 KB

Development

Setup

First things first, you'll need to fork and clone the repository to your local machine.

git clone https://github.com/ecosyste-ms/repos.git

The project uses ruby on rails which have a number of system dependencies you'll need to install.

You will then need to set some configuration environment variables. Copy env.example to .env.development and customise the values to suit your local setup.

Once you've got all of those installed, from the root directory of the project run the following commands:

bin/setup
bin/dev

You can then load up http://localhost:3000 to access the service.

Docker

Alternatively you can use the existing docker configuration files to run the app in a container.

Run this command from the root directory of the project to start the service.

docker-compose up --build

You can then load up http://localhost:3000 to access the service.

For access the rails console use the following command:

docker-compose exec app rails console

Importing data

To set up an initial set of repository hosts:

rake db:seed

Then, you can run an sync to import some repositories:

rake repositories:sync_recently_active

Tests

The applications tests can be found in test and use the testing framework minitest.

You can run all the tests with:

rails test

Rake tasks

The applications rake tasks can be found in lib/tasks.

You can list all of the available rake tasks with the following command:

rake -T

Background tasks

Background tasks are handled by sidekiq, the workers live in app/sidekiq.

Sidekiq is automatically run by bin/dev, but if you need to run it manually, run the following command:

bundle exec sidekiq

You can also view the status of the workers and their queues from the web interface http://localhost:3000/sidekiq

Adding an host type

TODO

Deployment

A container-based deployment is highly recommended, we use dokku.com.

Alternative service domains

This service uses a number of other ecosyste.ms services, you can use alternative domains for these services by setting the following environment variables: