Oreact UP

Easily deploy Oreact artifacts anywhere. Orup is inspired by project Meteor UP

Installation

Install Oreact Up with one command, Orup requires node 4 or newer.

yarn global add orup

Server Recommendations

You need at least one server to deploy to. You can get one for $5/month or less from AWS EC2, AWS LightSail, Digital Ocean, Vultr, or OVH.

The server should:

  • Have at least 512MB of RAM. 1GB is recommended.
  • Be running Ubuntu 14 or 16.

You do not need to install anything on your servers; Orup will set them up for you.

Initialize deployment configuration

In the terminal, run following command to your project root directory:

cd path/to/my-project
mkdir .deploy && cd .deploy
orup init

It is a common practice to store orup config in a .deploy folder.

Customize your config

There are a minimum of 4 properties in your config that need to be changed.

For each server:

  • host - Usually is the IP Address of the server
  • server authentication - You can use a password or set pem to the path to a private key. If neither are set, it uses ssh-agent

In the app section:

  • name - A unique name, with no spaces.
  • path - Path to the oreact app, relative to the config. If your config is in app/.deploy, the path would be ../.

Setup Server

When running the Oreact Up commands in Command Prompt, you should use orup.cmd instead of orup.

Run one command, and orup will install all of it's dependencies on the server and prepare it for your first deploy:

orup setup

If you want to see what the tasks are doing, you can add the --verbose flag. You should run orup setup anytime after changing your config. It is safe to run the command as many times as you need.

It is safe to run orup setup multiple times if needed. After making changes to custom SSL certificates, MongoDB, or servers in your config, you need to run orup setup for the changes to take effect.

Deploy

The deploy process:

  1. Builds your app, using oreact build
  2. Uploads the app bundle, the start script, and the environment variables to your servers
  3. Runs the start script
  4. Verifies that the app sucessfully started

Run

orup deploy

If it failed due to a network error while uploading the bundle, you can run orup deploy --cached-build. It will then skip step 1 of the deploy process and use the bundle from the last time it was built.

Other Utility Commands

  • orup reconfig - reconfigures app with new environment variables and it updates the start script. This is also the last step of orup deploy.
  • orup stop - stop the app
  • orup start - start the app
  • orup restart - restart the app
  • orup logs [-f --tail=50] - view the app’s logs. Supports all the flags from docker logs.

Changing the App’s Name

It’s okay to change app.name. But before you do so, you need to stop the project with older appName. Also, if you use the built-in MongoDB, orup will create a new database with the new name so you will need to migrate the data.

  1. Run orup stop
  2. Change the app name in the config orup.js
  3. Run orup setup and orup deploy

Custom configuration and settings files

You can keep multiple configuration file in the same directory and pass them to orup using the command parameters --config. For example, to use a file orup-staging.js and staging-settings.json, add the parameters like this:

orup deploy --config=orup-staging.js