Skip to content

Instantly share code, notes, and snippets.

@nheath
Created June 19, 2015 18:01
Show Gist options
  • Select an option

  • Save nheath/d947b54ef754bc6467a9 to your computer and use it in GitHub Desktop.

Select an option

Save nheath/d947b54ef754bc6467a9 to your computer and use it in GitHub Desktop.
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
package: grunt.file.readJSON('package.json'),
name: '<%= package.name %>',
version: '<%= package.version %>',
build: '<% return process.env.BUILD_NUMBER %>',
artifact: '<%= name %>-<%= version %>',
artifactBuild: '<%= name %>-<%= version %>-<%= build %>',
});
grunt.registerTask('version', function() {
grunt.log.writeln("version: " + grunt.config('version'));
grunt.log.writeln("env: " + process.env.BUILD_NUMBER);
grunt.log.writeln("build: " + grunt.config('build'));
grunt.log.writeln("artifact: " + grunt.config('artifact'));
grunt.log.writeln("artifactBuild: " + grunt.config('artifactBuild'));
});
};
{
"name": "artifact",
"version": "1.0.0",
"description": "",
"dependencies": {
"grunt": "^0.4.5"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment