This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathGruntfile.js
66 lines (62 loc) · 2.14 KB
/
Gruntfile.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
63
64
65
66
module.exports = function(grunt) {
const deployPath = grunt.option('path') || 'dev';
const moment = require("moment");
grunt.initConfig({
'copy': {
saveLogs: {
expand: true,
src: '**/*',
dest: `${deployPath}/oldLogs/${moment().format('YYYYMMDDHHmmss')}`,
cwd: deployPath + "/terratex_reallife/LOGS",
dot: true
},
terratex: {
expand: true,
src: '**/*',
dest: deployPath + "/terratex_reallife",
cwd: './terratex_reallife',
dot: true
},
scripts: {
expand: true,
src: '**/*',
dest: deployPath + "/scripts",
cwd: './scripts',
dot: true
},
scoreboard: {
expand: true,
src: '**/*',
dest: deployPath + "/scoreboard_custom_terratex",
cwd: './scoreboard_custom_terratex',
dot: true
},
backup: {
expand: true,
src: ['config.lua', 'database_config.lua'],
dest: deployPath,
cwd: deployPath + "/terratex_reallife",
dot: true
},
restoreBackup: {
expand: true,
src: ['config.lua', 'database_config.lua'],
dest: deployPath + "/terratex_reallife",
cwd: deployPath,
dot: true
}
},
'clean': {
'deploy': {
options: {
force: true,
},
src: [deployPath + '/scoreboard_custom_terratex', deployPath + '/terratex_reallife', deployPath + '/scripts']
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('default', ['copy:backup', 'clean:deploy', 'copy:terratex', 'copy:scripts', 'copy:scoreboard', 'copy:restoreBackup']);
grunt.registerTask('logs', ['copy:saveLogs']);
};