-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
115 lines (91 loc) · 2.93 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
* grunt-deliver
*
* Copyright (c) 2015 "Vitre" Vít Mádr, contributors
* Licensed under the MIT license.
*/
'use strict';
module.exports = function (grunt) {
require('time-grunt')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: [
'Gruntfile.js',
'tasks/**/*.js',
'drivers/**/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
watch: {
js: {
files: ['Gruntfile.js', 'tasks/**/*.js', 'drivers/**/*.js'],
tasks: ['jshint:all']
}
},
availabletasks: {
tasks: {}
},
deliver: {
options: {
driver: 'lftp',
protocol: 'sftp',
patterns: ['git', 'github', 'sass', 'dev-node', 'laravel'],
auth: 'main',
src: 'dist',
target: '/beta',
backup: false,
connection_limit: 7,
parallel_count: 2,
maintenance: {
htaccess: true
},
notify: ['slack', 'hipchat'],
messages: {
success: 'Delivery to "{target}" finished.',
fail: 'Delivery to "{target}" failed.'
},
cache: ['tmp', 'app/storage/cache', 'app/storage/views', 'app/storage/twig']
},
stage: {
name: 'Stage',
branch: 'develop',
auth: 'stage',
src: 'test',
target: '/test/stage',
backup: true,
//backup: {
// enabled: true,
// stamp: 'yyyymmddHHMMss',
// keep: 4
//},
connection_limit: 20,
parallel_count: 10
},
production: {
name: 'Production',
branch: 'master',
src: 'dist',
target: '/test/production',
backup: true
}
}
});
//---
grunt.loadTasks('tasks');
//---
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-available-tasks');
//---
grunt.registerTask('default', ['availabletasks'])
grunt.registerTask('watch_dev', ['watch']);
grunt.registerTask('build', []);
grunt.registerTask('stage_maintenance_set', ['build', 'deliver_maintenance_set:stage']);
grunt.registerTask('stage_maintenance_unset', ['build', 'deliver_maintenance_unset:stage']);
grunt.registerTask('stage_deliver', ['build', 'deliver:stage']);
grunt.registerTask('stage_backup', ['deliver_backup:stage']);
grunt.registerTask('production_deliver', ['build', 'deliver:production']);
};