forked from jedwards1211/meteor-webpack-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.js
60 lines (50 loc) · 1.57 KB
/
deploy.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
require('shelljs/global');
var path = require('path');
if (!process.argv[2]) {
echo('See ' + path.basename(__filename) + ' to customize your deploy command');
return;
}
var projectName = require('./projectName');
if (!projectName) {
echo('Please enter your project name in projectName.js');
}
var dirs = require('./dirs');
echo();
echo('Building Webpack bundles for deployment...');
echo();
require('./predeploy')(function(err) {
if (err) exit(1);
deploy();
});
function deploy() {
switch (process.argv[2]) {
case 'meteor.com':
cd(dirs.meteor);
exec('meteor deploy ' + projectName + '.meteor.com', {async: true});
break;
case 'modulus':
env.METEOR_SETTINGS = cat('settings/prod.json');
cd(dirs.meteor);
exec('modulus deploy --project-name ' + projectName, {async: true});
break;
case 'mup':
echo("Make sure to mup init and mup setup before first deploy");
/*
* you will also need to move settings/prod.json to settings/prod/settings.json
* then mup init inside settings/prod/ so that mup uses the new settings.json
* this will require a settings path change in ./dev script
*/
cd('settings/prod');
exec('mup deploy', {async: true});
break;
case 'demeteorizer':
rm('-rf', 'dist/bundle');
mkdir('-p', 'dist/bundle');
cd(dirs.meteor);
exec("demeteorizer -o ../dist/bundle --json '" + cat('../settings/prod.json') + "'", {async: true});
// run your own command to deploy to your server
break;
default:
echo('See ' + path.basename(__filename) + ' to customize your deploy command');
}
}