mirror of
https://github.com/Evolix/chexpire.git
synced 2024-06-05 09:04:29 +02:00
improvements to the installation instructions
This commit is contained in:
parent
f4cb47af91
commit
548f9d5e60
28
INSTALL.md
28
INSTALL.md
|
@ -7,13 +7,13 @@ Chexpire requires :
|
|||
* NodeJS and Yarn
|
||||
* MySQL or MariaDB
|
||||
|
||||
We are currently using Chexpire on :
|
||||
We are usually running Chexpire on typical POSIX servers like :
|
||||
- Linux Debian 9, Ruby 2.5.1, NodeJS 8.11 and MariaDB 10.1
|
||||
- macOS High Sierra, Ruby 2.5.1, NodeJS 10.2.1 and MariaDB 10.2
|
||||
|
||||
It probably works on any system that support Ruby >2.3, NodeJS >6 and MySQL >5.5.
|
||||
It probably works on any system that supports Ruby >2.3, NodeJS >6 and MySQL >5.5. Feel free to report any unexpected incompatibilities.
|
||||
|
||||
You can use our [Ansible roles](http://forge.evolix.org/projects/ansible-roles) to easily install the requirements : rbenv, mysql, nodejs. Example :
|
||||
If you are familiar with Ansible, you can use our [Ansible roles](http://forge.evolix.org/projects/ansible-roles) to easily install the requirements : rbenv, mysql, nodejs. Add this to your playbook :
|
||||
|
||||
```
|
||||
[…]
|
||||
|
@ -24,18 +24,19 @@ roles:
|
|||
[…]
|
||||
```
|
||||
|
||||
NB: the Rbenv `username` variable points to the user that you want to install Rbenv for. If you use this user for the SSH connection of Ansible, you can leave the `{{ ansible_user }}` value.
|
||||
> NB: the Rbenv `username` variable points to the user that you want to install Rbenv for. If you use this user for the SSH connection of Ansible, you can leave the `{{ ansible_user }}` value.
|
||||
|
||||
If you prefer, you can install [Rbenv](https://github.com/rbenv/rbenv/#installation), [NodeJS](https://wiki.evolix.org/HowtoNodeJS#installation), [Yarn](https://wiki.evolix.org/HowtoNodeJS#yarn) and [MariaDB](https://wiki.evolix.org/HowtoMySQL#installation) manually.
|
||||
If you want to do manual installations, you can use our Wiki documentations for [Rbenv](https://github.com/rbenv/rbenv/#installation), [NodeJS](https://wiki.evolix.org/HowtoNodeJS#installation), [Yarn](https://wiki.evolix.org/HowtoNodeJS#yarn) and [MariaDB](https://wiki.evolix.org/HowtoMySQL#installation).
|
||||
|
||||
## Dependencies
|
||||
|
||||
Execute `# bundle install` to install Ruby dependencies (including Rails itself).
|
||||
Execute `# yarn install` to install Javascript dependencies.
|
||||
|
||||
Execute `# yarn install` to install Javascript/NodeJS dependencies.
|
||||
|
||||
## Rails configuration
|
||||
|
||||
After cloning this repository, you have to create and edit a few files from example files for your local development configuration :
|
||||
After cloning this repository, you have to create and edit a few files from example files, for your local development configuration :
|
||||
|
||||
- `config/database.yml`
|
||||
- `config/chexpire.yml`
|
||||
|
@ -58,28 +59,29 @@ MariaDB [none]> GRANT ALL PRIVILEGES ON `chexpire_test`.* TO `chexpire_test`@loc
|
|||
MariaDB [none]> FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
Don't forget to do the same for the test database and to adapt the settings in `config/database.yml` accordingly.
|
||||
Don't forget to adapt the settings in `config/database.yml` accordingly.
|
||||
Also, on Debian 9 with MariaDB, the database socket is at `/var/run/mysqld/mysqld.sock`, which is not the default in the configuration file.
|
||||
|
||||
You must run the migrations with `# bundle exec rails db:migrate` (for development) and `# bundle exec rails db:migrate RAILS_ENV=test` (for test).
|
||||
You must run the migrations with `# bundle exec rails db:migrate` (for the default environment – development) and `# bundle exec rails db:migrate RAILS_ENV=test` (for the test environment).
|
||||
|
||||
## Tests
|
||||
|
||||
The test suite can be run with `# bundle exec rails test`.
|
||||
|
||||
This will also generate a code coverage report in `coverage/index.html`.
|
||||
|
||||
With `# bundle exec guard` your test suite is run completely a first time, then once for each file you change and save. Take a look at https://guardgem.org for more information.
|
||||
|
||||
## Local execution
|
||||
|
||||
If you want to start the Rails application manually, with a simple Puma configuration, you have to execute `# bundle exec rails server`.
|
||||
If you want to start the Rails application manually, with a simple Puma configuration, you have to execute `# bundle exec rails server`. You will be able to open http://127.0.0.1:3000 in your browser and see Chexpire in action.
|
||||
|
||||
## Deployment
|
||||
|
||||
**staging** and **production** environments are preconfigured.
|
||||
**staging** and **production** environments are preconfigured. You can use any of them or add more if you want.
|
||||
|
||||
### Capistrano
|
||||
|
||||
If you want to use capistrano for deployment, create `config/deploy/config.yml` from the example file, and use the `to_staging` and/or `to_production` file.
|
||||
If you want to use capistrano for deployment, yout need to create (on your server) `config/deploy/config.yml` from the example file, and use the `script/to_staging` and/or `script/to_production` scripts.
|
||||
|
||||
As you created the config development files above, you'll have to do the same on the staging and production servers ( `shared/config/database.yml` etc…).
|
||||
The same way you've created the config files for development, you'll have to do the same on the staging and production servers in the `shared/config/` directory,relative to your `deploy_to` path.
|
||||
|
|
Loading…
Reference in a new issue