deploy-ci.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #! /bin/sh
  2. mkdir temp_web
  3. git config --global user.name "element-bot"
  4. git config --global user.email "wallement@gmail.com"
  5. if [ "$ROT_TOKEN" = "" ]; then
  6. echo "Bye~"
  7. exit 0
  8. fi
  9. # release
  10. if [ "$TRAVIS_TAG" ]; then
  11. # build lib
  12. npm run dist
  13. cd temp_web
  14. git clone https://$ROT_TOKEN@github.com/ElementUI/lib.git && cd lib
  15. rm -rf `find * ! -name README.md`
  16. cp -rf ../../lib/** .
  17. git add -A .
  18. git commit -m "[build] $TRAVIS_TAG"
  19. git tag $TRAVIS_TAG
  20. git push origin master --tags
  21. cd ../..
  22. # build theme-chalk
  23. cd temp_web
  24. git clone https://$ROT_TOKEN@github.com/ElementUI/theme-chalk.git && cd theme-chalk
  25. rm -rf *
  26. cp -rf ../../packages/theme-chalk/** .
  27. git add -A .
  28. git commit -m "[build] $TRAVIS_TAG"
  29. git tag $TRAVIS_TAG
  30. git push origin master --tags
  31. cd ../..
  32. # build site
  33. npm run deploy:build
  34. cd temp_web
  35. git clone --depth 1 -b gh-pages --single-branch https://$ROT_TOKEN@github.com/ElemeFE/element.git && cd element
  36. # build sub folder
  37. echo $TRAVIS_TAG
  38. SUB_FOLDER='2.13'
  39. mkdir $SUB_FOLDER
  40. rm -rf *.js *.css *.map static
  41. rm -rf $SUB_FOLDER/**
  42. cp -rf ../../examples/element-ui/** .
  43. cp -rf ../../examples/element-ui/** $SUB_FOLDER/
  44. git add -A .
  45. git commit -m "$TRAVIS_COMMIT_MSG"
  46. git push origin gh-pages
  47. cd ../..
  48. echo "DONE, Bye~"
  49. exit 0
  50. fi
  51. # build dev site
  52. npm run build:file && CI_ENV=/dev/$TRAVIS_BRANCH/ node_modules/.bin/cross-env NODE_ENV=production node_modules/.bin/webpack --config build/webpack.demo.js
  53. cd temp_web
  54. git clone https://$ROT_TOKEN@github.com/ElementUI/dev.git && cd dev
  55. mkdir $TRAVIS_BRANCH
  56. rm -rf $TRAVIS_BRANCH/**
  57. cp -rf ../../examples/element-ui/** $TRAVIS_BRANCH/
  58. git add -A .
  59. git commit -m "$TRAVIS_COMMIT_MSG"
  60. git push origin master
  61. cd ../..
  62. # push dev theme-chalk
  63. cd temp_web
  64. git clone -b $TRAVIS_BRANCH https://$ROT_TOKEN@github.com/ElementUI/theme-chalk.git && cd theme-chalk
  65. rm -rf *
  66. cp -rf ../../packages/theme-chalk/** .
  67. git add -A .
  68. git commit -m "$TRAVIS_COMMIT_MSG"
  69. git push origin $TRAVIS_BRANCH
  70. cd ../..