-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
69 lines (63 loc) · 2.11 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
/* jshint node: true */
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: [
'Gruntfile.js',
'js/app/**/*.js'
],
options: {
jshintrc: '.jshintrc'
},
},
'ftp-deploy': {
build: {
auth: {
host: 'ftp.geeksong.com',
port: 21,
authKey: 'key1'
},
src: '.',
dest: 'public_html/Campaign',
exclusions: [
'.gitignore',
'.jshintrc',
'.travis.yml',
'Gruntfile.js',
'notes.txt',
'package.json',
'README.md',
'.ftppass',
'LICENSE',
'node_modules',
'.git',
'settings.php',
'Database Diagram Draw.io.png',
'Database Diagram Draw.io.xml',
'HOW TO TRAVIS ENCRYPT.txt',
'install.txt',
'settings.sample.php',
'db',
'img/*.pdn',
'composer.json',
'vendor',
'one_signal'
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-ftp-deploy');
grunt.registerTask('test', ['jshint']);
grunt.registerTask('default', ['test']);
grunt.registerTask('deploy', ['create-ftp-file', 'ftp-deploy']);
grunt.registerTask('create-ftp-file', 'Create an authentication file for FTP', function() {
var ftpUsername = grunt.option('ftpUsername'),
ftpPassword = grunt.option('ftpPassword');
var contents = '{"key1":{"username":"' + ftpUsername + '", "password":"' + ftpPassword + '"}}';
// Create a file to supply the authentication parameters to the deployment
grunt.file.write('.ftppass', contents);
});
};