openshift

This commit is contained in:
theory 2014-04-01 00:51:51 -06:00
parent dd127f48f6
commit 940c630693
3 changed files with 0 additions and 333 deletions

View File

@ -1,3 +0,0 @@
The OpenShift `nodejs` cartridge documentation can be found at:
https://github.com/openshift/origin-server/tree/master/cartridges/openshift-origin-cartridge-nodejs/README.md

View File

@ -1,171 +0,0 @@
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'publish', '.' ]
2 info using npm@1.4.4
3 info using node@v0.10.26
4 verbose publish [ '.' ]
5 verbose cache add [ '.', null ]
6 verbose cache add name=undefined spec="." args=[".",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,
7 verbose parsed url host: null,
7 verbose parsed url port: null,
7 verbose parsed url hostname: null,
7 verbose parsed url hash: null,
7 verbose parsed url search: null,
7 verbose parsed url query: null,
7 verbose parsed url pathname: '.',
7 verbose parsed url path: '.',
7 verbose parsed url href: '.' }
8 silly lockFile 3a52ce78- .
9 verbose lock . /home/theory/.npm/3a52ce78-.lock
10 verbose tar pack [ '/home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/tmp.tgz',
10 verbose tar pack '.' ]
11 verbose tarball /home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/tmp.tgz
12 verbose folder .
13 info prepublish gun@0.0.1-k
14 silly lockFile 1f1177db-tar tar://.
15 verbose lock tar://. /home/theory/.npm/1f1177db-tar.lock
16 silly lockFile a5ec9361-46502-0-2280025277286768-tmp-tgz tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/tmp.tgz
17 verbose lock tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/tmp.tgz /home/theory/.npm/a5ec9361-46502-0-2280025277286768-tmp-tgz.lock
18 silly lockFile 1f1177db-tar tar://.
19 silly lockFile 1f1177db-tar tar://.
20 silly lockFile a5ec9361-46502-0-2280025277286768-tmp-tgz tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/tmp.tgz
21 silly lockFile a5ec9361-46502-0-2280025277286768-tmp-tgz tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/tmp.tgz
22 verbose tar unpack /home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/tmp.tgz
23 silly lockFile fca2b8b4-46502-0-2280025277286768-package tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/package
24 verbose lock tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/package /home/theory/.npm/fca2b8b4-46502-0-2280025277286768-package.lock
25 silly lockFile a5ec9361-46502-0-2280025277286768-tmp-tgz tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/tmp.tgz
26 verbose lock tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/tmp.tgz /home/theory/.npm/a5ec9361-46502-0-2280025277286768-tmp-tgz.lock
27 silly gunzTarPerm modes [ '755', '644' ]
28 silly gunzTarPerm extractEntry package.json
29 silly gunzTarPerm modified mode [ 'package.json', 511, 493 ]
30 silly gunzTarPerm extractEntry gun.js
31 silly gunzTarPerm modified mode [ 'gun.js', 511, 493 ]
32 silly gunzTarPerm extractEntry init.js
33 silly gunzTarPerm modified mode [ 'init.js', 511, 493 ]
34 silly gunzTarPerm extractEntry shot.js
35 silly gunzTarPerm modified mode [ 'shot.js', 511, 493 ]
36 silly gunzTarPerm extractEntry shots.js
37 silly gunzTarPerm modified mode [ 'shots.js', 511, 493 ]
38 silly gunzTarPerm extractEntry Procfile
39 silly gunzTarPerm modified mode [ 'Procfile', 511, 493 ]
40 silly gunzTarPerm extractEntry deps/theory.js
41 silly gunzTarPerm modified mode [ 'deps/theory.js', 511, 493 ]
42 silly gunzTarPerm extractEntry gate/amplify.store.js
43 silly gunzTarPerm modified mode [ 'gate/amplify.store.js', 511, 493 ]
44 silly gunzTarPerm extractEntry gate/redis.js
45 silly gunzTarPerm modified mode [ 'gate/redis.js', 511, 493 ]
46 silly gunzTarPerm extractEntry gate/s3.js
47 silly gunzTarPerm modified mode [ 'gate/s3.js', 511, 493 ]
48 silly gunzTarPerm extractEntry gate/sock.js
49 silly gunzTarPerm modified mode [ 'gate/sock.js', 511, 493 ]
50 silly gunzTarPerm extractEntry test/expect.js
51 silly gunzTarPerm modified mode [ 'test/expect.js', 511, 493 ]
52 silly gunzTarPerm extractEntry test/mocha.js
53 silly gunzTarPerm modified mode [ 'test/mocha.js', 511, 493 ]
54 silly gunzTarPerm extractEntry test/server.js
55 silly gunzTarPerm modified mode [ 'test/server.js', 511, 493 ]
56 silly gunzTarPerm extractEntry test/tests.js
57 silly gunzTarPerm modified mode [ 'test/tests.js', 511, 493 ]
58 silly gunzTarPerm extractEntry test/mocha.css
59 silly gunzTarPerm modified mode [ 'test/mocha.css', 511, 493 ]
60 silly gunzTarPerm extractEntry test/mocha.html
61 silly gunzTarPerm modified mode [ 'test/mocha.html', 511, 493 ]
62 silly lockFile fca2b8b4-46502-0-2280025277286768-package tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/package
63 silly lockFile fca2b8b4-46502-0-2280025277286768-package tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/package
64 silly lockFile a5ec9361-46502-0-2280025277286768-tmp-tgz tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/tmp.tgz
65 silly lockFile a5ec9361-46502-0-2280025277286768-tmp-tgz tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/tmp.tgz
66 verbose tar pack [ '/home/theory/.npm/gun/0.0.1-k/package.tgz',
66 verbose tar pack '/home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/package' ]
67 verbose tarball /home/theory/.npm/gun/0.0.1-k/package.tgz
68 verbose folder /home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/package
69 silly lockFile fca2b8b4-46502-0-2280025277286768-package tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/package
70 verbose lock tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/package /home/theory/.npm/fca2b8b4-46502-0-2280025277286768-package.lock
71 silly lockFile e7f11766-eory-npm-gun-0-0-1-k-package-tgz tar:///home/theory/.npm/gun/0.0.1-k/package.tgz
72 verbose lock tar:///home/theory/.npm/gun/0.0.1-k/package.tgz /home/theory/.npm/e7f11766-eory-npm-gun-0-0-1-k-package-tgz.lock
73 silly lockFile fca2b8b4-46502-0-2280025277286768-package tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/package
74 silly lockFile fca2b8b4-46502-0-2280025277286768-package tar:///home/theory/tmp/npm-4937-817RecY4/1396252746502-0.2280025277286768/package
75 silly lockFile e7f11766-eory-npm-gun-0-0-1-k-package-tgz tar:///home/theory/.npm/gun/0.0.1-k/package.tgz
76 silly lockFile e7f11766-eory-npm-gun-0-0-1-k-package-tgz tar:///home/theory/.npm/gun/0.0.1-k/package.tgz
77 silly lockFile 9f67f711-e-theory-npm-gun-0-0-1-k-package /home/theory/.npm/gun/0.0.1-k/package
78 verbose lock /home/theory/.npm/gun/0.0.1-k/package /home/theory/.npm/9f67f711-e-theory-npm-gun-0-0-1-k-package.lock
79 silly lockFile 9f67f711-e-theory-npm-gun-0-0-1-k-package /home/theory/.npm/gun/0.0.1-k/package
80 silly lockFile 9f67f711-e-theory-npm-gun-0-0-1-k-package /home/theory/.npm/gun/0.0.1-k/package
81 verbose tar unpack /home/theory/.npm/gun/0.0.1-k/package.tgz
82 silly lockFile ee146ba5-e-theory-npm-gun-0-0-1-k-package tar:///home/theory/.npm/gun/0.0.1-k/package
83 verbose lock tar:///home/theory/.npm/gun/0.0.1-k/package /home/theory/.npm/ee146ba5-e-theory-npm-gun-0-0-1-k-package.lock
84 silly lockFile e7f11766-eory-npm-gun-0-0-1-k-package-tgz tar:///home/theory/.npm/gun/0.0.1-k/package.tgz
85 verbose lock tar:///home/theory/.npm/gun/0.0.1-k/package.tgz /home/theory/.npm/e7f11766-eory-npm-gun-0-0-1-k-package-tgz.lock
86 silly gunzTarPerm modes [ '755', '644' ]
87 silly gunzTarPerm extractEntry package.json
88 silly gunzTarPerm extractEntry gun.js
89 silly gunzTarPerm extractEntry init.js
90 silly gunzTarPerm extractEntry shot.js
91 silly gunzTarPerm extractEntry shots.js
92 silly gunzTarPerm extractEntry Procfile
93 silly gunzTarPerm extractEntry deps/theory.js
94 silly gunzTarPerm extractEntry gate/amplify.store.js
95 silly gunzTarPerm extractEntry gate/redis.js
96 silly gunzTarPerm extractEntry gate/s3.js
97 silly gunzTarPerm extractEntry gate/sock.js
98 silly gunzTarPerm extractEntry test/expect.js
99 silly gunzTarPerm extractEntry test/mocha.js
100 silly gunzTarPerm extractEntry test/server.js
101 silly gunzTarPerm extractEntry test/tests.js
102 silly gunzTarPerm extractEntry test/mocha.css
103 silly gunzTarPerm extractEntry test/mocha.html
104 silly lockFile ee146ba5-e-theory-npm-gun-0-0-1-k-package tar:///home/theory/.npm/gun/0.0.1-k/package
105 silly lockFile ee146ba5-e-theory-npm-gun-0-0-1-k-package tar:///home/theory/.npm/gun/0.0.1-k/package
106 silly lockFile e7f11766-eory-npm-gun-0-0-1-k-package-tgz tar:///home/theory/.npm/gun/0.0.1-k/package.tgz
107 silly lockFile e7f11766-eory-npm-gun-0-0-1-k-package-tgz tar:///home/theory/.npm/gun/0.0.1-k/package.tgz
108 verbose chmod /home/theory/.npm/gun/0.0.1-k/package.tgz 644
109 verbose chown /home/theory/.npm/gun/0.0.1-k/package.tgz [ 1000, 1000 ]
110 silly lockFile 3a52ce78- .
111 silly lockFile 3a52ce78- .
112 silly publish { name: 'gun',
112 silly publish version: '0.0.1-k',
112 silly publish author: { name: 'Mark Nadal' },
112 silly publish description: 'Graph engine.',
112 silly publish engines: { node: '~>0.6.6' },
112 silly publish dependencies:
112 silly publish { mime: '~>1.2.11',
112 silly publish theory: '~>0.2.6',
112 silly publish coalesce: '~>0.1.9bk',
112 silly publish 'aws-sdk': '~>2.0.0',
112 silly publish fakeredis: '~>0.1.3',
112 silly publish redis: '~>0.10.1',
112 silly publish hiredis: '' },
112 silly publish main: 'shots',
112 silly publish readme: 'ERROR: No README data found!',
112 silly publish _id: 'gun@0.0.1-k',
112 silly publish dist: { shasum: 'd7257ae0e2cb51b7d1427a28dfd326d623fe4876' },
112 silly publish _from: '.' }
113 verbose url raw gun
114 verbose url resolving [ 'https://registry.npmjs.org/', './gun' ]
115 verbose url resolved https://registry.npmjs.org/gun
116 info trying registry request attempt 1 at 01:59:08
117 http PUT https://registry.npmjs.org/gun
118 http 403 https://registry.npmjs.org/gun
119 error publish Failed PUT 403
120 error Error: forbidden cannot modify pre-existing version: 0.0.1-k
120 error old={"name":"gun","version":"0.0.1-k","author":{"name":"Mark Nadal"},"description":"Graph engine.","engines":{"node":"~>0.6.6"},"dependencies":{"mime":"~>1.2.11","theory":"~>0.2.6","coalesce":"~>0.1.9bj","aws-sdk":"~>2.0.0","fakeredis":"~>0.1.3","redis":"~>0.10.1","hiredis":""},"main":"shots","_id":"gun@0.0.1-k","dist":{"shasum":"a8a85e48067681252e9b15f35fae160d570f651a","tarball":"http://registry.npmjs.org/gun/-/gun-0.0.1-k.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"amark","email":"mark@accelsor.com"},"maintainers":[{"name":"amark","email":"mark@accelsor.com"}]}
120 error new={"name":"gun","version":"0.0.1-k","author":{"name":"Mark Nadal"},"description":"Graph engine.","engines":{"node":"~>0.6.6"},"dependencies":{"mime":"~>1.2.11","theory":"~>0.2.6","coalesce":"~>0.1.9bk","aws-sdk":"~>2.0.0","fakeredis":"~>0.1.3","redis":"~>0.10.1","hiredis":""},"main":"shots","readme":"ERROR: No README data found!","_id":"gun@0.0.1-k","dist":{"shasum":"d7257ae0e2cb51b7d1427a28dfd326d623fe4876","tarball":"http://registry.npmjs.org/gun/-/gun-0.0.1-k.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"amark","email":"mark@accelsor.com"},"maintainers":[{"name":"amark","email":"mark@accelsor.com"}]}: gun
120 error at RegClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:237:14)
120 error at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:123:22)
120 error at Request.EventEmitter.emit (events.js:98:17)
120 error at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:893:14)
120 error at Request.EventEmitter.emit (events.js:117:20)
120 error at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:844:12)
120 error at IncomingMessage.EventEmitter.emit (events.js:117:20)
120 error at _stream_readable.js:920:16
120 error at process._tickCallback (node.js:415:13)
121 error If you need help, you may report this *entire* log,
121 error including the npm and node versions, at:
121 error <http://github.com/npm/npm/issues>
122 error System Linux 3.2.0-29-generic
123 error command "node" "/usr/local/bin/npm" "publish" "."
124 error cwd /home/theory/dropbox/Public/gun
125 error node -v v0.10.26
126 error npm -v 1.4.4
127 verbose exit [ 1, true ]

159
server.js
View File

@ -1,159 +0,0 @@
#!/bin/env node
// OpenShift sample Node application
var express = require('express');
var fs = require('fs');
/**
* Define the sample application.
*/
var SampleApp = function() {
// Scope.
var self = this;
/* ================================================================ */
/* Helper functions. */
/* ================================================================ */
/**
* Set up server IP address and port # using env variables/defaults.
*/
self.setupVariables = function() {
// Set the environment variables we need.
self.ipaddress = process.env.OPENSHIFT_NODEJS_IP;
self.port = process.env.OPENSHIFT_NODEJS_PORT || 8080;
if (typeof self.ipaddress === "undefined") {
// Log errors on OpenShift but continue w/ 127.0.0.1 - this
// allows us to run/test the app locally.
console.warn('No OPENSHIFT_NODEJS_IP var, using 127.0.0.1');
self.ipaddress = "127.0.0.1";
};
};
/**
* Populate the cache.
*/
self.populateCache = function() {
if (typeof self.zcache === "undefined") {
self.zcache = { 'index.html': '' };
}
// Local cache for static content.
self.zcache['index.html'] = fs.readFileSync('./index.html');
};
/**
* Retrieve entry (content) from cache.
* @param {string} key Key identifying content to retrieve from cache.
*/
self.cache_get = function(key) { return self.zcache[key]; };
/**
* terminator === the termination handler
* Terminate server on receipt of the specified signal.
* @param {string} sig Signal to terminate on.
*/
self.terminator = function(sig){
if (typeof sig === "string") {
console.log('%s: Received %s - terminating sample app ...',
Date(Date.now()), sig);
process.exit(1);
}
console.log('%s: Node server stopped.', Date(Date.now()) );
};
/**
* Setup termination handlers (for exit and a list of signals).
*/
self.setupTerminationHandlers = function(){
// Process on exit and signals.
process.on('exit', function() { self.terminator(); });
// Removed 'SIGPIPE' from the list - bugz 852598.
['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT',
'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGTERM'
].forEach(function(element, index, array) {
process.on(element, function() { self.terminator(element); });
});
};
/* ================================================================ */
/* App server functions (main app logic here). */
/* ================================================================ */
/**
* Create the routing table entries + handlers for the application.
*/
self.createRoutes = function() {
self.routes = { };
self.routes['/asciimo'] = function(req, res) {
var link = "http://i.imgur.com/kmbjB.png";
res.send("<html><body><img src='" + link + "'></body></html>");
};
self.routes['/'] = function(req, res) {
res.setHeader('Content-Type', 'text/html');
res.send(self.cache_get('index.html') );
};
};
/**
* Initialize the server (express) and create the routes and register
* the handlers.
*/
self.initializeServer = function() {
self.createRoutes();
self.app = express.createServer();
// Add handlers for the app (from the routes).
for (var r in self.routes) {
self.app.get(r, self.routes[r]);
}
};
/**
* Initializes the sample application.
*/
self.initialize = function() {
self.setupVariables();
self.populateCache();
self.setupTerminationHandlers();
// Create the express server and routes.
self.initializeServer();
};
/**
* Start the server (starts up the sample application).
*/
self.start = function() {
// Start the app on the specific interface (and port).
self.app.listen(self.port, self.ipaddress, function() {
console.log('%s: Node server started on %s:%d ...',
Date(Date.now() ), self.ipaddress, self.port);
});
};
}; /* Sample Application. */
/**
* main(): Main code.
*/
var zapp = new SampleApp();
zapp.initialize();
zapp.start();