deploy-ci.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. git push origin master --tags
  28. cd ../..
  29. fi
  30. if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
  31. # build lib
  32. npm run dist
  33. cd temp_web
  34. git clone https://$GH_TOKEN@github.com/ElementUI/lib.git && cd lib
  35. git config user.name "element_bot"
  36. git config user.email "element_bot"
  37. rm -rf `find * ! -name README.md`
  38. cp -rf ../../lib/** .
  39. git add -A .
  40. git commit -m "[build] $TRAVIS_TAG"
  41. git tag $TRAVIS_TAG
  42. git push origin master --tags
  43. cd ../..
  44. # build theme-default
  45. cd temp_web
  46. git clone https://$GH_TOKEN@github.com/ElementUI/theme-default.git && cd theme-default
  47. git config user.name "element_bot"
  48. git config user.email "element_bot"
  49. rm -rf *
  50. cp -rf ../../packages/theme-default/** .
  51. git add -A .
  52. git commit -m "[build] $TRAVIS_TAG"
  53. git tag $TRAVIS_TAG
  54. git push origin master --tags
  55. cd ../..
  56. # build site
  57. npm run deploy:build
  58. cd temp_web
  59. git clone https://$GH_TOKEN@github.com/ElemeFE/element.git && cd element
  60. git config user.name "element_bot"
  61. git config user.email "element_bot"
  62. git checkout gh-pages
  63. rm -rf `find * ! -name README.md`
  64. cp -rf ../../examples/element-ui/** .
  65. git add -A .
  66. git commit -m "$TRAVIS_COMMIT_MSG"
  67. git push origin gh-pages
  68. cd ../..
  69. fi