@@ -5,14 +5,10 @@ To simplify set up of a developement environment, LinuxFr.org can be
55run on Docker with ` docker-compose up ` .
66
77To init the SQL database schema, you need to wait upto the ` database `
8- and ` database-test ` containers are ready to listen MySQL connections.
8+ container to be ready to listen MySQL connections.
99
1010For example, you should see in the logs:
1111
12- > database-test_1 | 2020-09-21 16:03:12 140126029907968 [ Note] mysqld: ready for connections.
13- >
14- > database-test_1 | Version: '10.1.46-MariaDB-1\~ bionic' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
15- >
1612> database_1 | 2020-09-21 16:03:12 139820938893312 [ Note] mysqld: ready for connections.
1713>
1814> database_1 | Version: '10.1.46-MariaDB-1\~ bionic' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
@@ -26,9 +22,12 @@ docker-compose run linuxfr.org bin/rails db:setup
2622Finally, the environment is ready and you can open [ http://dlfp.lo ] ( http://dlfp.lo )
2723in your favorite browser.
2824
29- Note: to be able to access this URL, you'll need to add the line
30- ` 127.0.0.1 dlfp.lo image.dlfp.lo ` to the ` /etc/hosts ` file of your
31- machine.
25+ Note: to be able to access this URL, you'll need to add the following line
26+ into the ` /etc/hosts ` file of your machine:
27+
28+ ```
29+ 127.0.0.1 dlfp.lo image.dlfp.lo
30+ ```
3231
3332Personalize configuration
3433=========================
@@ -62,19 +61,39 @@ will directly detect changes and apply them on next page reload.
6261Furthermore, if you need to access the Rails console, you need a second
6362terminal and run:
6463
65- ` docker-compose run linuxfr.org bin/rails console `
64+ ```
65+ docker-compose run linuxfr.org bin/rails console
66+ ```
6667
6768Note: currently, we didn't configure rails to show directly the
6869` webconsole ` in your browser. That's just because of time needed to
6970find the good configuration, any help will be appreciated !
7071
72+ Run application tests
73+ =====================
74+
75+ To help maintainers, we are in the process of adding tests to check the
76+ application has still the expected behaviour.
77+
78+ To get help about writing tests, see the
79+ [ Ruby on Rails documentation] ( https://guides.rubyonrails.org/testing.html#the-rails-test-runner )
80+ .
81+
82+ To run tests with Docker environment, you need to use this command:
83+
84+ ```
85+ docker-compose run linuxfr.org bin/rails test -v
86+ ```
87+
7188Inspect database schema
7289=======================
7390
7491In case you need to inspect the database, you need a second terminal
7592and run:
7693
77- ` docker-compose run database mysql -hdatabase -ulinuxfr_rails -p linuxfr_rails `
94+ ```
95+ docker-compose run database mysql -hdatabase -ulinuxfr_rails -p linuxfr_rails
96+ ```
7897
7998By default, the requested password is the same as the username.
8099
@@ -84,12 +103,16 @@ Apply database migrations
84103In case you need to apply new database migrations, you need a second
85104terminal and run:
86105
87- ` docker-compose run linuxfr.org bin/rails db:migrate `
106+ ```
107+ docker-compose run linuxfr.org bin/rails db:migrate
108+ ```
88109
89110If you had issue and want to reset all data in your database system,
90111use:
91112
92- ` docker-compose run linuxfr.org bin/rails db:reset `
113+ ```
114+ docker-compose run linuxfr.org bin/rails db:reset
115+ ```
93116
94117Services provided by the docker-compose
95118=======================================
0 commit comments