Skip to content

Commit

Permalink
feat(grunt): better deploying
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjanssen committed Jun 24, 2014
1 parent 20d7c86 commit 3818f80
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
31 changes: 31 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,37 @@ module.exports = function (grunt) {
],
tasks: ['jshint:test_unit', 'karma:unit:run']
}
},

deploy: {
options: {
versionFiles: [
'package.json',
'bower.json'
],
preDeployFn: function (grunt, newVersion, done) {
// Needed to make uglify use the banner with the new version inside
grunt.config.set('pkg', grunt.file.readJSON('package.json'));

grunt.task.run([
'build',
'changelog'
]);
done();
},
postDeployFn: function (grunt, newVersion, done) {
if (!grunt.option('soft')) {
var exec = require('child_process').exec;
exec('npm publish', null, function (err, stdout) {
console.log(stdout);
done();
});
}
else {
done();
}
}
}
}
});

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"sofa-testing": "~0.1.x",
"karma-jasmine": "~0.1.5",
"karma-chrome-launcher": "~0.1.2",
"karma-firefox-launcher": "~0.1.3"
"karma-firefox-launcher": "~0.1.3",
"grunt-deploy-semver": "^0.3.0"
},
"dependencies": {
"sofa-core": "0.4.x"
Expand Down

0 comments on commit 3818f80

Please sign in to comment.