mirror of https://github.com/docker/docs.git
Adding update process
This commit is contained in:
parent
21f4ca0565
commit
dc1cb0caec
5
index.js
5
index.js
|
@ -51,7 +51,12 @@ var start = function (callback) {
|
|||
});
|
||||
var started = false;
|
||||
mongoChild.stdout.setEncoding('utf8');
|
||||
mongoChild.stderr.setEncoding('utf8');
|
||||
mongoChild.stderr.on('data', function (data) {
|
||||
console.log(data);
|
||||
});
|
||||
mongoChild.stdout.on('data', function (data) {
|
||||
console.log(data);
|
||||
if (data.indexOf('waiting for connections on port ' + mongoPort)) {
|
||||
if (!started) {
|
||||
started = true;
|
||||
|
|
|
@ -2,6 +2,12 @@ var async = require('async');
|
|||
|
||||
Installer = {};
|
||||
|
||||
Installer.CURRENT_VERSION = '0.0.2';
|
||||
|
||||
Installer.isUpToDate = function () {
|
||||
return !!Installs.findOne({version: Installer.CURRENT_VERSION});
|
||||
};
|
||||
|
||||
/**
|
||||
* Install steps. A step is a function that accepts a function (err) callback and returns once that step is complete.keys:
|
||||
* - run: Function that runs the installation step and calls the callback with an error if failed.
|
||||
|
|
|
@ -48,10 +48,15 @@ Router.map(function () {
|
|||
controller: 'SetupController',
|
||||
action: function () {
|
||||
if (this.ready()) {
|
||||
var install = Installs.findOne();
|
||||
if (!install) {
|
||||
console.log('No installs detected, running installer again.');
|
||||
this.redirect('/setup/intro');
|
||||
if (!Installer.isUpToDate()) {
|
||||
if (!Installs.findOne()) {
|
||||
console.log('No installs detected, running installer again.');
|
||||
this.redirect('/setup/intro');
|
||||
} else {
|
||||
// There's an install but it's lower than the current version, re-run as an 'update'.
|
||||
Session.set('isUpdating', true);
|
||||
this.redirect('/setup/intro');
|
||||
}
|
||||
} else {
|
||||
this.redirect('/apps');
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ Meteor.setInterval(function () {
|
|||
}, 5000);
|
||||
|
||||
Meteor.setInterval(function () {
|
||||
if (Installs.findOne()) {
|
||||
if (Installer.isUpToDate()) {
|
||||
resolveWatchers(function () {});
|
||||
if (!Session.get('boot2dockerOff')) {
|
||||
fixBoot2DockerVM(function (err) {
|
||||
|
|
|
@ -7,7 +7,7 @@ Template.setup_install.rendered = function() {
|
|||
console.log('Setup failed.');
|
||||
console.log(err);
|
||||
} else {
|
||||
Installs.insert({});
|
||||
Installs.insert({version: Installer.CURRENT_VERSION});
|
||||
Router.go('dashboard_apps');
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
<template name="setup_layout">
|
||||
{{setTitle}}
|
||||
<div class="setup content text-center">
|
||||
<h2>Welcome to Kitematic</h2>
|
||||
<p>This will set up everything needed to run Kitematic on your Mac.</p>
|
||||
{{#if isUpdating}}
|
||||
<h2>Welcome Back</h2>
|
||||
<p>Kitematic needs to update itself to continue.</p>
|
||||
{{else}}
|
||||
<h2>Welcome to Kitematic</h2>
|
||||
<p>This will set up everything needed to run Kitematic on your Mac.</p>
|
||||
{{/if}}
|
||||
{{> yield}}
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
Template.setup_layout.rendered = function () {
|
||||
Meteor.setInterval(function () {
|
||||
$('.header .icons a').tooltip();
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
Template.setup_layout.helpers({
|
||||
isUpdating: function () {
|
||||
return Session.get('isUpdating');
|
||||
}
|
||||
});
|
|
@ -60,7 +60,7 @@ Apps.helpers({
|
|||
return Images.findOne(this.imageId);
|
||||
},
|
||||
hostUrl: function () {
|
||||
return this.name + '.dev';
|
||||
return this.name + '.kite';
|
||||
},
|
||||
ports: function () {
|
||||
var app = this;
|
||||
|
@ -78,7 +78,7 @@ Apps.helpers({
|
|||
var app = this;
|
||||
var image = Images.findOne(app.imageId);
|
||||
if (image && image.meta.app && image.meta.app.webPort) {
|
||||
return 'http://' + app.name + '.dev:' + image.meta.app.webPort;
|
||||
return 'http://' + app.name + '.kite:' + image.meta.app.webPort;
|
||||
} else if (image && image.meta.app && image.meta.app.webPort === false) {
|
||||
return null;
|
||||
} else {
|
||||
|
@ -93,14 +93,14 @@ Apps.helpers({
|
|||
}
|
||||
});
|
||||
if (pickedPort) {
|
||||
return 'http://' + app.name + '.dev:' + pickedPort;
|
||||
return 'http://' + app.name + '.kite:' + pickedPort;
|
||||
} else {
|
||||
if (keys.length > 0) {
|
||||
// Picks the first port that's not SSH
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
var port = parseInt(keys[i].split('/')[0], 10);
|
||||
if (port !== 22) {
|
||||
return 'http://' + app.name + '.dev:' + port;
|
||||
return 'http://' + app.name + '.kite:' + port;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -1,7 +1,26 @@
|
|||
Installs = new Meteor.Collection('installs');
|
||||
|
||||
schemaInstalls = new SimpleSchema({
|
||||
|
||||
createdAt: {
|
||||
type: Date,
|
||||
autoValue: function() {
|
||||
var now = new Date();
|
||||
if (this.isInsert) {
|
||||
return now;
|
||||
} else if (this.isUpsert) {
|
||||
return {$setOnInsert: now};
|
||||
} else {
|
||||
this.unset();
|
||||
}
|
||||
},
|
||||
denyUpdate: true,
|
||||
label: 'Time of install created'
|
||||
},
|
||||
version: {
|
||||
type: String,
|
||||
label: 'Installed version',
|
||||
optional: true
|
||||
}
|
||||
});
|
||||
|
||||
Installs.allow({
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
user=root
|
||||
{{ range $index, $value := $ }}
|
||||
{{ with $address := index $value.Addresses 0 }}
|
||||
address=/{{$value.Name}}.dev/{{$address.IP}}
|
||||
address=/{{$value.Name}}.kite/{{$address.IP}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -15,6 +15,7 @@ pushd cache
|
|||
if [ ! -f $BASE_IMAGE_VERSION_FILE ]; then
|
||||
cecho "-----> Downloading Kitematic base images..." $purple
|
||||
curl -L --progress-bar -o $BASE_IMAGE_VERSION_FILE https://s3.amazonaws.com/kite-installer/$BASE_IMAGE_VERSION_FILE
|
||||
cp $BASE_IMAGE_VERSION_FILE ../resources/$BASE_IMAGE_FILE
|
||||
fi
|
||||
|
||||
if [ ! -f $BOOT2DOCKER_CLI_VERSION_FILE ]; then
|
||||
|
@ -60,11 +61,6 @@ if [ ! -f $COCOASUDO_FILE ]; then
|
|||
chmod +x $COCOASUDO_FILE
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -f $BASE_IMAGE_FILE ]; then
|
||||
cp ../cache/$BASE_IMAGE_VERSION_FILE $BASE_IMAGE_FILE
|
||||
fi
|
||||
|
||||
cp ../cache/$BOOT2DOCKER_CLI_VERSION_FILE $BOOT2DOCKER_CLI_FILE
|
||||
chmod +x $BOOT2DOCKER_CLI_FILE
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
BASE_IMAGE_VERSION=0.0.1
|
||||
BASE_IMAGE_VERSION=0.0.2
|
||||
BASE_IMAGE_VERSION_FILE=base-images-$BASE_IMAGE_VERSION.tar.gz
|
||||
BASE_IMAGE_FILE=base-images.tar.gz
|
||||
|
||||
|
|
Loading…
Reference in New Issue