deploy-ci.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. # build lib
  18. if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
  19. npm run dist
  20. cd temp_web
  21. git clone https://$GH_TOKEN@github.com/ElementUI/lib.git && cd lib
  22. git config user.name "element_bot"
  23. git config user.email "element_bot"
  24. rm -rf `find * ! -name README.md`
  25. cp -rf ../../lib/** .
  26. git add -A .
  27. git commit -m "[build] $TRAVIS_TAG"
  28. git tag $TRAVIS_TAG
  29. git push origin master --tags
  30. cd ../..
  31. fi
  32. # build site
  33. if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
  34. npm run deploy
  35. cd temp_web
  36. git clone https://$GH_TOKEN@github.com/ElemeFE/element.git && cd element
  37. git config user.name "element_bot"
  38. git config user.email "element_bot"
  39. git checkout gh-pages
  40. rm -rf `find * ! -name README.md`
  41. cp -rf ../../examples/element-ui/** .
  42. git add -A .
  43. git commit -m "$TRAVIS_COMMIT_MSG"
  44. git push origin gh-pages
  45. cd ../..
  46. fi