This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to ruby 2.6.0 and latest gems Fix JSON endpoints Add RSS feed Add quote count ticker Add support for database migrations from all major PHP Rash versions Add coveralls code test coverage check Add discord chat bots Add Dockerfile and docker-compose support Deploy from docker on heroku
- Loading branch information
Showing
46 changed files
with
721 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.5.1 | ||
2.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
language: ruby | ||
cache: | ||
bundler: true | ||
bundler: true | ||
directories: | ||
- /home/travis/.rvm/ | ||
|
||
install: | ||
- bundle install --path vendor/bundle | ||
- "/home/travis/.rvm/" | ||
script: | ||
- bundle exec rake | ||
- bundle exec rake test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM ruby:2.6 | ||
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - | ||
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client | ||
RUN mkdir /rqdb | ||
WORKDIR /rqdb | ||
COPY Gemfile /rqdb/Gemfile | ||
COPY Gemfile.lock /rqdb/Gemfile.lock | ||
RUN bundle install | ||
COPY . /rqdb | ||
|
||
# Add a script to be executed every time the container starts. | ||
COPY docker_entrypoint.sh /usr/bin/ | ||
RUN chmod +x /usr/bin/docker_entrypoint.sh | ||
ENTRYPOINT ["docker_entrypoint.sh"] | ||
EXPOSE 3000 | ||
|
||
# Start the main process. | ||
CMD ["rails", "server", "-b", "0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,82 @@ | ||
# RQDB: Rash Quote Database | ||
[![Build Status](https://travis-ci.org/bplunkert/rqdb.svg?branch=development)](https://travis-ci.org/bplunkert/rqdb) | ||
[![Heroku Status](https://heroku-badge.herokuapp.com/?app=rqdb)](https://rqdb.herokuapp.com) | ||
[![Coverage Status](https://coveralls.io/repos/github/bplunkert/rqdb/badge.svg?branch=development)](https://coveralls.io/github/bplunkert/rqdb?branch=development) | ||
|
||
## Introduction: | ||
Rash/Rails Quote Database is a simple web application for publishing, sharing, and ranking quotes. It's a ground-up rebuild of the [Rash Quote Management System (RQMS)](http://rqms.sourceforge.net), originally written in PHP by Tom Cuchta. RQDB is written in Ruby on Rails instead of PHP and does not share any common code with the original version. | ||
|
||
## Installation | ||
### Depedendencies: | ||
Install [RVM](https://rvm.io) and Ruby 2.5.1: | ||
* ```curl -sSL https://rvm.io/mpapis.asc | gpg --import -``` | ||
* ```curl -sSL https://get.rvm.io | bash -s stable --ruby=2.5.1``` | ||
Install [RVM](https://rvm.io) and Ruby 2.6.0: | ||
``` | ||
curl -sSL https://rvm.io/mpapis.asc | gpg --import - | ||
curl -sSL https://get.rvm.io | bash -s stable --ruby=2.6.0 | ||
``` | ||
|
||
Install bundled ruby gems: | ||
* ```bundle install``` | ||
* Note: if bundle install fails due to postgres errors, you can safely skip this for development and testing by running: ```bundle install --without production``` | ||
``` | ||
bundle install | ||
``` | ||
|
||
### Main Installation: | ||
* ```bundle exec rake db:migrate``` | ||
* ```bundle exec rake db:seed``` | ||
``` | ||
bundle exec rake db:migrate && bundle exec rake db:seed | ||
``` | ||
|
||
### Migration from older PHP versions of Rash: | ||
This step will connect to a legacy Rash MySQL database and copy all existing data into the Currently only Rash 2.0 Beta version is supported. A MySQL client will be required. The example installs into the production database but set RAILS_ENV and other options as needed. | ||
* ```bundle install --with legacy_migration``` | ||
* ```RAILS_ENV=production bundle exec rake legacy:migrate_database --host SERVER --username USERNAME --database DATABASE --password PASSWORD``` | ||
This task will copy data from legacy PHP versions of Rash into the new Rash/Rails database. Only legacy MySQL databases are supported, and a MySQL client is required. All database settings are automatically detected by reading a configuration file --configfile from the legacy Rash installation. | ||
|
||
This example installs into the production database, but set RAILS_ENV and other options as needed: | ||
``` | ||
bundle install --with legacy_migration | ||
RAILS_ENV=production bundle exec rake legacy:migrate_database --configfile CONFIGFILE | ||
``` | ||
|
||
For more options, you can pass the --help flag: | ||
```bundle exec rake legacy:migrate_database --help``` | ||
``` | ||
RAILS_ENV=production bundle exec rake legacy:migrate_database --help | ||
``` | ||
|
||
When you're sure you are ready to run the migration, pass the --write flag: | ||
``` | ||
RAILS_ENV=production bundle exec rake legacy:migrate_database --configfile CONFIGFILE``` | ||
``` | ||
### Start the service: | ||
* ```bundle exec rails server``` | ||
``` | ||
bundle exec rails server | ||
``` | ||
### Start the chatbots (if applicable): | ||
``` | ||
bundle exec rake chatbot:all | ||
``` | ||
### Login: | ||
* Browse to http://localhost:3000 | ||
* Default username: admin@admin.admin | ||
* Default password: password | ||
* Default password: password | ||
## Docker | ||
### Build | ||
Build the web and database images: | ||
``` | ||
docker-compose build web | ||
``` | ||
Build the chatbot image: | ||
``` | ||
docker-compose build chatbot | ||
``` | ||
### Run | ||
Run the web and database containers: | ||
``` | ||
docker-compose run web | ||
``` | ||
Run the chatbot container: | ||
``` | ||
docker-compose run chatbot | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.