/
Gruntfile.coffee
83 lines (81 loc) · 2.84 KB
/
Gruntfile.coffee
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
module.exports = (grunt) ->
grunt.initConfig
bower_concat:
all:
dest: "tmp/sectir-input.js"
exclude:
[
"jquery"
"angular"
]
bower:
install:
options:
targetDir: "./bower_components"
uglify:
all:
files:
'tmp/sectir-input.min.js': "tmp/sectir-input.js"
options:
mangle:
except:
[
"jQuery"
"angular"
"TreeModel"
]
dead_code: true
copy:
main:
src: "tmp/sectir-input.js"
dest: "js/sectir-input/sectir-input.js"
shell:
deleteAssets:
command: "rm assets/* -rf"
migrateDown:
command: "echo 'yes' | protected/yiic migrate down 10000"
migrateUp:
command: "echo 'yes' | protected/yiic migrate up"
colocarDatos:
command: "protected/yiic colocardatos"
crearEncuesta:
command: "protected/yiic crearencuesta"
crearAdmin:
command: "protected/yiic crearadmin"
createAuthRoles:
command: "protected/yiic usr createAuthItems"
createCtags:
command: "ctags-patched -f tags -R --fields=+dfnaitmS --languages=php"
confirm:
putdatabase:
options:
question: '''
ADVERTENCIA: ESTE COMANDO BORRARÁ EL CONTENIDO
QUE ESTÁ ACTUALMENTE EN LA BASE DE DATOS
¿DESEA CONTINUAR? (Escriba "Si" para confirmar)
'''
continue: (answer) ->
answer.toLowerCase() is "si"
grunt.loadNpmTasks 'grunt-bower-concat'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-shell'
grunt.loadNpmTasks 'grunt-confirm'
grunt.loadNpmTasks 'grunt-bower-task'
#Tasks
grunt.registerTask "putdatabase", [
"confirm:putdatabase"
"shell:migrateDown"
"shell:migrateUp"
"shell:crearAdmin"
"shell:createAuthRoles"
"shell:colocarDatos"
"shell:crearEncuesta"
]
grunt.registerTask "assets", "shell:deleteAssets"
grunt.registerTask "ctags", "shell:createCtags"
grunt.registerTask "install", "bower:install"
grunt.registerTask "default", [
"assets", "bower_concat:all", "uglify:all" , "copy:main"
]
grunt.registerTask "all", ["install", "default"]