2015-06-17 02:13:17 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-07-27 20:31:50 +00:00
|
|
|
var path = require('path'),
|
|
|
|
safe = require('safetydance');
|
2015-06-20 18:49:12 +00:00
|
|
|
|
2015-06-17 02:13:17 +00:00
|
|
|
exports = module.exports = {
|
|
|
|
TESTAPP_ID: 'io.cloudron.testapp',
|
2015-06-20 18:47:59 +00:00
|
|
|
TESTAPP_VERSION : '1.0.2',
|
2015-06-19 20:06:00 +00:00
|
|
|
|
|
|
|
cloudronDomain: cloudronDomain,
|
2015-07-23 20:46:47 +00:00
|
|
|
verifyResponse: verifyResponse,
|
|
|
|
getOwner: getOwner,
|
2015-07-27 20:21:38 +00:00
|
|
|
stripeSecret: stripeSecret
|
2015-06-17 02:13:17 +00:00
|
|
|
};
|
|
|
|
|
2015-07-23 21:10:21 +00:00
|
|
|
var gNow = ((new Date()).getTime() / 1000).toFixed();
|
2015-07-27 20:31:50 +00:00
|
|
|
var gEcosystem = safe.require(path.join(__dirname, '../keys/ci/ecosystem-prod.json'));
|
|
|
|
|
2015-06-19 20:06:00 +00:00
|
|
|
function cloudronDomain(filename) {
|
2015-07-23 20:22:20 +00:00
|
|
|
return 't-' + path.basename(filename, '-test.js') + '-' + gNow + '.smartserver.io';
|
2015-06-19 20:06:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function verifyResponse(res, errorMessage) {
|
|
|
|
if (res.statusCode < 200 || res.statusCode > 299) {
|
|
|
|
console.log('Response error statusCode:%s error:%s body:%s', res.statusCode, res.error, res.body);
|
|
|
|
console.log(errorMessage.red);
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-23 20:46:47 +00:00
|
|
|
function getOwner() {
|
|
|
|
return {
|
2015-07-27 20:31:50 +00:00
|
|
|
username: process.env.APPSTORE_USERNAME || gEcosystem.env.APPSTORE_USERNAME,
|
|
|
|
password: process.env.APPSTORE_PASSWORD || gEcosystem.env.APPSTORE_PASSWORD,
|
|
|
|
email: process.env.APPSTORE_EMAIL || gEcosystem.env.APPSTORE_EMAIL
|
2015-07-23 20:46:47 +00:00
|
|
|
};
|
|
|
|
}
|
2015-06-19 20:06:00 +00:00
|
|
|
|
2015-07-27 20:21:38 +00:00
|
|
|
function stripeSecret() {
|
2015-07-27 20:31:50 +00:00
|
|
|
return process.env.STRIPE_SECRET || gEcosystem.env.STRIPE_SECRET;
|
2015-07-27 20:21:38 +00:00
|
|
|
}
|