Files
grecia/docs/en/installation/ubuntu.md
Javi Martín 819485eb80 Re-add and apply MDL rule MD040
We were following it about half of the time and we even added it to our
former `.mdlrc` file. However, for some reason, MDL doesn't detect this
rule when specified in the `.mdlrc` file, so we didn't notice we weren't
following it in many cases.

Now that we're using a style file to configure MDL, we can enable this
rule again and apply it, since now MDL correctly includes it in its
report.
2024-06-21 15:57:52 +02:00

114 lines
2.4 KiB
Markdown

# Configuration for development and test environments (Ubuntu 18.04)
## System update
Run a general system update:
```bash
sudo apt update
```
## Git
Git is officially maintained in Ubuntu:
```bash
sudo apt install git
```
## Ruby version manager
Ruby versions packaged in official repositories are not suitable to work with Consul Democracy, so we'll have to install it manually.
First, we need to install Ruby's development dependencies:
```bash
sudo apt install libssl-dev autoconf bison build-essential libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev
```
The next step is installing a Ruby version manager, like rbenv:
```bash
wget -q https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-installer -O- | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
```
## Node.js
To compile the assets, you'll need a JavaScript runtime. Node.js is the preferred option.
Run the following command on your terminal:
```bash
sudo apt install nodejs
```
## PostgreSQL
Install postgresql and its development dependencies with:
```bash
sudo apt install postgresql libpq-dev
```
You also need to configure a user for your database. As an example, we'll choose the username "consul":
```bash
sudo -u postgres createuser consul --createdb --superuser --pwprompt
```
To make sure the UTF-8 enconding is used, create a file:
```bash
sudo nano /etc/profile.d/lang.sh
```
Add the following:
```bash
export LANGUAGE="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
```
Reconfigure Postgres to use the UTF-8 encoding:
```bash
sudo su - postgres
psql
```
```sql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8'
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
\q
exit
```
## Imagemagick
Install Imagemagick:
```bash
sudo apt install imagemagick
```
## ChromeDriver
To run E2E integration tests, we use Selenium along with Headless Chrome.
To get it working, install the chromium-chromedriver package and make sure it's available on your shell's PATH:
```bash
sudo apt install chromium-chromedriver
sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/
```
Now you're ready to go [get Consul Democracy installed](local_installation.md)!