Last active
October 29, 2017 15:12
-
-
Save RickCarlino/48b0362ccb82dffe5d4a292ee1cc00d2 to your computer and use it in GitHub Desktop.
Provisioning a FarmBot Web App server, Ubuntu 17.10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to install FarmBot Web API on a Fresh Ubuntu 17 machine. | |
# Remove old (possibly broke) docker versions | |
sudo apt-get remove docker docker-engine docker.io | |
# Install docker | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common --yes | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" --yes | |
sudo apt-get update --yes | |
sudo apt-get install docker-ce --yes | |
sudo docker run hello-world # Should run! | |
# Install RVM | |
command curl -sSL https://rvm.io/mpapis.asc | gpg --import - | |
curl -sSL https://get.rvm.io | bash | |
source /usr/local/rvm/scripts/rvm | |
rvm install "ruby-2.4.2" | |
cd . | |
rvm --default use 2.4.2 | |
# LOG OUT AND LOG BACK IN NOW. | |
# Image Magick | |
sudo apt-get install imagemagick --yes | |
# Install Node | |
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - | |
sudo apt-get install -y nodejs --yes | |
# Install Yarn | |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | |
sudo apt-get update && sudo apt-get install yarn | |
# Install database deps | |
sudo apt-get install libpq-dev postgresql-contrib --yes | |
# Install FarmBot Web App | |
git clone https://github.com/FarmBot/Farmbot-Web-App --depth=10 | |
cd Farmbot-Web-App | |
gem install bundler | |
npm install yarn | |
bundle install | |
yarn install | |
cp config/database.example.yml config/database.yml | |
mv config/application.example.yml config/application.yml | |
# READ THE FILE AND CHANGE THE VALUES ^ | |
sudo -u postgres psql | |
# Run this: | |
# CREATE USER "your_username_here" WITH SUPERUSER; | |
# \q | |
rake db:create:all db:migrate db:seed | |
RAILS_ENV=test rake db:create db:migrate && rspec spec | |
npm run test | |
# Run MQTT (new tab, SAME DIRECTORY) | |
rails mqtt:start | |
# Run the web server (new tab, SAME DIRECTORY) | |
rails api:start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment