forked from runspired/ember-mobiletouch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
66 lines (50 loc) · 1.63 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
/*global module, require*/
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks (currently doesn't work for bump-commit)
require('jit-grunt')(grunt);
grunt.initConfig({
config : {},
pkg : grunt.file.readJSON("package.json"),
bump: {
options: {
files: ['package.json', 'bower.json', 'config/environment.js'],
updateConfigs: ['pkg'],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['package.json', 'bower.json', 'config/environment.js'],
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: true,
pushTo: 'upstream',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d'
}
}
});
/*
Generate a Release (also creates a build);
*/
grunt.registerTask(
'release',
'Creates and Publishes a Versioned Release. First arg is target, second arg allows for specific environment.',
function (target) {
grunt.loadNpmTasks('grunt-bump');
var shouldBump = !!target;
if (!shouldBump) {
grunt.log.warn('[WARNING] grunt:release – No arguments provided. Version will not be bumped.');
}
if (shouldBump && !~['patch', 'major', 'minor', 'prerelease', 'git'].indexOf(target)) {
grunt.log.error('[ERROR] grunt:release – "' + target + '" is not a valid semver target for to bump.');
return false;
}
if (shouldBump) {
grunt.task.run(['bump-only:' + target]);
}
grunt.task.run([
'bump-commit'
]);
}
);
};