Skip to content

Commit b92e291

Browse files
author
Gogs
committed
Write scripts to start and stop the application
1 parent 7711f94 commit b92e291

6 files changed

Lines changed: 14 additions & 12 deletions

File tree

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@
1616
!/log/.keep
1717
/tmp
1818

19-
# Ignore backup files
20-
site-backup.tgz
19+
pid.file

Gemfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ gem 'bcrypt', '~> 3.1.7'
2727
gem 'jwt'
2828
gem 'config'
2929

30-
# Rails Backup
31-
gem 'rails-backup-migrate'
32-
3330
# Use Unicorn as the app server
3431
# gem 'unicorn'
3532

Gemfile.lock

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ GEM
133133
bundler (>= 1.3.0)
134134
railties (= 5.2.3)
135135
sprockets-rails (>= 2.0.0)
136-
rails-backup-migrate (0.0.12)
137-
activerecord (>= 2.3)
138136
rails-dom-testing (2.0.3)
139137
activesupport (>= 4.2.0)
140138
nokogiri (>= 1.6)
@@ -205,7 +203,6 @@ DEPENDENCIES
205203
jwt
206204
mysql2 (~> 0.4.4)
207205
rails (= 5.2.3)
208-
rails-backup-migrate
209206
sass-rails (~> 5.0)
210207
sdoc (~> 0.4.0)
211208
spring

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ EveryDocs Core is the server-side part of EveryDocs. This project will contain a
1212
4. Configure your database connection in config/database.yml
1313
5. Configure the folder where documents are stored in config/settings.yml
1414
6. Install required dependencies by ruuning: ``bundle install``
15-
7. Start your Rails server on a specific port (or on port 3000, if you don't use the command line parameter): ``rails server --port 1234``
15+
7. You might want to change the port of the application in start-app.sh.
16+
7. Start your Rails server: ``./start-app.sh``
1617
8. Access the application on http://localhost:1234 or configure any kind of proxy forwarding in your webserver.
1718
9. If you wish to use this application in your web browser, consider to install [EveryDocs Web](https://github.com/jonashellmann/everydocs-web/)!
19+
10. Stop the application: ``./stop-app.sh``
1820

1921
## Backup
2022

21-
To backup your database, you can run: ``rake site:backup``. This command
22-
creates an archive file called site-backup.tgz. You can restore this backup by
23-
running ``rake site:restore``.
23+
To backup your application, you can simply use the backup functionality of your
24+
database. For example, a MySQL/MariaDB DBMS may use mysqldump.
2425

2526
Additionally you have to backup the place where the documents are stored. You
2627
can configure this in config/settings.yml. To restore, just put the documents back in that location.

start-app.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
nohup rails s --port 5678 -e development > /dev/null 2>&1 &
4+
echo $! > pid.file

stop-app.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
pid=$(cat pid.file)
4+
sudo kill $pid

0 commit comments

Comments
 (0)