Skip to content

Commit c020c5f

Browse files
committed
Update README
1 parent a61556b commit c020c5f

2 files changed

Lines changed: 35 additions & 21 deletions

File tree

README.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
11
# README
22

3-
This README would normally document whatever steps are necessary to get the
4-
application up and running.
3+
Welcome to the Ruby or Rails Discord Bot!
54

6-
Things you may want to cover:
5+
# Project Summary
76

8-
* Ruby version
7+
Get Daily Puzzles delivered to your preferred server channel with a "Is it Ruby or Rails?" style question.
98

10-
* System dependencies
9+
# Requirements
10+
- PostgreSQL
11+
- Redis
12+
- Ruby 3.4.2
1113

12-
* Configuration
14+
# Set Up
15+
```
16+
git clone git@github.com:ombulabs/ruby-or-rails.git
17+
cd reads
18+
./bin/setup
19+
```
20+
Check the .env.sample file for information on what environment variables you will need.
1321

14-
* Database creation
22+
# Run the server and bot
1523

16-
* Database initialization
24+
Running the server (this is not necessary to run the bot):
25+
`bundle exec rails server`
26+
-or-
27+
`bundle exec rails s`
1728

18-
* How to run the test suite
29+
Registering and re-registering the bot commands:
30+
`bundle exec rake discord:reset_commands`
1931

20-
* Services (job queues, cache servers, search engines, etc.)
32+
Starting the bot:
33+
`bundle exec rake discord:start_bot`
2134

22-
* Deployment instructions
35+
Be aware that it is possible to start the bot multiple times at once, and this could cause issues. Be sure to only run one bot at a time.
2336

24-
* ...
37+
This application is using `sidekiq` to run jobs.
38+
Running sidekiq:
39+
`bundle exec sidekiq -c 2 -q default`

bin/setup

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/usr/bin/env ruby
22
require "fileutils"
3+
require "dotenv"
4+
include FileUtils
35

46
APP_ROOT = File.expand_path("..", __dir__)
7+
APP_NAME = "ombutalk-bot"
58

69
def system!(*args)
710
system(*args, exception: true)
@@ -13,22 +16,18 @@ FileUtils.chdir APP_ROOT do
1316
# Add necessary setup steps to this file.
1417

1518
puts "== Installing dependencies =="
19+
system! "gem install bundler --conservative"
1620
system("bundle check") || system!("bundle install")
1721

18-
# puts "\n== Copying sample files =="
19-
# unless File.exist?("config/database.yml")
20-
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
21-
# end
22+
# Load environment variables from .env files
23+
Dotenv.load('.env')
2224

2325
puts "\n== Preparing database =="
2426
system! "bin/rails db:prepare"
2527

2628
puts "\n== Removing old logs and tempfiles =="
2729
system! "bin/rails log:clear tmp:clear"
2830

29-
unless ARGV.include?("--skip-server")
30-
puts "\n== Starting development server =="
31-
STDOUT.flush # flush the output before exec(2) so that it displays
32-
exec "bin/dev"
33-
end
31+
puts "\n== Restarting application server =="
32+
system! "bin/rails restart"
3433
end

0 commit comments

Comments
 (0)