Add Ubuntu installation instructions

This commit is contained in:
Javi Martín
2019-03-01 13:31:29 +01:00
committed by voodoorai2000
parent 924503fa09
commit 86a0801140
4 changed files with 190 additions and 2 deletions

View File

@@ -11,7 +11,8 @@
### Installation
* [Introduction](getting_started/introduction.md)
* [Prerequisites](getting_started/prerequisites/README.md)
* [Debian GNU/Linux](getting_started/prerequisites/debian.md)
* [Debian GNU/Linux](getting_started/prerequisites/linux.md)
* [Ubuntu Linux](getting_started/prerequisites/ubuntu.md)
* [macOS](getting_started/prerequisites/macos.md)
* [Windows](getting_started/prerequisites/windows.md)
* [Local installation](getting_started/local_installation.md)

View File

@@ -0,0 +1,93 @@
# Configuration for development and test environments (Ubuntu 18.04)
## Git
Git is officially maintained in Ubuntu:
```bash
sudo apt install git
```
## Ruby
Ruby versions packaged in official repositories are not suitable to work with CONSUL, so we'll have to install it manually.
First, we need to install Ruby's development dependencies:
```bash
sudo apt install libssl1.0-dev autoconf bison build-essential libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev
```
Note we're installing `libssl1.0-dev` instead of `libssl-dev`. That's because Ruby 2.3.2 (which CONSUL uses in version 0.19) is not compatible with OpenSSL 1.1.
The next step is installing a Ruby version manager, like rbenv:
```bash
wget -q https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer -O- | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
```
Finally, install Ruby 2.3.2, which will take a few minutes:
```bash
rbenv install 2.3.2
```
## Bundler
Check we're using the Ruby version we've just installed:
```bash
rbenv global 2.3.2
ruby -v
=> ruby 2.3.2p217
```
And install Bundler with:
```bash
gem install bundler
```
## Node.js
To compile the assets, you'll need a JavaScript runtime. Node.js is the preferred option. As with Ruby, we don't recommend installing Node from your distro's repositories.
To install it, you can use [n](https://github.com/tj/n)
Run the following command on your terminal:
```bash
wget -L https://git.io/n-install | bash -s -- -y lts
```
It will install the latest LTS (Long Term Support) Node version on your `$HOME` folder automatically (using [n-install](https://github.com/mklement0/n-install))
## 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
```
## 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 installed](../local_installation.html)!

View File

@@ -11,7 +11,8 @@
### Instalación
* [Introducción](getting_started/introduction.md)
* [Prerrequisitos](getting_started/prerequisites/README.md)
* [Debian GNU/Linux](getting_started/prerequisites/debian.md)
* [Debian GNU/Linux](getting_started/prerequisites/linux.md)
* [Ubuntu Linux](getting_started/prerequisites/ubuntu.md)
* [macOS](getting_started/prerequisites/macos.md)
* [Windows](getting_started/prerequisites/windows.md)
* [Instalación local](getting_started/local_installation.md)

View File

@@ -0,0 +1,93 @@
# Configuración para los entornos de desarrollo y pruebas (Ubuntu 18.04)
## Git
Git es mantenido oficialmente en Ubuntu:
```bash
sudo apt install git
```
## Ruby
Las versiones de Ruby versions empaquetadas en repositorios oficiales no son aptas para trabajar con CONSUL, así que debemos instalarlo manualmente.
En primer lugar, necesitamos los siguiente paquetes para poder instalar Ruby:
```bash
sudo apt install libssl1.0-dev autoconf bison build-essential libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev
```
Nótese que estamos instalando el paquete `libssl1.0-dev` en lugar de `libssl-dev`. Esto es debido a que Ruby 2.3.2 (versión que CONSUL 0.19 utiliza) no es compatible con OpenSSL 1.1.
El siguiente paso es instalar un gestor de versiones de Ruby, como rbenv:
```bash
wget -q https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer -O- | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
```
Por último, para instalar Ruby 2.3.2 (proceso que llevará unos minutos):
```bash
rbenv install 2.3.2
```
## Bundler
Comprueba que estemos usando la versión de Ruby que acabamos de instalar:
```bash
rbenv global 2.3.2
ruby -v
=> ruby 2.3.2p217
```
E instala Bundle con:
```bash
gem install bundler
```
## Node.js
Para compilar los archivos estáticos (JS, CSS, imágenes, etc.), es necesario un _runtime_ de JavaScript. Node.js es la opción recomendada. Al igual que como ocurre con Ruby, no es recomendable instalar Node directamente de los repositorios de tu distribución Linux.
Para instalar Node, puedes usar [n](https://github.com/tj/n)
Ejecuta en tu terminal:
```bash
wget -L https://git.io/n-install | bash -s -- -y lts
```
Y este instalará automáticamente la versión LTS (_Long Term Support_, inglés para "Soporte a largo plazo") más reciente de Node en tu directorio `$HOME` (usando [n-install](https://github.com/mklement0/n-install))
## PostgreSQL
Instala postgresql y sus dependencias de desarrollo con:
```bash
sudo apt install postgresql libpq-dev
```
Para el correcto funcionamiento de CONSUL, necesitas confgurar un usuario para tu base de datos. Como ejemplo, crearemos un usuario llamado "consul":
```bash
sudo -u postgres createuser consul --createdb --superuser --pwprompt
```
## ChromeDriver
Para realizar pruebas de integración, usamos Selenium junto a Headless Chrome.
Para poder utilizarlo, instala el paquete chromium-chromedrive y asegúrate de que se encuentre enlazado en algún directorio que esté en la variable de entorno PATH:
```bash
sudo apt install chromium-chromedriver
sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/
```
¡Ya estás listo para [instalar CONSUL](../local_installation.html)!