Commit 386a14c2 authored by Alexander.Trofimov's avatar Alexander.Trofimov

delete hg commands

add GIT_COMMIT to build result
parent d71ef65e
module.exports = function(grunt) {
var _ = require('lodash'),
defaultConfig,
packageFile,
revisionHash = '@@REVISION',
revisionTimeStamp = '@@REVISIONDATE';
packageFile;
grunt.loadNpmTasks('grunt-contrib-clean');
......@@ -55,43 +53,6 @@ module.exports = function(grunt) {
});
}
grunt.registerTask('init-config', 'Initialize build script', function() {
var exec = require('child_process').exec,
done = this.async(),
commandsRef = 0;
function doneTask() {
if (--commandsRef <= 0) {
done(true);
}
}
function doCommand(command, callback) {
commandsRef++;
exec(command, callback);
}
doCommand('hg log -r -1 --template "{node|short}"', function(error, stdout, stderr) {
if (error) {
grunt.log.writeln('Error: ' + error);
} else {
revisionHash = stdout;
}
doneTask();
});
doCommand('hg log -r -1 --template "{date|isodate}"', function(error, stdout, stderr) {
if (error) {
grunt.log.writeln('Error: ' + error);
} else {
revisionTimeStamp = stdout;
}
doneTask();
});
});
grunt.initConfig({
mocha: {
test: {
......@@ -212,7 +173,7 @@ module.exports = function(grunt) {
' *\n' +
' * <%= pkg.homepage %> \n' +
' *\n' +
' * Version: <%= pkg.version %> (build:<%= pkg.build %>, rev:' + revisionHash + ', date:' + revisionTimeStamp + ')\n' +
' * Version: <%= pkg.version %> (build:<%= pkg.build %>, rev:' + (process.env['GIT_COMMIT'] || 'local') + ')\n' +
' */\n'
},
dist: {
......@@ -444,9 +405,9 @@ module.exports = function(grunt) {
}
});
grunt.registerTask('deploy-documenteditor', ['init-build-documenteditor', 'init-config', 'deploy-app']);
grunt.registerTask('deploy-spreadsheeteditor', ['init-build-spreadsheeteditor', 'init-config', 'deploy-app']);
grunt.registerTask('deploy-presentationeditor', ['init-build-presentationeditor', 'init-config', 'deploy-app']);
grunt.registerTask('deploy-documenteditor', ['init-build-documenteditor', 'deploy-app']);
grunt.registerTask('deploy-spreadsheeteditor', ['init-build-spreadsheeteditor', 'deploy-app']);
grunt.registerTask('deploy-presentationeditor', ['init-build-presentationeditor', 'deploy-app']);
grunt.registerTask('default', ['deploy-documenteditor', 'deploy-spreadsheeteditor', 'deploy-presentationeditor']);
};
\ No newline at end of file
......@@ -6,7 +6,6 @@
"dependencies": {
"lodash": "^4.0.0",
"grunt": "0.4.5",
"grunt-exec": "0.4.5",
"grunt-replace": "0.7.3",
"grunt-html-minify": "0.3.1",
"grunt-text-replace": "0.3.11",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment