forked from volusion-angular-themes/method
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.js
37 lines (29 loc) · 1.44 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
var sys = require('sys');
var exec = require('child_process').execSync;
var version = process.argv[2];
var toolboxVersion = process.argv[3];
console.log('Version: ' + version);
console.log('Toolbox Version: ' + toolboxVersion);
console.log('Hubflow: Start Release');
exec('git hf release start ' + version);
var packageJson = require('./package.json');
var bowerJson = require('./bower.json');
var themeInfoJson = require('./app/settings/themeInfo.json');
var oldVersion = packageJson.version;
packageJson.version = version;
bowerJson.version = version;
delete bowerJson.dependencies['vn-toolbox-common'];
bowerJson.dependencies['vn-toolbox-public'] = '~' + toolboxVersion;
themeInfoJson.version = version;
themeInfoJson.source = 'https://github.com/volusion-angular-themes/method/archive/v' + version + '.zip';
var fs = require('fs');
fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));
console.log('package.json has been updated');
fs.writeFileSync('./bower.json', JSON.stringify(bowerJson, null, 2));
console.log('bower.json has been updated');
fs.writeFileSync('./app/settings/themeInfo.json', JSON.stringify(themeInfoJson, null, 4));
console.log('themeInfo.json has been updated');
exec('git commit -am "bumped version from ' + oldVersion + ' to ' + version + '"');
console.log('Git: Commit Changes');
console.log('Run the following command to finish the release');
console.log('git hf release finish -m v' + version + ' ' + version);