diff --git a/docs/es/installation/deploying-on-heroku.md b/docs/es/installation/deploying-on-heroku.md index f1a4f30c1..01bfbcd68 100644 --- a/docs/es/installation/deploying-on-heroku.md +++ b/docs/es/installation/deploying-on-heroku.md @@ -1,36 +1,36 @@ -# Deploying on Heroku +# Instalación en Heroku -## Manual deployment +## Instalación manual -This tutorial assumes that you have already managed to clone CONSUL on your machine and gotten it to work. +Este tutorial asume que ya has conseguido clonar CONSUL en tu máquina y conseguir que funcione. -1. First, create a [Heroku](https://www.heroku.com) account if it isn't already done. -2. Install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) and sign in using +1. En primer lugar, necesitas crear una cuenta en [Heroku](https://www.heroku.com) si no lo has hecho ya. +2. Instala [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) e inicia sesión con: ```bash heroku login ``` -3. Go to your CONSUL repository and instantiate the process +3. Accede a tu repositorio de CONSUL y crea una instancia ```bash cd consul heroku create your-app-name ``` - You can add the flag `--region eu` if you want to use their European servers instead of the US ones. + Puedes añadir `--region eu` si quieres utilizar servidores europeos en lugar de los estadounidenses. - If _your-app-name_ is not already taken, Heroku should now create your app. + Si _your-app-name_ no existe aún, Heroku creará tu aplicación. -4. Create a database using +4. Crea la base de datos con ```bash heroku addons:create heroku-postgresql ``` - You should now have access to an empty Postgres database whose address was automatically saved as an environment variable named _DATABASE\_URL_. CONSUL will automatically connect to it when deployed. + Ahora deberías tener acceso a una base de datos Postgres vacía cuya dirección se guardó automáticamente como una variable de entorno llamada _DATABASE\_URL_. CONSUL se conectará automáticamente a ella durante la instalación. -5. **(Not needed)** Add a file name _heroku.yml_ at the root of your project and paste the following in it +5. **(No es necesario)** Crea un archivo con el nombre _heroku.yml_ en la raíz del proyecto y añade el siguiente código ```yml build: @@ -42,19 +42,19 @@ This tutorial assumes that you have already managed to clone CONSUL on your mach web: bundle exec rails server -e ${RAILS_ENV:-production} ``` -6. Now, generate a secret key and save it to an ENV variable named SECRET\_KEY\_BASE using +6. Ahora, genera una clave secreta y guárdala en la variable de entorno SECRET\_KEY\_BASE de la siguinte manera ```bash heroku config:set SECRET_KEY_BASE=$(rails secret) ``` - Also add your server address: + Añade también la dirección de tu servidor: ```bash heroku config:set SERVER_NAME=myserver.address.com ``` - You need to let the app know where the configuration variables are stored by adding a link to the ENV variables in _config/secrets.yml_ + Es necesario que la aplicación sepa dónde se almacenan las variables de configuración añadiendo un enlace a las variables de entorno en _config/secrets.yml_ ```yml production: @@ -62,28 +62,28 @@ This tutorial assumes that you have already managed to clone CONSUL on your mach server_name: <%= ENV["SERVER_NAME"] %> ``` - and commit this file in the repo by commenting out the corresponding line in the _.gitignore_. + y añade este archivo en el repositorio comentando la línea correspondiente en el _.gitignore_. ```gitignore #/config/secrets.yml ``` - **Remember not to commit the file if you have any sensitive information in it!** + **¡Recuerda no añadir el archivo si tienes información sensible en él!** -7. You can now push your app using +7. Ahora ya puedes subir tu aplicación utilizando: ```bash git push heroku your-branch:master ``` -8. It won't work straight away because the database doesn't contain the tables needed. To create them, run +8. No funcionará de inmediato porque la base de datos no contiene las tablas necesarias. Para crearlas, ejecuta ```bash heroku run rake db:migrate heroku run rake db:seed ``` - If you want to add the test data in the database, move `gem 'faker', '~> 1.8.7'` outside of `group :development` and run + Si quieres añadir los datos de prueba en la base de datos, mueve `gem 'faker', '~> 1.8.7'` fuera del `group :development` y ejecuta: ```bash heroku config:set DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true @@ -91,27 +91,27 @@ This tutorial assumes that you have already managed to clone CONSUL on your mach heroku run rake db:dev_seed ``` -9. Your app should now be ready to use. You can open it with +9. Ahora tu aplicación debería estar ya opertaiva. Puedes abrirla con ```bash heroku open ``` - You also can run the console on heroku using + También puedes arrancar la consola en heroku utilizando ```bash heroku console --app your-app-name ``` -10. Heroku doesn't allow to save images or documents in its servers, so it's necessary to setup a permanent storage space. +10. Heroku no permite guardar imágenes o documentos en sus servidores, por lo que es necesario configurar un nuevo espacio de almacenamiento. - See [our S3 guide](./using-aws-s3-as-storage.md) for more details about configuring Paperclip with S3. + Consulta [nuestra guía de S3](./using-aws-s3-as-storage.md) para más detalles sobre la configuración de Paperclip con S3. -### Configure Sendgrid +### Configurar Sendgrid -Add the SendGrid add-on in Heroku. It will create a SendGrid account for you with `ENV["SENDGRID_USERNAME"]` and `ENV["SENDGRID_PASSWORD"]`. +Añade el complemento (add-on) de SendGrid en Heroku. Esto creará una cuenta de SendGrid para la aplicación con `ENV["SENDGRID_USERNAME"]` y `ENV["SENDGRID_PASSWORD"]`. -Add this to `config/secrets.yml`, under the `production:` section: +Añade el siguiente código a `config/secrets.yml`, en la sección `production:`: ``` mailer_delivery_method: :smtp @@ -125,15 +125,15 @@ Add this to `config/secrets.yml`, under the `production:` section: :enable_starttls_auto: true ``` -Important: Turn on one worker dyno so that emails get sent. +Importante: Activa un "worker dyno" para que se envíen los correos electrónicos. -## Optional but recommended: +### Opcional (pero recomendado): -### Install rails\_12factor and specify the Ruby version +### Instalar rails\_12factor y especificar la versión de Ruby -**The rails\_12factor is only useful if you use a version of CONSUL older than 1.0.0. The latter uses Rails 5 which includes the changes.** +**Instalar rails\_12factor sólo es útil si utilizas una versión de CONSUL anterior a la 1.0.0. La última versión utiliza Rails 5 que ya incluye los cambios.** -As recommended by Heroku, you can add the gem rails\_12factor and specify the version of Ruby you want to use. You can do so by adding +Como nos recomienda Heroku, puedes añadir la gema rails\_12factor y especificar la versión de Ruby a utilizar. Puedes hacerlo añadiendo: ```ruby gem 'rails_12factor' @@ -141,44 +141,44 @@ gem 'rails_12factor' ruby 'x.y.z' ``` -in the file _Gemfile\_custom_, where `x.y.z` is the version defined in the `.ruby-version` file in the CONSUL repository. Don't forget to run +en el archivo _Gemfile\_custom_, donde `x.y.z` es la versión definida en el fichero `.ruby-version` del repositorio de CONSUL. No olvides ejecutar ```bash bundle install ``` -to generate _Gemfile.lock_ before commiting and pushing to the server. +para generar el _Gemfile.lock_ antes de añadir los cambios y subirlos al servidor. -### Use Puma as a web server +### Utilizar Puma como servidor web -Heroku recommends to use Puma to improve the responsiveness of your app on [a number of levels](http://blog.scoutapp.com/articles/2017/02/10/which-ruby-app-server-is-right-for-you). +Heroku recomienda utilizar Puma para mejorar el [rendimiento](http://blog.scoutapp.com/articles/2017/02/10/which-ruby-app-server-is-right-for-you) de la aplicación. -If you want to allow more concurrency, uncomment the line: +Si quieres permitir más concurrencia, descomenta la siguiente linea: ```ruby workers ENV.fetch("WEB_CONCURRENCY") { 2 } ``` -You can find an explanation for each of these settings in the [Heroku tutorial](https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server). +Puedes encontrar una explicación para diferentes configuraciones en el siguiente [tutorial de Heroku](https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server). -The last part is to change the _web_ task to use Puma by changing it to this in your _heroku.yml_ file: +Por último hay que cambiar la tarea _web_ para usar Puma cambiándola en el archivo _heroku.yml_ con el siguiente código: ```yml web: bundle exec puma -C config/puma.rb ``` -### Add configuration variables to tune your app from the dashboard +### Añadir variables de configuración desde el panel de control -The free and hobby versions of Heroku are barely enough to run an app like CONSUL. To optimise the response time and make sure the app doesn't run out of memory, you can [change the number of workers and threads](https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#workers) that Puma uses. +Las versiones gratuita y hobby de Heroku no son suficientes para ejecutar una aplicación como CONSUL. Para optimizar el tiempo de respuesta y asegurarte de que la aplicación no se quede sin memoria, puedes [cambiar el número de "workers" e hilos](https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#workers) que utiliza Puma. -My recommended settings are one worker and three threads. You can set it by running these two commands: +La configuración recomendada es un "worker" y tres hilos. Puedes configurarlo ejecutando estos dos comandos: ```bash heroku config:set WEB_CONCURRENCY=1 heroku config:set RAILS_MAX_THREADS=3 ``` -I also recommend to set the following: +También es recomendable configurar las siguientes variables: ```bash heroku config:set RAILS_SERVE_STATIC_FILES=enabled heroku config:set RAILS_ENV=production