diff options
| author | Tobias Bosch | 2013-12-13 12:49:42 -0800 | 
|---|---|---|
| committer | Tobias Bosch | 2013-12-13 12:51:13 -0800 | 
| commit | 8c10db384727643265b1550543011d3193dfe557 (patch) | |
| tree | 836f583f1618e6dc1814afc6ee9265957402b74a /lib | |
| parent | 03088d60109582fa5e966ad8425b3de9d9152b6a (diff) | |
| download | angular.js-8c10db384727643265b1550543011d3193dfe557.tar.bz2 | |
chore(build): automate cutting a release, publishing to bower and to code.angular.js
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/grunt/utils.js | 9 | 
1 files changed, 7 insertions, 2 deletions
| 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; +    }    }, | 
