gulpfile-publish.js 867 B

12345678910111213141516171819202122232425262728
  1. module.exports = function(gulp, plugins) {
  2. var argv = require('yargs').argv,
  3. path = require('path'),
  4. svn = require('svn-push'),
  5. log = console.log;
  6. var that = this;
  7. that.message = argv.m || '初始化项目';
  8. var pkg = require('../package.json');
  9. var proj_namespace = [pkg.description, pkg.name, pkg.version+'/'].join('/')
  10. var config = require('../svnconfig.json')
  11. gulp.task('publish', function(){
  12. svn({
  13. message: that.message,
  14. username: config.svnUsr,
  15. password: config.svnPwd,
  16. trymkdir: true,
  17. pushIgnore: ['*.html', '.DS_Store', '.idea/**', '.tmp_svn/**', '.svn/**','assets/**'],
  18. src: 'dest',
  19. dest: 'http://svn.duowan.com:9999/svn/web/program/assets/' + proj_namespace,
  20. tmp: '.tmp_svn'
  21. })
  22. })
  23. }