element/build/deploy-ci.sh
2016-10-28 18:09:42 +08:00

32 lines
871 B
Bash

#! /bin/sh
mkdir temp_web
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
CI_ENV=/dev/ ./node_modules/.bin/cooking build -c build/cooking.demo.js
cd temp_web
git clone https://$GH_TOKEN@github.com/ElementUI/dev.git && cd dev
git config user.name "$TRAVIS_COMMIT_USER"
git config user.email "$TRAVIS_COMMIT_EMAIL"
rm -rf *
cp -rf ../../examples/element-ui/** .
git add -A .
git commit -m "$TRAVIS_COMMIT_MSG"
git push origin master
cd ../..
fi
if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
npm run dist
cd temp_web
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
cd ../..
fi