1

Current version of sails.js is v0.11. To create application with this version of sails.js in openshift needs cartidge .

I found an older cartidge https://github.com/markschad/openshift-origin-cartridge-nodejs-sails.

Can anyone give an upgraded cartridge ?

swaraj
  • 109
  • 2
  • 13

1 Answers1

0

recently sails have documented the way to host in openshift http://sailsjs.org/documentation/concepts/deployment/hosting as below

To deploy to OpenShift, you'll need to make some minor modifications to your configuration: Open up config/local.js in your app folder. In here, you'll need to add the following lines.

port: process.env.OPENSHIFT_NODEJS_PORT,
host: process.env.OPENSHIFT_NODEJS_IP,

You will also need to install grunt-cli with

npm i --save grunt-cli.

After doing that, create the file
.openshift/action_hooks/pre_start_nodejs with the following contents. (source)

#!/bin/bash
export NODE_ENV=production

 if [ -f "${OPENSHIFT_REPO_DIR}"/Gruntfile.js ]; then
(cd "${OPENSHIFT_REPO_DIR}"; node_modules/grunt-cli/bin/grunt prod)
 fi

Then create the file /supervisor_opts with the following contents. This tells OpenShift's supervisor to ignore Sails' .tmp directory for the hot reload functionality. (source)

-i .tmp

You can now git add . && git commit -a -m "your message" && git push to deploy to OpenShift.

swaraj
  • 109
  • 2
  • 13