-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
62 lines (50 loc) · 1.71 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*jslint node: true */
"use strict";
var gulp = require("gulp");
var nopt = require("nopt");
var path = require("path");
var requireDir = require("require-dir");
var runSequence = require("run-sequence");
var build = require("./build.js");
var fs = require('fs');
var powershell = require("./modules/powershell");
var publish = require("./modules/publish");
var deleteConfig = require("./modules/DeleteConfiguration");
var config = build.config;
var tasks = path.join(__dirname, "gulp-tasks");
var tasks = requireDir(tasks);
var args = nopt({
"env" : [String, null],
"path" : [String, null]
});
build.setEnvironment(args.env);
gulp.task("deploy-all-to-folder", ["set-temp-output-folder","publish-all-layers"], function (callback) {
});
gulp.task("remove-configtransforms", function (callback) {
build.logEvent("builder", "removing configuration transforms");
var psFile = path.join(path.dirname(fs.realpathSync(__filename)), "/powershell-scripts/remove-configtransforms.ps1");
var websiteRoot = build.config.websiteRoot;
if(!path.isAbsolute(websiteRoot))
{
websiteRoot = path.join(process.cwd(),websiteRoot);
}
powershell.runAsync(psFile, " -webRootPath " + websiteRoot, callback);
});
gulp.task("set-temp-output-folder", function (callback) {
var tmpDir = args.path;
if (!fs.existsSync(tmpDir)){
fs.mkdirSync(tmpDir);
}
if (!fs.existsSync(tmpDir + "/Website")){
fs.mkdirSync(tmpDir + "/Website");
}
config.rootFolder = path.resolve(tmpDir);
config.websiteRoot = path.resolve(tmpDir);
callback();
});
gulp.task("default", function () {
console.log("You need to specifiy a task.");
});
exports.publish = publish;
exports.deleteConfig = deleteConfig;
exports.powershell = powershell;