build.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. Build everything
  3. */
  4. import * as gulp from 'gulp'
  5. import * as log from 'fancy-log'
  6. import clean from './clean'
  7. import config from 'assist'
  8. import {blend} from 'assist/blend'
  9. import render from './render'
  10. import patch from './patch'
  11. import publish from './publish'
  12. import run from './run'
  13. import sync from './sync'
  14. import watch from './watch'
  15. function setProd(done) {
  16. config.profile = 'prod'
  17. blend(config, config.profiles[config.profile])
  18. done()
  19. }
  20. function noDeploy(cb) {
  21. // print(`Skipping: no deploy action required`)
  22. cb()
  23. }
  24. function noPackage(cb) {
  25. // print(`Skipping: no package action required`)
  26. cb()
  27. }
  28. function trace(cb) {
  29. print(`Using: profile ${config.profile} ${config.debug ? 'debug' : ''}`)
  30. cb()
  31. }
  32. gulp.task('patch', gulp.series(patch))
  33. gulp.task('render', render)
  34. gulp.task('build', gulp.series('patch', 'render'))
  35. gulp.task('clean', gulp.series(clean))
  36. gulp.task('deploy', gulp.series(noDeploy))
  37. gulp.task('package', gulp.series(noPackage))
  38. gulp.task('publish', gulp.series(publish))
  39. gulp.task('promote', gulp.series(setProd, trace, 'build', 'package', 'publish'))
  40. gulp.task('run', gulp.series(run))
  41. gulp.task('sync', gulp.series(sync))
  42. gulp.task('watch', gulp.series(watch))
  43. gulp.task('default', gulp.series(run))