element/build/deploy-ci.sh

32 lines
871 B
Bash
Raw Normal View History

2016-10-19 14:23:22 +08:00
#! /bin/sh
2016-10-28 18:09:07 +08:00
mkdir temp_web
2016-10-19 14:23:22 +08:00
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
CI_ENV=/dev/ ./node_modules/.bin/cooking build -c build/cooking.demo.js
2016-10-28 18:09:07 +08:00
cd temp_web
2016-10-19 14:23:22 +08:00
git clone https://$GH_TOKEN@github.com/ElementUI/dev.git && cd dev
2016-10-20 20:55:49 +08:00
git config user.name "$TRAVIS_COMMIT_USER"
git config user.email "$TRAVIS_COMMIT_EMAIL"
2016-10-19 14:23:22 +08:00
rm -rf *
cp -rf ../../examples/element-ui/** .
git add -A .
2016-10-20 08:50:40 +08:00
git commit -m "$TRAVIS_COMMIT_MSG"
2016-10-19 14:23:22 +08:00
git push origin master
2016-10-28 18:09:07 +08:00
cd ../..
2016-10-28 17:06:36 +08:00
fi
if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
npm run dist
2016-10-28 18:09:07 +08:00
cd temp_web
2016-10-28 17:06:36 +08:00
git clone https://$GH_TOKEN@github.com/ElementUI/lib.git && cd lib
git config user.name "$TRAVIS_COMMIT_USER"
git config user.email "$TRAVIS_COMMIT_EMAIL"
rm -rf *
cp -rf ../../lib/** .
git add -A .
git commit -m "[build] $TRAVIS_TAG"
git tag $TRAVIS_TAG
git push origin master --tags
2016-10-28 18:09:07 +08:00
cd ../..
2016-10-19 14:23:22 +08:00
fi