зеркало из https://github.com/docker/kitematic.git
Fixing install bugs
This commit is contained in:
Родитель
bdf0949190
Коммит
740efe16d1
40
index.js
40
index.js
|
@ -42,25 +42,27 @@ var start = function (callback) {
|
||||||
freeport(function (err, webPort) {
|
freeport(function (err, webPort) {
|
||||||
freeport(function(err, mongoPort) {
|
freeport(function(err, mongoPort) {
|
||||||
child_process.exec('kill $(ps aux -e | grep \'DB_PURPOSE=KITEMATIC\' | awk \'{print $2}\')', function (error, stdout, stderr) {
|
child_process.exec('kill $(ps aux -e | grep \'DB_PURPOSE=KITEMATIC\' | awk \'{print $2}\')', function (error, stdout, stderr) {
|
||||||
var command = 'DB_PURPOSE=KITEMATIC ' + process.cwd() + '/resources/mongod --bind_ip 127.0.0.1 --dbpath ' + dataPath.replace(' ', '\\ ') + ' --port ' + mongoPort + ' --unixSocketPrefix ' + dataPath.replace(' ', '\\ ');
|
var mongoChild = child_process.spawn(path.join(process.cwd(), 'resources', 'mongod'), ['--bind_ip', '127.0.0.1', '--dbpath', dataPath, '--port', mongoPort, '--unixSocketPrefix', dataPath], {
|
||||||
console.log(command);
|
env: {
|
||||||
var mongoChild = child_process.exec(command, function (error, stdout, stderr) {
|
DB_PURPOSE: 'KITEMATIC'
|
||||||
console.log(error);
|
}
|
||||||
console.log(stdout);
|
});
|
||||||
console.log(stderr);
|
mongoChild.stdout.setEncoding('utf8');
|
||||||
|
mongoChild.stdout.on('data', function (data) {
|
||||||
|
if (data.indexOf('waiting for connections on port ' + mongoPort)) {
|
||||||
|
process.stdout.write(process.cwd());
|
||||||
|
var rootUrl = 'http://localhost:' + webPort;
|
||||||
|
var user_env = process.env;
|
||||||
|
process.env.ROOT_URL = rootUrl;
|
||||||
|
process.env.PORT = webPort;
|
||||||
|
process.env.BIND_IP = '127.0.0.1';
|
||||||
|
process.env.DB_PATH = dataPath;
|
||||||
|
process.env.MONGO_URL = 'mongodb://localhost:' + mongoPort + '/meteor';
|
||||||
|
process.argv.splice(2, 0, 'program.json');
|
||||||
|
require('./bundle/main.js');
|
||||||
|
callback(process.env.ROOT_URL);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
process.stdout.write(process.cwd());
|
|
||||||
var rootUrl = 'http://localhost:' + webPort;
|
|
||||||
var user_env = process.env;
|
|
||||||
process.env.ROOT_URL = rootUrl;
|
|
||||||
process.env.PORT = webPort;
|
|
||||||
process.env.BIND_IP = '127.0.0.1';
|
|
||||||
process.env.DB_PATH = dataPath;
|
|
||||||
process.env.MONGO_URL = 'mongodb://localhost:' + mongoPort + '/meteor';
|
|
||||||
process.argv.splice(2, 0, 'program.json');
|
|
||||||
require('./bundle/main.js');
|
|
||||||
callback(process.env.ROOT_URL);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -78,7 +80,7 @@ start(function (url) {
|
||||||
mainWindow.on('loaded', function () {
|
mainWindow.on('loaded', function () {
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
});
|
});
|
||||||
}, 600);
|
}, 1000);
|
||||||
mainWindow.on('close', function (type) {
|
mainWindow.on('close', function (type) {
|
||||||
this.hide();
|
this.hide();
|
||||||
if (type === 'quit') {
|
if (type === 'quit') {
|
||||||
|
|
|
@ -185,7 +185,6 @@ startBoot2Docker = function (callback) {
|
||||||
if (installed) {
|
if (installed) {
|
||||||
boot2DockerVMExists(function (err, exists) {
|
boot2DockerVMExists(function (err, exists) {
|
||||||
if (exists) {
|
if (exists) {
|
||||||
console.log('Running up (server)');
|
|
||||||
boot2dockerexec('up', function (err, stdout) {
|
boot2dockerexec('up', function (err, stdout) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
|
|
|
@ -359,23 +359,25 @@ reloadDefaultContainers = function (callback) {
|
||||||
var defaultNames = defaultContainerOptions().map(function (container) {
|
var defaultNames = defaultContainerOptions().map(function (container) {
|
||||||
return container.name;
|
return container.name;
|
||||||
});
|
});
|
||||||
console.log('Removing old Kitematic default containers.');
|
|
||||||
killAndRemoveContainers(defaultNames, function (err) {
|
var results;
|
||||||
console.log('Removed old Kitematic default containers.');
|
async.until(function () {
|
||||||
if (err) {
|
return !!results;
|
||||||
console.log('Removing old Kitematic default containers ERROR.');
|
}, function (callback) {
|
||||||
callback(err);
|
docker.listContainers(function (err, containers) {
|
||||||
return;
|
results = containers;
|
||||||
}
|
callback();
|
||||||
console.log('Removing old Kitematic default images.');
|
});
|
||||||
removeImages(defaultNames, function () {
|
}, function (err) {
|
||||||
console.log('Removed old Kitematic default images.');
|
console.log(err);
|
||||||
// if (err) {
|
console.log('Removing old Kitematic default containers.');
|
||||||
// console.log('Removing old Kitematic default images ERROR.');
|
killAndRemoveContainers(defaultNames, function (err) {
|
||||||
// console.log(err);
|
console.log('Removed old Kitematic default containers.');
|
||||||
// callback(err);
|
if (err) {
|
||||||
// return;
|
console.log('Removing old Kitematic default containers ERROR.');
|
||||||
// }
|
callback(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log('Loading new Kitematic default images.');
|
console.log('Loading new Kitematic default images.');
|
||||||
docker.loadImage(path.join(getBinDir(), 'base-images.tar.gz'), {}, function (err) {
|
docker.loadImage(path.join(getBinDir(), 'base-images.tar.gz'), {}, function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
@ -53,6 +53,7 @@ chmod +x dist/osx/Kitematic.app/Contents/Resources/app.nw/resources/terminal
|
||||||
chmod +x dist/osx/Kitematic.app/Contents/Resources/app.nw/resources/unison
|
chmod +x dist/osx/Kitematic.app/Contents/Resources/app.nw/resources/unison
|
||||||
|
|
||||||
if [ -f $DIR/sign.sh ]; then
|
if [ -f $DIR/sign.sh ]; then
|
||||||
|
cecho "-----> Signing app file...." $blue
|
||||||
$DIR/sign.sh $BASE/dist/osx/Kitematic.app
|
$DIR/sign.sh $BASE/dist/osx/Kitematic.app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче