diff --git a/install_frontend.sh b/install_frontend.sh new file mode 100755 index 000000000..f6342c90b --- /dev/null +++ b/install_frontend.sh @@ -0,0 +1,10 @@ +#!/bin/bash +rm -rf /tmp/farmbot_frontend +mkdir /tmp/farmbot_frontend +git clone https://github.com/rickcarlino/farmbot-web-frontend.git /tmp/farmbot_frontend +rm -rf /tmp/farmbot_frontend/.git +mkdir public/ -p +cp -R /tmp/farmbot_frontend/* public/ +cd public +npm install +npm run build diff --git a/lib/tasks/install_frontend.rake b/lib/tasks/install_frontend.rake deleted file mode 100644 index 2168509ac..000000000 --- a/lib/tasks/install_frontend.rake +++ /dev/null @@ -1,16 +0,0 @@ -require_relative '../key_gen' - -namespace :frontend do - desc "Install the frontend into /public" - task install: :environment do - `rm -rf /tmp/farmbot_frontend` - `mkdir /tmp/farmbot_frontend` - `git clone https://github.com/rickcarlino/farmbot-web-frontend.git /tmp/farmbot_frontend - rm -rf /tmp/farmbot_frontend/.git - cp -R /tmp/farmbot_frontend/* public/ - cd public - npm install webpack - npm install --production - npm run build` - end -end diff --git a/package.json b/package.json index 5d259ccd3..d17bcf9b9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "farmbot_api", "version": "1.0.0", "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": { "heroku-postbuild": "rake frontend:install" }, + "scripts": { "start": "./install_frontend.sh" }, "repository": { "type": "git", "url": "git+https://github.com/rickcarlino/farmbot-web-app.git" diff --git a/public/package.json b/public/package.json index 42e30a6ec..ce1951487 100644 --- a/public/package.json +++ b/public/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/farmbot/farmbot-web-frontend" }, "scripts": { - "build": "webpack --config tools/webpack.config.prd.js", + "build": "./node_modules/webpack/bin/webpack.js --config tools/webpack.config.prd.js", "start": "webpack-dev-server --config tools/webpack.config.dev.js", "test": "karma start karma.config.js" },