test app clone
This commit is contained in:
parent
ef183f0f5f
commit
55b337eefc
16
cloudron.js
16
cloudron.js
@ -233,6 +233,22 @@ Cloudron.prototype.configureApp = function (appId, newLocation, altDomain /* opt
|
||||
console.log('App is reachable'.green);
|
||||
};
|
||||
|
||||
Cloudron.prototype.cloneApp = function (appId, newLocation, portBindings) {
|
||||
portBindings = portBindings || null;
|
||||
|
||||
var data = { location: newLocation, password: this._credentials.password, portBindings: portBindings };
|
||||
|
||||
var res = request.post(this._origin + '/api/v1/apps/' + appId + '/clone').query({ access_token: this._credentials.accessToken }).send(data).end();
|
||||
common.verifyResponse2xx(res, 'App could not be clone');
|
||||
|
||||
console.log('App cloned to different location'.green);
|
||||
var app = this.waitForApp(appId);
|
||||
|
||||
res = request.get('https://' + app.fqdn).end();
|
||||
common.verifyResponse2xx(res, 'App is unreachable');
|
||||
console.log('App is reachable'.green);
|
||||
};
|
||||
|
||||
Cloudron.prototype.uninstallApp = function (appId) {
|
||||
process.stdout.write('Uninstalling app');
|
||||
var res = request.post(this._origin + '/api/v1/apps/' + appId + '/uninstall').query({ access_token: this._credentials.accessToken }).send({ password: this._credentials.password }).end();
|
||||
|
@ -95,6 +95,10 @@ describe('Appstore new user flow', function () {
|
||||
cloudron.configureApp(appId, location);
|
||||
});
|
||||
|
||||
it('can clone app', function () {
|
||||
cloudron.cloneApp(appId, location + 'clone');
|
||||
});
|
||||
|
||||
it('can uninstall app', function () {
|
||||
cloudron.uninstallApp(appId);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user