element/build/deploy-ci.sh

67 lines
1.8 KiB
Bash
Raw Normal View History

2016-10-19 06:23:22 +00:00
#! /bin/sh
2016-10-28 10:09:07 +00:00
mkdir temp_web
2016-10-19 06:23:22 +00:00
2016-10-28 10:58:03 +00:00
# build dev site
2016-10-19 06:23:22 +00:00
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
CI_ENV=/dev/ ./node_modules/.bin/cooking build -c build/cooking.demo.js
2016-10-28 10:09:07 +00:00
cd temp_web
2016-10-19 06:23:22 +00:00
git clone https://$GH_TOKEN@github.com/ElementUI/dev.git && cd dev
2016-10-29 06:58:59 +00:00
git config user.name "element_bot"
git config user.email "element_bot"
rm -rf `find * ! -name README.md`
2016-10-19 06:23:22 +00:00
cp -rf ../../examples/element-ui/** .
git add -A .
2016-10-20 00:50:40 +00:00
git commit -m "$TRAVIS_COMMIT_MSG"
2016-10-19 06:23:22 +00:00
git push origin master
2016-10-28 10:09:07 +00:00
cd ../..
2016-10-28 09:06:36 +00:00
fi
2016-11-02 04:24:05 +00:00
# push theme-default
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
cd temp_web
git clone https://$GH_TOKEN@github.com/ElementUI/theme-default.git && cd theme-default
git config user.name "element_bot"
git config user.email "element_bot"
rm -rf *
cp -rf ../../packages/theme-default/** .
git add -A .
git commit -m "$TRAVIS_COMMIT_MSG"
if [ "$TRAVIS_TAG" ]; then
git tag $TRAVIS_TAG
fi
git push origin master --tags
cd ../..
fi
2016-10-28 10:58:03 +00:00
# build lib
2016-10-28 09:06:36 +00:00
if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
npm run dist
2016-10-28 10:09:07 +00:00
cd temp_web
2016-10-28 09:06:36 +00:00
git clone https://$GH_TOKEN@github.com/ElementUI/lib.git && cd lib
2016-10-29 06:58:59 +00:00
git config user.name "element_bot"
git config user.email "element_bot"
rm -rf `find * ! -name README.md`
2016-10-28 09:06:36 +00:00
cp -rf ../../lib/** .
git add -A .
git commit -m "[build] $TRAVIS_TAG"
git tag $TRAVIS_TAG
git push origin master --tags
2016-10-28 10:09:07 +00:00
cd ../..
2016-10-19 06:23:22 +00:00
fi
2016-10-28 10:58:03 +00:00
# build site
if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
npm run deploy
cd temp_web
git clone https://$GH_TOKEN@github.com/ElemeFE/element.git && cd element
2016-10-29 06:58:59 +00:00
git config user.name "element_bot"
git config user.email "element_bot"
2016-10-28 10:58:03 +00:00
git checkout gh-pages
rm -rf `find * ! -name README.md`
2016-10-28 10:58:03 +00:00
cp -rf ../../examples/element-ui/** .
git add -A .
git commit -m "$TRAVIS_COMMIT_MSG"
git push origin gh-pages
cd ../..
fi