Update travis config

pull/520/head
qingwei.li 2016-10-19 14:23:22 +08:00 committed by cinwell.li
parent 8d10dda8b6
commit b453ce1167
3 changed files with 30 additions and 15 deletions

View File

@ -1,20 +1,20 @@
sudo: false
language: node_js language: node_js
node_js: node_js: 5
- 5
cache: cache:
bundler: true bundler: true
directories: directories:
- node_modules # NPM packages - node_modules
- travis_phantomjs - travis_phantomjs
before_install: before_install:
# Upgrade PhantomJS to v2.1.1. - export PHANTOMJS_VERSION=2.1.1
- "export PHANTOMJS_VERSION=2.1.1" - export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH
- "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH" - if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs;
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi" mkdir -p $PWD/travis_phantomjs; fi
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi" - if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi" -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi
- "phantomjs --version" - if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2
-C $PWD/travis_phantomjs; fi
- phantomjs --version
after_success: after_success:
- cat ./test/unit/coverage/lcov.info | ./node_modules/.bin/coveralls - sh build/deploy-ci.sh
- cat ./test/unit/coverage/lcov.info | ./node_modules/.bin/coveralls

View File

@ -15,7 +15,7 @@ cooking.set({
entry: './examples/entry.js', entry: './examples/entry.js',
dist: './examples/element-ui/', dist: './examples/element-ui/',
template: './examples/index.tpl', template: './examples/index.tpl',
publicPath: '/', publicPath: process.env.CI_ENV || '/',
hash: true, hash: true,
devServer: { devServer: {
port: 8085, port: 8085,

15
build/deploy-ci.sh Normal file
View File

@ -0,0 +1,15 @@
#! /bin/sh
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
CI_ENV=/dev/ ./node_modules/.bin/cooking build -c build/cooking.demo.js
mkdir temp_web
cd temp_web
git clone https://$GH_TOKEN@github.com/ElementUI/dev.git && cd dev
git config user.name "travis"
git config user.email "travis"
rm -rf *
cp -rf ../../examples/element-ui/** .
git add -A .
git commit -m "$TRAVIS_COMMIT"
git push origin master
fi