From 857ad3aee45ab1a907be2a8f1f2337359b9b51fb Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Mon, 7 Nov 2016 18:13:12 +0800 Subject: [PATCH] Fix deploy ci --- build/deploy-ci.sh | 24 ++++++++++++++++-------- package.json | 7 ++++--- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/build/deploy-ci.sh b/build/deploy-ci.sh index 589fb3f35..715067777 100644 --- a/build/deploy-ci.sh +++ b/build/deploy-ci.sh @@ -26,15 +26,12 @@ if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then cp -rf ../../packages/theme-default/** . git add -A . git commit -m "$TRAVIS_COMMIT_MSG" - if [ "$TRAVIS_TAG" ]; then - git tag $TRAVIS_TAG - fi git push origin master --tags cd ../.. fi -# build lib if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then + # build lib npm run dist cd temp_web git clone https://$GH_TOKEN@github.com/ElementUI/lib.git && cd lib @@ -47,11 +44,22 @@ if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then git tag $TRAVIS_TAG git push origin master --tags cd ../.. -fi -# build site -if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then - npm run deploy + # build theme-default + cd temp_web + git clone https://$GH_TOKEN@github.com/ElementUI/theme-default.git && cd theme-default + git config user.name "element_bot" + git config user.email "element_bot" + rm -rf * + cp -rf ../../packages/theme-default/** . + 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 cd temp_web git clone https://$GH_TOKEN@github.com/ElemeFE/element.git && cd element git config user.name "element_bot" diff --git a/package.json b/package.json index e7bb9810b..bfef5af67 100644 --- a/package.json +++ b/package.json @@ -13,13 +13,14 @@ "build:file": "node build/bin/iconInit.js & node build/bin/build-entry.js", "build:theme": "node build/bin/gen-cssfile && gulp build --gulpfile packages/theme-default/gulpfile.js && cp-cli packages/theme-default/lib lib/theme-default", "build:utils": "cross-env BABEL_ENV=utils babel src --out-dir lib --ignore src/index.js", - "clean": "rimraf lib && rimraf packages/*/lib && rimraf test/**/coverage", - "deploy": "npm run build:file && cooking build -c build/cooking.demo.js -p && echo element.eleme.io>>examples/element-ui/CNAME && gh-pages -d examples/element-ui --remote eleme && del examples/element-ui", + "clean": "rimraf lib && rimraf packages/*/lib && rimraf test/**/coverage && lerna clean --yes", + "deploy:build": "npm run build:file && cooking build -c build/cooking.demo.js -p && echo element.eleme.io>>examples/element-ui/CNAME", + "deploy": "npm run deploy:build && gh-pages -d examples/element-ui --remote eleme && del examples/element-ui", "dev": "npm run bootstrap && npm run build:file && cooking watch -c build/cooking.demo.js -p", "dist": "npm run clean && npm run build:file && npm run lint && cooking build -c build/cooking.conf.js,build/cooking.common.js,build/cooking.component.js -p && npm run build:utils && npm run build:theme", "dist:all": "node build/bin/build-all.js && npm run build:theme", "lint": "eslint src/**/* test/**/* packages/**/*.{js,vue} build/**/* --quiet", - "pub": "sh build/release.sh", + "pub": "git checkout master && git pull eleme master --rebase && sh build/release.sh", "pub:all": "npm run dist:all && lerna publish", "test": "npm run lint && CI_ENV=/dev/ karma start test/unit/karma.conf.js --single-run", "test:watch": "karma start test/unit/karma.conf.js"