-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGruntfile.js
More file actions
123 lines (119 loc) · 5.17 KB
/
Gruntfile.js
File metadata and controls
123 lines (119 loc) · 5.17 KB
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
116
117
118
119
120
121
122
123
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-version-patch-root': { cwd: '.', cmd: 'npm version patch' },
'app-version-minor-root': { cwd: '.', cmd: 'npm version minor' },
'app-version-major-root': { cwd: '.', cmd: 'npm version major' },
'app-apply-version': { cwd: 'mobile', cmd: 'node ./replace.build.js' },
'app-clean-apikey': { cwd: 'mobile', cmd: 'node ./clean.apikey.js' },
'commit-version': { cwd: 'mobile', cmd: 'git commit -a -m "version"' },
'git-tag': { cwd: 'mobile', cmd: 'git tag' },
'app-build': { cwd: 'mobile', cmd: 'ionic build --prod --service-worker' },
'function-build': { cwd: 'firebase/functions', cmd: 'npm run build' },
'deploy-app': { cwd: 'firebase', cmd: 'firebase deploy' },
'set-target-deploy-www': { cwd: 'firebase', cmd: 'firebase target:apply hosting www coachreferee-site' },
'set-target-deploy-app': { cwd: 'firebase', cmd: 'firebase target:apply hosting app refcoach-676e3' },
'deploy-www': { cwd: 'firebase', cmd: 'firebase deploy --only hosting:www' },
'deploy-function': { cwd: 'firebase', cmd: 'firebase deploy --only functions' },
'delete-help': { cwd: '.', cmd: 'rm -rf html' },
'show-function-env': { cwd: 'firebase', cmd: 'firebase functions:config:get' },
'set-function-env': { cwd: 'firebase', cmd: 'firebase functions:config:set gmail.email=coachreferee@gmail.com' }
},
markdown: {
'www-help-build': { files: [{ expand: true, src: 'mobile/src/assets/help/*.md', dest: 'html/', ext: '.html' }] }
},
copy: {
copyGeneratedHelp: {
cwd: 'html/mobile/src/assets/help',
src: ['*.html'],
timestamp: true,
dest: 'firebase/hosting/www/help/'
},
copyHelp: {
cwd: 'mobile/src/assets/help',
src: ['**'],
timestamp: true,
dest: 'firebase/hosting/www/help/'
},
copyFunctions: {
cwd: 'firebase/functions/lib/firebase/functions/src/',
src: ['*.*'],
timestamp: true,
dest: 'firebase/functions/lib/',
expand: true
}
},
});
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-markdown');
grunt.loadNpmTasks('grunt-copy');
grunt.loadNpmTasks('grunt-git-tag');
grunt.registerTask('app-build', 'Build the mobile app', ['exec:app-build']);
grunt.registerTask('app-deploy-patch', 'Upgrade to next patch version, commit, build, deploy the mobile app only', [
'exec:app-version-patch-root',
'exec:app-version-patch',
'exec:app-apply-version',
'exec:app-build',
'exec:set-target-deploy-app',
'exec:deploy-app',
'exec:set-target-deploy-www',
'exec:deploy-www',
'exec:set-target-deploy-app',
'exec:app-clean-apikey',
'exec:commit-version'
]);
grunt.registerTask('app-deploy-minor', 'Upgrade to next minor version, commit, build, deploy the mobile app only', [
'exec:app-version-minor-root',
'exec:app-version-minor',
'exec:app-apply-version',
'exec:app-build',
'exec:set-target-deploy-app',
'exec:deploy-app',
'exec:set-target-deploy-www',
'exec:deploy-www',
'exec:set-target-deploy-app',
'exec:app-clean-apikey',
'exec:commit-version'
]);
grunt.registerTask('app-deploy-major', 'Upgrade to next major version, commit, build, deploy the mobile app only', [
'exec:app-version-major-root',
'exec:app-version-major',
'exec:app-apply-version',
'exec:app-build',
'exec:set-target-deploy-app',
'exec:deploy-app',
'exec:set-target-deploy-www',
'exec:deploy-www',
'exec:set-target-deploy-app',
'exec:app-clean-apikey',
'exec:commit-version'
]);
grunt.registerTask('function-deploy', 'Deploy the backend function only', [
'exec:function-build',
'copy:copyFunctions',
'exec:deploy-function',
]);
/* TODO 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', [
/*'markdown:www-help-build',
'copy:copyGeneratedHelp',
'copy:copyHelp',
'exec:delete-help', */
'exec:set-target-deploy-www',
'exec:deploy-www',
'exec:set-target-deploy-app'
]);
grunt.registerTask('gitag', 'Commit and tag', [
'git_tag'
]);
}