-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
93 lines (90 loc) · 2.95 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
exec: {
'app-serve': {
cwd: 'mobile',
cmd: 'ionic serve',
},
'app-version-patch': {
cwd: 'mobile',
cmd: 'npm version patch',
},
'app-version-minor': {
cwd: 'mobile',
cmd: 'npm version minor',
},
'app-version-major': {
cwd: 'mobile',
cmd: 'npm version major',
},
'app-apply-version': {
cwd: 'mobile',
cmd: 'node ./replace.build.js',
},
'commit-version': {
cwd: 'mobile',
cmd: 'git commit -a -m "version"',
},
'app-build': {
cwd: 'mobile',
cmd: 'ionic build --prod --service-worker',
},
'function-build': {
cwd: 'mobile',
cmd: 'ionic build --prod --service-worker',
},
'deploy-app': {
cwd: 'firebase',
cmd: 'firebase deploy',
},
'deploy-www': {
cwd: 'firebase',
cmd: 'firebase deploy',
},
'deploy-function': {
cwd: 'firebase',
cmd: 'firebase deploy',
},
'delete-help': {
cwd: '.',
cmd: 'rm -rf html',
}
},
});
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-markdown');
grunt.loadNpmTasks('grunt-copy');
grunt.registerTask('app-build', 'Build the mobile app', ['exec:app-build']);
grunt.registerTask('deploy-patch', 'Upgrade to next patch version, commit, build, deploy the mobile app only', [
'exec:app-version-patch',
'exec:app-apply-version',
'exec:commit-version',
'exec:app-build',
'exec:deploy-app'
]);
grunt.registerTask('app-deploy-minor', 'Upgrade to next minor version, commit, build, deploy the mobile app only', [
'exec:app-version-minor',
'exec:app-apply-version',
'exec:app-build',
'exec:deploy-app'
]);
grunt.registerTask('app-deploy-major', 'Upgrade to next major version, commit, build, deploy the mobile app only', [
'exec:app-version-major',
'exec:app-apply-version',
'exec:app-build',
'exec:deploy-app'
]);
grunt.registerTask('function-deploy', 'Deploy the backend function only', [
'exec:deploy-function'
]);
/*
lancer la compile ts=> js
Copy firebase/functions/lib/firebase/functions/src firebase/functions/lib
dans firebase lancer firebase deploy --only functions
*/
grunt.registerTask('www-deploy', 'Deploy the web site only', [
'exec:deploy-www'
]);
}