delete old nginx configs on infra update

we changed the cert location and reloading nginx fails...
This commit is contained in:
Girish Ramakrishnan
2017-01-28 01:39:11 -08:00
parent 74e2415308
commit 2fac7dd736
2 changed files with 10 additions and 1 deletions
+8 -1
View File
@@ -14,7 +14,8 @@ exports = module.exports = {
configureAdmin: configureAdmin,
configureApp: configureApp,
unconfigureApp: unconfigureApp,
reload: reload
reload: reload,
removeAppConfigs: removeAppConfigs
};
var NGINX_APPCONFIG_EJS = fs.readFileSync(__dirname + '/../setup/start/nginx/appconfig.ejs', { encoding: 'utf8' }),
@@ -95,3 +96,9 @@ function unconfigureApp(app, callback) {
function reload(callback) {
shell.sudo('reload', [ RELOAD_NGINX_CMD ], callback);
}
function removeAppConfigs() {
for (var appConfigFile of fs.readdirSync(paths.NGINX_APPCONFIG_DIR)) {
fs.unlinkSync(path.join(paths.NGINX_APPCONFIG_DIR, appConfigFile));
}
}