diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb new file mode 100644 index 000000000..40d9972a3 --- /dev/null +++ b/app/controllers/dashboard_controller.rb @@ -0,0 +1,4 @@ +class DashboardController < ApplicationController + def index + end +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 7377a8967..e7714cecc 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -17,7 +17,6 @@ FarmBot::Application.routes.draw do devise_for :users, :controllers => {:registrations => "registrations"} # Routes for the single page Javascript app. - # get "/app", to: 'dashboard#index', as: :dashboard - # match "/app/*path", to: redirect("/app"), via: :all - + get "/app", to: 'application#frontend', as: :dashboard + match "/app/*path", to: redirect("/app"), via: :all end diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 000000000..1c2dbd4dd --- /dev/null +++ b/deploy.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# Executed nightly by Rick's crontab. +cd $HOME/code/farmbot/api +git push staging master \ No newline at end of file diff --git a/deploy_errors.txt b/deploy_errors.txt new file mode 100644 index 000000000..e69de29bb diff --git a/install_frontend.sh b/install_frontend.sh index af0aa9e99..08bb47c0a 100755 --- a/install_frontend.sh +++ b/install_frontend.sh @@ -7,7 +7,8 @@ rm -rf /tmp/farmbot_frontend/.git mkdir public/ -p cp -R /tmp/farmbot_frontend/* public/ cd public -npm install webpack 2>&1 -npm install i18n-webpack-plugin 2>&1 +npm install webpack -g 2>&1 +npm install i18n-webpack-plugin -g 2>&1 npm install 2>&1 -npm run build 2>&1 +# npm run build 2>&1 + diff --git a/package.json b/package.json index d115c8a56..aeeefe7d9 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "[![Code Climate](https://codeclimate.com/github/FarmBot/farmbot-web-app/badges/gpa.svg)](https://codeclimate.com/github/FarmBot/farmbot-web-app) [![Test Coverage](https://codeclimate.com/github/FarmBot/farmbot-web-app/badges/coverage.svg)](https://codeclimate.com/github/FarmBot/farmbot-web-app) [![Build Status](https://travis-ci.org/FarmBot/farmbot-web-app.svg)](https://travis-ci.org/FarmBot/farmbot-web-app)", "scripts": { "start": "echo starting...", - "heroku-postbuild": "./install_frontend.sh" }, + "heroku-postbuild": "./install_frontend.sh 2>&1" }, "repository": { "type": "git", "url": "git+https://github.com/rickcarlino/farmbot-web-app.git" diff --git a/public/README.md b/public/README.md index 74256bf11..0b07aa504 100644 --- a/public/README.md +++ b/public/README.md @@ -9,26 +9,16 @@ 2. cd farmbot-web-frontend 3. npm install 4. run `npm start` -5. Visit `http://localhost:8080/` +5. Visit `http://localhost:8080/app/login` # Deploy to Production +**NOTE:** The [Web API](https://github.com/FarmBot/Farmbot-Web-API) deployment will automatically build the latest version of the frontend and mount it in the web server. The instructions below are intended for reference purposes, or for users who wish to host their frontend code on a different server than their API. + 1. run `npm run build` -2. Upload `tools/dist/farmbot-production.min.js` to your server. -3. Add `