deploy-ci.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #! /bin/sh
  2. mkdir temp_web
  3. # build dev site
  4. if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
  5. CI_ENV=/dev/ ./node_modules/.bin/cooking build -c build/cooking.demo.js
  6. cd temp_web
  7. git clone https://$GH_TOKEN@github.com/ElementUI/dev.git && cd dev
  8. git config user.name "element_bot"
  9. git config user.email "element_bot"
  10. rm -rf `find * ! -name README.md`
  11. cp -rf ../../examples/element-ui/** .
  12. git add -A .
  13. git commit -m "$TRAVIS_COMMIT_MSG"
  14. git push origin master
  15. cd ../..
  16. fi
  17. # push theme-default
  18. if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
  19. cd temp_web
  20. git clone https://$GH_TOKEN@github.com/ElementUI/theme-default.git && cd theme-default
  21. git config user.name "element_bot"
  22. git config user.email "element_bot"
  23. rm -rf *
  24. cp -rf ../../packages/theme-default/** .
  25. git add -A .
  26. git commit -m "$TRAVIS_COMMIT_MSG"
  27. if [ "$TRAVIS_TAG" ]; then
  28. git tag $TRAVIS_TAG
  29. fi
  30. git push origin master --tags
  31. cd ../..
  32. fi
  33. # build lib
  34. if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
  35. npm run dist
  36. cd temp_web
  37. git clone https://$GH_TOKEN@github.com/ElementUI/lib.git && cd lib
  38. git config user.name "element_bot"
  39. git config user.email "element_bot"
  40. rm -rf `find * ! -name README.md`
  41. cp -rf ../../lib/** .
  42. git add -A .
  43. git commit -m "[build] $TRAVIS_TAG"
  44. git tag $TRAVIS_TAG
  45. git push origin master --tags
  46. cd ../..
  47. fi
  48. # build site
  49. if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
  50. npm run deploy
  51. cd temp_web
  52. git clone https://$GH_TOKEN@github.com/ElemeFE/element.git && cd element
  53. git config user.name "element_bot"
  54. git config user.email "element_bot"
  55. git checkout gh-pages
  56. rm -rf `find * ! -name README.md`
  57. cp -rf ../../examples/element-ui/** .
  58. git add -A .
  59. git commit -m "$TRAVIS_COMMIT_MSG"
  60. git push origin gh-pages
  61. cd ../..
  62. fi