2016-10-19 06:23:22 +00:00
|
|
|
#! /bin/sh
|
2016-10-28 10:09:07 +00:00
|
|
|
mkdir temp_web
|
2016-11-17 15:26:09 +00:00
|
|
|
git config --global user.name "element-bot"
|
|
|
|
git config --global user.email "wallement@gmail.com"
|
2016-10-19 06:23:22 +00:00
|
|
|
|
2016-11-28 09:25:47 +00:00
|
|
|
if [ "$ROT_TOKEN" = "" ]; then
|
2016-11-18 13:39:49 +00:00
|
|
|
echo "Bye~"
|
|
|
|
exit 0
|
2016-11-02 04:24:05 +00:00
|
|
|
fi
|
|
|
|
|
2016-11-18 13:39:49 +00:00
|
|
|
# release
|
2016-11-28 09:25:47 +00:00
|
|
|
if [ "$TRAVIS_TAG" ]; then
|
2016-11-07 10:13:12 +00:00
|
|
|
# build lib
|
2016-10-28 09:06:36 +00:00
|
|
|
npm run dist
|
2016-10-28 10:09:07 +00:00
|
|
|
cd temp_web
|
2016-11-17 15:26:09 +00:00
|
|
|
git clone https://$ROT_TOKEN@github.com/ElementUI/lib.git && cd lib
|
2016-10-31 10:14:14 +00:00
|
|
|
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-28 10:58:03 +00:00
|
|
|
|
2017-09-28 07:58:08 +00:00
|
|
|
# build theme-chalk
|
2016-11-07 10:13:12 +00:00
|
|
|
cd temp_web
|
2017-09-28 07:58:08 +00:00
|
|
|
git clone https://$ROT_TOKEN@github.com/ElementUI/theme-chalk.git && cd theme-chalk
|
2016-11-07 10:13:12 +00:00
|
|
|
rm -rf *
|
2017-09-28 07:58:08 +00:00
|
|
|
cp -rf ../../packages/theme-chalk/** .
|
2016-11-07 10:13:12 +00:00
|
|
|
git add -A .
|
|
|
|
git commit -m "[build] $TRAVIS_TAG"
|
|
|
|
git tag $TRAVIS_TAG
|
|
|
|
git push origin master --tags
|
|
|
|
cd ../..
|
|
|
|
|
|
|
|
# build site
|
|
|
|
npm run deploy:build
|
2016-10-28 10:58:03 +00:00
|
|
|
cd temp_web
|
2016-11-17 15:26:09 +00:00
|
|
|
git clone -b gh-pages https://$ROT_TOKEN@github.com/ElemeFE/element.git && cd element
|
2016-11-29 02:49:28 +00:00
|
|
|
# build sub folder
|
2016-12-06 09:40:47 +00:00
|
|
|
echo $TRAVIS_TAG
|
2016-11-29 02:49:28 +00:00
|
|
|
|
2017-09-28 07:58:08 +00:00
|
|
|
SUB_FOLDER='2.0'
|
2016-11-17 04:09:43 +00:00
|
|
|
mkdir $SUB_FOLDER
|
2017-10-26 04:50:28 +00:00
|
|
|
rm -rf *.js *.css *.map static
|
2016-11-17 04:09:43 +00:00
|
|
|
rm -rf $SUB_FOLDER/**
|
2017-10-26 04:50:28 +00:00
|
|
|
cp -rf ../../examples/element-ui/** .
|
2016-11-17 04:09:43 +00:00
|
|
|
cp -rf ../../examples/element-ui/** $SUB_FOLDER/
|
2016-10-28 10:58:03 +00:00
|
|
|
git add -A .
|
|
|
|
git commit -m "$TRAVIS_COMMIT_MSG"
|
|
|
|
git push origin gh-pages
|
|
|
|
cd ../..
|
2016-11-18 13:39:49 +00:00
|
|
|
|
|
|
|
echo "DONE, Bye~"
|
|
|
|
exit 0
|
2016-10-28 10:58:03 +00:00
|
|
|
fi
|
2016-11-18 13:39:49 +00:00
|
|
|
|
|
|
|
# build dev site
|
|
|
|
npm run build:file && CI_ENV=/dev/$TRAVIS_BRANCH/ node_modules/.bin/cooking build -c build/cooking.demo.js
|
|
|
|
cd temp_web
|
|
|
|
git clone https://$ROT_TOKEN@github.com/ElementUI/dev.git && cd dev
|
|
|
|
mkdir $TRAVIS_BRANCH
|
|
|
|
rm -rf $TRAVIS_BRANCH/**
|
|
|
|
cp -rf ../../examples/element-ui/** $TRAVIS_BRANCH/
|
|
|
|
git add -A .
|
|
|
|
git commit -m "$TRAVIS_COMMIT_MSG"
|
|
|
|
git push origin master
|
|
|
|
cd ../..
|
|
|
|
|
2017-09-28 07:58:08 +00:00
|
|
|
# push dev theme-chalk
|
2016-11-18 13:39:49 +00:00
|
|
|
cd temp_web
|
2017-09-28 07:58:08 +00:00
|
|
|
git clone -b $TRAVIS_BRANCH https://$ROT_TOKEN@github.com/ElementUI/theme-chalk.git && cd theme-chalk
|
2016-11-18 13:39:49 +00:00
|
|
|
rm -rf *
|
2017-09-28 07:58:08 +00:00
|
|
|
cp -rf ../../packages/theme-chalk/** .
|
2016-11-18 13:39:49 +00:00
|
|
|
git add -A .
|
|
|
|
git commit -m "$TRAVIS_COMMIT_MSG"
|
|
|
|
git push origin $TRAVIS_BRANCH
|
|
|
|
cd ../..
|