(CLI, opts, mode)
| 137 | } |
| 138 | |
| 139 | function 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 | |
| 171 | module.exports = function(CLI) { |
| 172 | CLI.prototype.generateDockerfile = function(script, opts) { |
no test coverage detected
searching dependent graphs…