Skip to content

Latest commit

 

History

History
59 lines (34 loc) · 2.06 KB

OpenShift_Deployment.md

File metadata and controls

59 lines (34 loc) · 2.06 KB

#OpenShift Deployment Guide

IMPORTANT: First of all, you MUST check and set the host settings in the config file ./src/config You should see this:

ws: {
      // replace with your production host
      host: 'http://hapi-reactstarterkit.rhcloud.com', //--- Replace this with your OpenShift host address
      port: 8000
    }
  1. Click on "Add Application..." on your Openshift console.

  2. On the next page, go to the bottom where it says "Code Anything" and paste the following URL

    http://cartreflect-claytondev.rhcloud.com/github/dindaleon/openshift-cartridge-nodejs

Step 2

Click "Next" This will allow you to run the latest Node version.

  1. On the page "Step 2: Configure application" fill out your app name and paste the Hapi React Starter Kit URL in the "Source Code" field

    https://github.com/Dindaleon/hapi-react-starter-kit.git

Step 3

Click on "Create Application"

  1. Once the application has been created, you should see something like this:

Step 4

Clone your newly created app inside any folder you want.

  1. Setting enviroment variables. We have two set two variables, one for production and the other specifying a cache folder for babel. From command prompt, we set the variables:

    $ rhc env set <Variable>=<Value> <Variable2>=<Value2> -a App_Name

    $ rhc env set NODE_ENV=production -a App_Name

    $ rhc env set BABEL_CACHE_PATH=$OPENSHIFT_DATA_DIR -a App_Name

  2. Install Redis cartridge:

    $ rhc add-cartridge http://cartreflect-claytondev.rhcloud.com/reflect?github=Dindaleon/openshift-redis-cart-1 -a App_Name

  3. SSH into your app and install the following dev dependencies required for building the app:

npm install ---save-dev rimraf webpack extract-text-webpack-plugin stats-webpack-plugin strip-loader

then

npm run build

  1. Restart your app