From 8c10db384727643265b1550543011d3193dfe557 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Fri, 13 Dec 2013 12:49:42 -0800 Subject: chore(build): automate cutting a release, publishing to bower and to code.angular.js --- lib/grunt/utils.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index 9e0aab99..51ebcc70 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -36,13 +36,12 @@ module.exports = { var package = JSON.parse(fs.readFileSync('package.json', 'UTF-8')); var match = package.version.match(/^([^\-]*)(?:\-(.+))?$/); var semver = match[1].split('.'); - var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', ''); var fullVersion = match[1]; if (match[2]) { fullVersion += '-'; - fullVersion += (match[2] == 'snapshot') ? hash : match[2]; + fullVersion += (match[2] == 'snapshot') ? getSnapshotSuffix() : match[2]; } version = { @@ -55,6 +54,12 @@ module.exports = { }; return version; + + function getSnapshotSuffix() { + var jenkinsBuild = process.env.BUILD_NUMBER || 'local'; + var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', ''); + return 'build.'+jenkinsBuild+'+sha.'+hash; + } }, -- cgit v1.2.3