add the check for updates hook
This commit is contained in:
parent
869795a70e
commit
64fd830db1
|
@ -615,3 +615,9 @@ Cloudron.prototype.checkSieveScript = function (owner, callback) {
|
||||||
socket.on('end', function () { });
|
socket.on('end', function () { });
|
||||||
socket.on('error', callback);
|
socket.on('error', callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Cloudron.prototype.checkForUpdates = function () {
|
||||||
|
request.post(this._origin + '/api/v1/cloudron/check_for_updates')
|
||||||
|
.query({ access_token: this._credentials.accessToken })
|
||||||
|
.end();
|
||||||
|
};
|
||||||
|
|
|
@ -114,11 +114,13 @@ describe('Cloudron update testing', function () {
|
||||||
|
|
||||||
it('can update to new version', function () {
|
it('can update to new version', function () {
|
||||||
console.log('Wait for cloudron to get the update');
|
console.log('Wait for cloudron to get the update');
|
||||||
sleep(60 * 10); // give it 5 mins to autoupdate the box and the app
|
cloudron.checkForUpdates();
|
||||||
|
sleep(60 * 5); // give it 5 mins to autoupdate the box and the app
|
||||||
cloudron.waitForUpdate(nextVersion);
|
cloudron.waitForUpdate(nextVersion);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('auto updates the app with new version', function () {
|
it('auto updates the app with new version', function () {
|
||||||
|
cloudron.checkForUpdates();
|
||||||
sleep(60 * 5); // give it 5 mins to autoupdate the box and the app
|
sleep(60 * 5); // give it 5 mins to autoupdate the box and the app
|
||||||
cloudron.waitForApp(appId, common.TESTAPP_VERSION);
|
cloudron.waitForApp(appId, common.TESTAPP_VERSION);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue