2016-07-06 01:14:44 +00:00
|
|
|
"use strict";
|
2016-07-06 04:33:31 +00:00
|
|
|
var plugins = require("./smartnginx.plugins");
|
|
|
|
var paths = require("./smartnginx.paths");
|
|
|
|
var command = require("./smartnginx.command");
|
|
|
|
var allConfigs = [];
|
2016-07-06 01:14:44 +00:00
|
|
|
var NginxConfig = (function () {
|
|
|
|
function NginxConfig() {
|
2016-07-06 04:33:31 +00:00
|
|
|
this.isDeployed = false;
|
2016-07-06 01:14:44 +00:00
|
|
|
}
|
|
|
|
;
|
2016-07-06 01:33:39 +00:00
|
|
|
// interact with Zones
|
|
|
|
NginxConfig.prototype.addZone = function (zoneArg) {
|
2016-07-06 01:14:44 +00:00
|
|
|
};
|
2016-07-06 01:33:39 +00:00
|
|
|
NginxConfig.prototype.listZones = function () {
|
|
|
|
return this.zones;
|
|
|
|
};
|
|
|
|
;
|
|
|
|
NginxConfig.prototype.removeZones = function (zoneArg) {
|
|
|
|
};
|
|
|
|
// handle deployment of zones
|
2016-07-06 04:33:31 +00:00
|
|
|
NginxConfig.prototype.deploy = function (nginxRestartArg) {
|
|
|
|
if (nginxRestartArg === void 0) { nginxRestartArg = false; }
|
|
|
|
plugins.smartfile.fs.remove(paths.nginxZoneBase);
|
|
|
|
plugins.smartfile.fs.ensureDir(paths.nginxZoneBase);
|
|
|
|
for (var _i = 0, allConfigs_1 = allConfigs; _i < allConfigs_1.length; _i++) {
|
|
|
|
var config = allConfigs_1[_i];
|
|
|
|
config.isDeployed = false;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
this.isDeployed = true;
|
|
|
|
for (var _a = 0, _b = this.zones; _a < _b.length; _a++) {
|
|
|
|
var zone = _b[_a];
|
|
|
|
zone.deploy();
|
|
|
|
}
|
|
|
|
if (nginxRestartArg) {
|
|
|
|
command.restart(this);
|
|
|
|
}
|
2016-07-06 01:14:44 +00:00
|
|
|
};
|
|
|
|
;
|
|
|
|
return NginxConfig;
|
|
|
|
}());
|
|
|
|
exports.NginxConfig = N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