-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
executable file
·70 lines (54 loc) · 2.69 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
63
64
65
66
67
68
69
// Include gulp
const gulp = require('gulp');
// Plugins
const shell = require('gulp-shell');
//load json
const secretJson = require('../../../t3settings/secret.json');
const localJson = require('../../../t3settings/local.json');
// Settings
process.chdir('../../../');
gulp.task('Check', shell.task([
'sh vendor/bo/t3toolbox/bin/check.sh'
]));
gulp.task('Console:ClearCache', shell.task([
'sh vendor/bo/t3toolbox/bin/console_clear_cache.sh'
]));
gulp.task('Console:DumpLocal', shell.task([
'sh vendor/bo/t3toolbox/bin/console_dump_local.sh'
]));
gulp.task('Console:UpdateSchema', shell.task([
'sh vendor/bo/t3toolbox/bin/console_updateschema.sh'
]));
if (secretJson.develop.php) {
gulp.task('Develop:Sync:Database', shell.task([
'php typo3cms database:export > t3settings/.tmp/' + localJson.database.name + '_backup.sql',
'ssh ' + secretJson.develop.host.user + '@' + secretJson.develop.host.url + ' ' + secretJson.develop.php + ' ' + secretJson.develop.host.path + '/current/typo3cms database:export | php typo3cms database:import'
]));
} else {
gulp.task('Develop:Sync:Database', shell.task([
'sh vendor/bo/t3toolbox/bin/sync_develop_database.sh'
]));
}
gulp.task('Develop:Sync:Files', shell.task([
'sh vendor/bo/t3toolbox/bin/sync_develop_files.sh'
]));
gulp.task('Develop:Sync:All', gulp.series(gulp.parallel('Develop:Sync:Files', 'Develop:Sync:Database')));
if (secretJson.master.php) {
gulp.task('Master:Sync:Database', shell.task([
'php typo3cms database:export > t3settings/.tmp/' + localJson.database.name + '_backup.sql',
'ssh ' + secretJson.master.host.user + '@' + secretJson.master.host.url + ' ' + secretJson.master.php + ' ' + secretJson.master.host.path + '/current/typo3cms database:export | php typo3cms database:import'
]));
} else {
gulp.task('Master:Sync:Database', shell.task([
'sh vendor/bo/t3toolbox/bin/sync_master_database.sh'
]));
}
gulp.task('Master:Sync:Files', shell.task([
'sh vendor/bo/t3toolbox/bin/sync_master_files.sh'
]));
gulp.task('Master:Sync:All', gulp.series(gulp.parallel('Master:Sync:Files', 'Master:Sync:Database')));
gulp.task('Local:SetLocalDomain', shell.task([
'mysql -u' + localJson.database.user + ' -p' + localJson.database.password + ' -h' + localJson.database.host + ' -e "UPDATE ' + localJson.database.name + '.sys_domain SET hidden = 1"',
'mysql -u' + localJson.database.user + ' -p' + localJson.database.password + ' -h' + localJson.database.host + ' -e "INSERT INTO ' + localJson.database.name + '.sys_domain (pid, hidden, domainName) VALUES (\'1\',\'0\',\'' + localJson.general.localdomain + '\')"'
]));
gulp.task('default', gulp.series(gulp.parallel('Check')));