2
I did everything that feels right. I changed the local variables to process.env
, but when I commit and send I get this output:
Pushing to ssh://[email protected]/~/git/pontotec.git/
remote: Stopping NodeJS cartridge
remote: Thu Feb 11 2016 23:27:28 GMT-0500 (EST): Stopping application 'pontotec' ...
remote: Thu Feb 11 2016 23:27:29 GMT-0500 (EST): Stopped Node application 'pontotec'
remote: Stopping MongoDB cartridge
remote: Saving away previously installed Node modules
remote: Building git ref 'master', commit e7b5753
remote: Building NodeJS cartridge
remote: npm info it worked if it ends with ok
remote: npm info using [email protected]
remote: npm info using [email protected]
remote: npm info preinstall [email protected]
remote: npm WARN package.json [email protected] No description
remote: npm info trying registry request attempt 1 at 23:27:48
remote: npm http GET https://registry.npmjs.org/prerender-node
remote: npm info trying registry request attempt 1 at 23:27:48
remote: npm http GET https://registry.npmjs.org/sugar
remote: npm info trying registry request attempt 1 at 23:27:48
remote: npm http GET https://registry.npmjs.org/grunt
remote: npm info trying registry request attempt 1 at 23:27:48
remote: npm http GET https://registry.npmjs.org/bwip-js
[.....................blablabla.......................]
remote: ├── [email protected]
remote: ├── [email protected]
remote: ├── [email protected]
remote: ├── [email protected]
remote: ├── [email protected]
remote: ├── [email protected]
remote: ├── [email protected]
remote: ├── [email protected]
remote: ├── [email protected]
remote: ├── [email protected] ([email protected])
remote: ├── [email protected] ([email protected], [email protected])
remote: ├── [email protected] ([email protected], [email protected])
remote: ├── [email protected]
remote: ├── [email protected]
remote: ├── [email protected]
remote: ├── [email protected]
remote: ├── [email protected] ([email protected], [email protected])
remote: ├── [email protected] ([email protected], [email protected])
remote: └── [email protected] ([email protected], [email protected], [email protected])
remote:
remote: [email protected] node_modules/mongodb
remote: ├── [email protected]
remote: ├── [email protected] ([email protected], [email protected], [email protected], [email protected])
remote: └── [email protected] ([email protected], [email protected])
remote:
remote: [email protected] node_modules/bwip-js
remote: npm info ok
remote: Preparing build for deployment
remote: Deployment id is a123e49b
remote: Activating deployment
remote: Starting MongoDB cartridge
remote: Waiting for mongo to start...
remote: Starting NodeJS cartridge
remote: Thu Feb 11 2016 23:28:33 GMT-0500 (EST): Starting application 'pontotec' ...
remote: Waiting for application port (8080) become available ...
remote: Application 'pontotec' failed to start (port 8080 not available)
remote: -------------------------
remote: Git Post-Receive Result: failure
remote: Activation status: failure
remote: Activation failed for the following gears:
remote: 56bc23fd0c1e667ea00000e3 (Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/56bc23fd0c1e667ea00000e3/nodejs
remote: #<IO:0x000000020df3c0>
remote: #<IO:0x000000020df348>
remote: )
remote: Deployment completed with status: failure
remote: postreceive failed
To ssh://[email protected]/~/git/pontotec.git/
= [up to date] v0.3.0 -> v0.3.0
= [up to date] v0.3.1 -> v0.3.1
= [up to date] v0.3.2 -> v0.3.2
= [up to date] v0.3.3 -> v0.3.3
= [up to date] v0.4.0 -> v0.4.0
= [up to date] v0.4.0_openshift -> v0.4.0_openshift
a662d84..e7b5753 master -> master
updating local tracking ref 'refs/remotes/origin/master'
Completed successfully
It says "Completed successfully", but when I try to access my remote application I get error 503.
Man server.js
var express = require('express');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var path = require('path');
var app = express();
app.set("nodeIP", process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1")
app.set("nodePORT", process.env.OPENSHIFT_NODEJS_PORT || "3000")
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser({limit: '50mb'}));
var routerOs = express.Router();
// puts
routerOs.post('/puts/putServico', require('./routes/os/puts/putServico.js')); // ok
// deletes
routerOs.post('/deletes/deleteServico', require('./routes/os/deletes/deleteServico.js')) // ok
// gets
routerOs.get('/gets/getServico', require('./routes/os/gets/getServico.js'));
routerOs.get('/gets/getServicosList', require('./routes/os/gets/getServicosList.js'))
routerOs.get('/gets/verifyClientIncidence', require('./routes/os/gets/verifyClientIncidence.js'))
// updates
routerOs.post('/updates/updateServico', require('./routes/os/updates/updateServico.js')); // ok
app.use('/os', routerOs);
var routerOthers = express.Router();
routerOthers.get('/gets/getBarCodeImg', require('./routes/others/gets/getBarCodeImg.js'))
//routerStaff.post('/sendServicoNotification', require('./server/others/posts/sendServicoNotification.js'))
app.use('/others', routerOthers)
app.listen(app.get("nodePORT"), function(err) {
console.log('server ligado');
});