Skip to content

Commit

Permalink
Update travis config
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Oct 19, 2016
1 parent 8d10dda commit b453ce1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
28 changes: 14 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
sudo: false
language: node_js
node_js:
- 5
node_js: 5
cache:
bundler: true
directories:
- node_modules # NPM packages
- travis_phantomjs
- node_modules
- travis_phantomjs
before_install:
# Upgrade PhantomJS to v2.1.1.
- "export PHANTOMJS_VERSION=2.1.1"
- "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; 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 tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
- "phantomjs --version"

- export PHANTOMJS_VERSION=2.1.1
- export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH
- if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs;
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 tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2
-C $PWD/travis_phantomjs; fi
- phantomjs --version
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
2 changes: 1 addition & 1 deletion build/cooking.demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cooking.set({
entry: './examples/entry.js',
dist: './examples/element-ui/',
template: './examples/index.tpl',
publicPath: '/',
publicPath: process.env.CI_ENV || '/',
hash: true,
devServer: {
port: 8085,
Expand Down
15 changes: 15 additions & 0 deletions build/deploy-ci.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b453ce1

Please sign in to comment.