release_task.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. var path = require('path');
  2. module.exports = function(grunt) {
  3. "use strict";
  4. // build, then zip and upload to s3
  5. grunt.registerTask('release', [
  6. 'build',
  7. 'build-post-process',
  8. 'compress:release'
  9. ]);
  10. grunt.registerTask('build-post-process', function() {
  11. grunt.config('copy.public_to_temp', {
  12. expand: true,
  13. cwd: '<%= srcDir %>',
  14. src: '**/*',
  15. dest: '<%= tempDir %>/public/',
  16. });
  17. grunt.config('copy.backend_bin', {
  18. cwd: 'bin',
  19. expand: true,
  20. src: ['*'],
  21. options: { mode: true},
  22. dest: '<%= tempDir %>/bin/'
  23. });
  24. grunt.config('copy.backend_files', {
  25. expand: true,
  26. src: ['conf/**', 'tools/phantomjs/*', 'scripts/*'],
  27. options: { mode: true},
  28. dest: '<%= tempDir %>'
  29. });
  30. grunt.task.run('copy:public_to_temp');
  31. grunt.task.run('copy:backend_bin');
  32. grunt.task.run('copy:backend_files');
  33. grunt.task.run('clean:packaging');
  34. grunt.file.write(path.join(grunt.config('tempDir'), 'VERSION'), grunt.config('pkg.version'));
  35. });
  36. };