MCPcopy Index your code
hub / github.com/Unitech/pm2 / handleExit

Function handleExit

lib/API/Containerizer.js:139–169  ·  view source on GitHub ↗
(CLI, opts, mode)

Source from the content-addressed store, hash-verified

137}
138
139function handleExit(CLI, opts, mode) {
140 process.on('SIGINT', function() {
141 CLI.disconnect();
142
143 if (mode != 'distribution')
144 return false;
145
146 exec('docker ps -lq', function(err, stdout, stderr) {
147 if (err) {
148 console.error(err);
149 }
150 require('../../modules/vizion').analyze({folder : process.cwd()}, function recur_path(err, meta){
151 if (!err && meta.revision) {
152 var commit_id = util.format('#%s(%s) %s',
153 meta.branch,
154 meta.revision.slice(0, 5),
155 meta.comment);
156
157 console.log(chalk.bold.magenta('$ docker commit -m "%s" %s %s'),
158 commit_id,
159 stdout.replace('\n', ''),
160 opts.imageName);
161 }
162 else
163 console.log(chalk.bold.magenta('$ docker commit %s %s'), stdout.replace('\n', ''), opts.imageName);
164
165 console.log(chalk.bold.magenta('$ docker push %s'), opts.imageName);
166 });
167 });
168 });
169}
170
171module.exports = function(CLI) {
172 CLI.prototype.generateDockerfile = function(script, opts) {

Callers 1

Containerizer.jsFile · 0.85

Calls 5

cwdMethod · 0.80
sliceMethod · 0.80
execFunction · 0.70
onMethod · 0.65
disconnectMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…