-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.cjs
62 lines (56 loc) · 1.63 KB
/
Gruntfile.cjs
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
module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-gitinfo");
grunt.loadNpmTasks("grunt-text-replace");
grunt.loadNpmTasks("grunt-sftp-deploy");
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
gitinfo: {
options: {},
},
replace: {
dist: {
src: ["build/index.html", "build/iframe.html"],
overwrite: true,
replacements: [
{
from: "<title>@storybook/cli - Storybook</title>",
to: "<title>UI | KWS3 Media</title>",
},
{
from: "<title>@storybook/cli - Storybook</title>",
to: "<title>UI | KWS3 Media</title>",
},
{
from: '<link rel="icon" type="image/svg+xml" href="./favicon.svg" />',
to:
'<link rel="shortcut icon" href="favicon.png?v=' +
"<%= gitinfo.local.branch.current.shortSHA %>" +
'" />',
},
{
from: /\.js"/g,
to: ".js?v=" + "<%= gitinfo.local.branch.current.shortSHA %>" + '"',
},
],
},
},
"sftp-deploy": {
dist: {
auth: {
host: "kws3.media",
port: 22,
authKey: "livekey",
},
cache: false,
src: "./build/",
dest: "/var/www/html/ui.kws3.media/", // this is on the remote host
exclusions: ["./build/**/.DS_Store", "./build/**/Thumbs.db"],
serverSep: "/",
concurrency: 20,
progress: true,
},
},
});
grunt.registerTask("dist", ["gitinfo", "replace:dist"]);
grunt.registerTask("deploy:dist", ["sftp-deploy:dist"]);
};