@@ -10,13 +10,14 @@ grunt.loadNpmTasks('grunt-contrib-jshint');
10
10
grunt . loadNpmTasks ( 'grunt-contrib-copy' ) ;
11
11
grunt . loadNpmTasks ( 'grunt-jsonlint' ) ;
12
12
grunt . loadNpmTasks ( 'grunt-contrib-watch' ) ;
13
+ grunt . loadNpmTasks ( 'grunt-sftp-deploy' ) ;
13
14
14
15
grunt . initConfig ( {
15
16
pkg : grunt . file . readJSON ( 'package.json' ) ,
16
17
meta : {
17
18
banner :
18
19
'/* \n' +
19
- ' * <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> \n' +
20
+ ' * <%= pkg.name %> v<%= pkg.version %> \n' +
20
21
' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> \n' +
21
22
' * <%= pkg.author %> \n' +
22
23
' * \n' +
@@ -30,6 +31,9 @@ grunt.initConfig({
30
31
js : {
31
32
src : [ 'dist/*.js' ]
32
33
} ,
34
+ css : {
35
+ src : [ 'dist/*.css' ]
36
+ } ,
33
37
images : {
34
38
src : [ 'dist/images/*' ]
35
39
}
@@ -94,7 +98,7 @@ grunt.initConfig({
94
98
'src/map/config/*.js' ,
95
99
'src/map/Map.js' ,
96
100
'src/map/utils/LayerLegend.js' ,
97
- 'src/map/controller/MapControllerDraggable .js' ,
101
+ 'src/map/MapController .js' ,
98
102
'src/map/html/gui-controller.js' ,
99
103
'src/map/html/gui-map.js' ,
100
104
'src/map/utils/*.js ' ,
@@ -130,12 +134,29 @@ grunt.initConfig({
130
134
src : '<%= cssmin.combine.dest %>'
131
135
}
132
136
} ,
137
+ 'sftp-deploy' : {
138
+ build : {
139
+ auth : {
140
+ host : 'fenixrepo.fao.org' ,
141
+ port : 22 ,
142
+ authKey : {
143
+ username : 'root'
144
+ }
145
+ } ,
146
+ cache : 'sftpCache.json' ,
147
+ src : 'dist' ,
148
+ dest : '/work/prod/nginx/www/cdn/fenix/<%= pkg.name %>/<%= pkg.version %>' ,
149
+ serverSep : '/' ,
150
+ concurrency : 4 ,
151
+ progress : true
152
+ }
153
+ } ,
133
154
watch : {
134
155
dist : {
135
156
options : { livereload : true } ,
136
157
files : [ 'src/**/*' , 'Gruntfile.js' ] ,
137
- tasks : [ 'clean:js' , 'copy:fenixmapconfig' , 'concat' , 'cssmin' , 'jshint' ]
138
- }
158
+ tasks : [ 'clean:js' , 'clean:css' , ' copy:fenixmapconfig', 'concat' , 'cssmin' , 'jshint' ]
159
+ }
139
160
}
140
161
} ) ;
141
162
@@ -149,4 +170,8 @@ grunt.registerTask('default', [
149
170
'copy'
150
171
] ) ;
151
172
152
- } ;
173
+ grunt . registerTask ( 'deploy' , [
174
+ 'sftp-deploy' ,
175
+ ] ) ;
176
+
177
+ } ;
0 commit comments