From dee9f071a1d4842f6406ce050bf9f19df3065eeb Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Mon, 12 Sep 2016 15:42:18 -0500 Subject: [PATCH] Update deployment information. --- Gemfile | 1 - README.md | 7 +------ db/seeds.rb | 10 ++++++---- deployment.md | 13 ++++++++----- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index de3f9dedb..ae34c025d 100755 --- a/Gemfile +++ b/Gemfile @@ -36,7 +36,6 @@ group :development, :test do gem 'factory_girl_rails' gem 'faker' gem 'smarf_doc', github: 'RickCarlino/smarf_doc' - # gem 'sqlite3' gem 'rails-erd' end diff --git a/README.md b/README.md index 33f6c4171..ed4bd4172 100755 --- a/README.md +++ b/README.md @@ -27,12 +27,7 @@ The key responsibility of the API is *information and permissions management*. T # Provisioning Your Own with Dokku -0. Create a fresh Ubuntu 14 server with Dokku (or just use DigitalOcean) -0. [Upgrade to the latest version of Dokku](https://github.com/dokku/dokku/blob/master/docs/upgrading.md) (especially if you are on DigitalOcean- their version is out of date) -0. Install dokku-haproxy plugin: `ssh root@YOUR_SERVER dokku plugin:install https://github.com/256dpi/dokku-haproxy.git` -0. Deploy: `git push dokku@YOUR_SERVER:mqtt` -0. Point to correct host/port: `ssh dokku@MQTT_SERVER config:set mqtt PORT=3002 DOKKU_NGINX_PORT=3002 WEB_APP_URL=WEBAPP_URL_HERE` -0. Expose MQTT port: `ssh dokku@MQTT_SERVER ports:add mqtt 1883 web 1883` +Please see `deployment.md`. # Config Settings (important) diff --git a/db/seeds.rb b/db/seeds.rb index 60e43fa9c..ce73b9891 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,5 +1,7 @@ # User for testing purposes: -Users::Create.run!(name: "Administrator", - email: "admin@admin.com", - password: "password123", - password_confirmation: "password123") +unless Rails.env == "production" + Users::Create.run!(name: "Administrator", + email: "admin@admin.com", + password: "password123", + password_confirmation: "password123") +end diff --git a/deployment.md b/deployment.md index 4038b12b4..7f8c53882 100644 --- a/deployment.md +++ b/deployment.md @@ -5,20 +5,23 @@ * Make sure you have atleast 1gb. 0. [Install the latest version of Dokku (don't use that DigitalOcean image)](https://github.com/dokku/dokku#installing) 0. Setup Dokku by visiting the server's URL. Follow the directions on screen. -0. `git remote add my_server dokku@138.68.19.190:my-api-name` +0. `git remote add my_server dokku@your-server:my-api-name` 0. Install mariaDB plugin: [instructions](https://github.com/dokku/dokku-mariadb). 0. Create a databse: `ssh dokku@your-server mariadb:create my_db` 0. Link the DB: `ssh dokku@your-server mariadb:link my_db my-api-name` 0. Set ENV vars: - * `ssh dokku@staging-next config:set my-api-name DEVISE_SECRET=$(rake secret)` - * `ssh dokku@staging-next config:set my-api-name JS_FILE_URL=//mycdn.org/farmbot-fronted.js` - * `ssh dokku@staging-next config:set my-api-name MQTT_HOST=my-mqtt-server.org` - * `ssh dokku@staging-next config:set my-api-name DATABASE_URL=mysql://dbusername:dbpassword@dburl:dbport/dbname` + * `ssh dokku@your-server config:set my-api-name DEVISE_SECRET=$(rake secret)` + * `ssh dokku@your-server config:set my-api-name JS_FILE_URL=//mycdn.org/farmbot-fronted.js` + * `ssh dokku@your-server config:set my-api-name MQTT_HOST=my-mqtt-server.org` + * `ssh dokku@your-server config:set my-api-name DATABASE_URL=mysql://dbusername:dbpassword@dburl:dbport/dbname` +0. Migrate / create db: `ssh dokku@your-server run my-api-name rake db:setup` # Old / Legacy Setup (Added Sept. 2016) +No longer used, but possibly relevant for those running legacy servers. + 0. Create a fresh Ubuntu 14 server with Dokku (or just use DigitalOcean) 0. [Upgrade to the latest version of Dokku](https://github.com/dokku/dokku/blob/master/docs/upgrading.md) (especially if you are on DigitalOcean- their version is out of date) 0. Install dokku-haproxy plugin: `ssh root@YOUR_SERVER dokku plugin:install https://github.com/256dpi/dokku-haproxy.git`