Deploying a SailsJS app to Openshift
git push
remote: ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
remote: ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
remote: ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
remote: ├── [email protected]
remote: ├── [email protected] ([email protected], [email protected], [email protected])
remote: ├── [email protected] ([email protected], [email protected], [email protected])
remote: ├── [email protected] ([email protected], [email protected])
remote: ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
remote: └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
remote: npm info ok
remote: Preparing build for deployment
remote: Deployment id is bf24b845
remote: Activating deployment
remote: Loading "bower_task.js" tasks...ERROR
remote: >> Error: EACCES, permission denied '/var/lib/openshift/574f48527628e1bce8000273/.local'
remote: Warning: Task "bower:install" not found. Use --force to continue.
remote:
remote: Aborted due to warnings.
remote: -------------------------
remote: Git Post-Receive Result: failure
remote: Activation status: failure
remote: Activation failed for the following gears:
remote: 574f48527628e1bce8000273 (Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/574f48527628e1bce8000273/nodejs
remote: #<IO:0x0000000069e290>
remote: #<IO:0x0000000069e218>
remote: )
remote: Deployment completed with status: failure
remote: postreceive failed
To ssh://[email protected]/~/git/webrtc.git
df77e95..dc8b186 HEAD -> master
Any ideas how to fix this?
Add action hooks. Suggested in this thread
cd .openshift/action_hooks
I have added the code to my existing action hook pre_start_nodejs
#!/bin/bash
export NODE_ENV=production
if [ ! -d $OPENSHIFT_NODEJS_DIR/node_modules/bower ]
then
cd $OPENSHIFT_NODEJS_DIR
npm install bower
fi
cd $OPENSHIFT_HOMEDIR/app-root/repo
HOME=$OPENSHIFT_REPO_DIR bower install
cd $OPENSHIFT_HOMEDIR
if [ -f "${OPENSHIFT_REPO_DIR}"/Gruntfile.js ]; then
(cd "${OPENSHIFT_REPO_DIR}"; node_modules/grunt-cli/bin/grunt prod)
fi
This helped me to move forward, but I am still stuck with Error: EACCES, permission denied
to .local
In package.json
, added
"build": "HOME=$HOME/app-root/runtime bower install --config.interactive=false && grunt build",
but didn't help either
1 - rhc ssh proyectname
2 - cd nodejs
3 - npm install bower
4 - cd ..
5 - export HOME=$HOME/app-root/runtime/repo
6 - cd app-root/repo
7 - bower install
didn't resolved
I am out of ideas.
I understand that bower
doesn't have access to .local
, but don't know how to resolve
This helped cf. Source
EACCESS, permission denied '/var/lib/openshift/[instance-id]/.local'
The error message means that you don't have the permission to write the home folder.
Added these in package.json
"scripts": {
"postinstall": "export HOME=/var/lib/openshift/574fce8000273/app-root/runtime/repo; ./node_modules/bower/bin/bower install", <========
"debug": "node debug app.js",
"start": "node app.js"
},
and Bower completed installation
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments