Skip to content

Commit

Permalink
Merge pull request #1 from storybooks/travis
Browse files Browse the repository at this point in the history
ADD travis
  • Loading branch information
ndelangen authored Mar 29, 2017
2 parents 1adc85a + 33ba266 commit 72a6af5
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 11 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: node_js
cache:
yarn: true
directories:
- node_modules
notifications:
email: false
node_js:
- "5"
before_install: ./scripts/travis/before_install.sh
after_success: ./scripts/travis/after_success.sh
script: npm run test
git:
depth: 1
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"devDependencies": {
"lerna": "2.0.0-beta.38"
},
"scripts": {
"postinstall": "lerna bootstrap",
"test": "lerna run test"
}
}
6 changes: 3 additions & 3 deletions packages/addon-knobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"scripts": {
"start": "./example/prepublish.sh",
"prepublish": ". ./.scripts/prepublish.sh",
"lint": "eslint src",
"lintfix": "eslint src --fix",
"testonly": "mocha --require .scripts/mocha_runner src/**/tests/**/*.js",
"lint": "eslint ./src",
"lintfix": "eslint ./src --fix",
"testonly": "mocha --require ./.scripts/mocha_runner ./src/**/tests/**/*.js",
"test": "npm run lint && npm run testonly",
"test-watch": "npm run testonly -- --watch --watch-extensions js",
"storybook": "start-storybook -p 9010",
Expand Down
6 changes: 3 additions & 3 deletions packages/react-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
},
"scripts": {
"prepublish": "sh scripts/prepublish.sh",
"lint": "eslint src",
"lintfix": "eslint src --fix",
"lint": "eslint ./src",
"lintfix": "eslint ./src --fix",
"testonly": "mocha $npm_package_options_mocha",
"test": "npm run lint && npm run testonly",
"test-watch": "npm run testonly -- --watch --watch-extensions js",
"dev": "DEV_BUILD=1 nodemon --watch src --exec 'npm run prepublish'",
"dev": "DEV_BUILD=1 nodemon --watch ./src --exec 'npm run prepublish'",
"postpublish": "greenkeeper-postpublish"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/storybook-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"license": "MIT",
"scripts": {
"prepublish": ". ./.scripts/prepublish.sh",
"lint": "eslint src",
"lintfix": "eslint src --fix",
"testonly": "mocha --require .scripts/mocha_runner src/**/__tests__/**/*.js",
"lint": "eslint ./src",
"lintfix": "eslint ./src --fix",
"testonly": "mocha --require ./.scripts/mocha_runner ./src/**/__tests__/**/*.js",
"test": "npm run lint && npm run testonly",
"test-watch": "npm run testonly -- --watch --watch-extensions js",
"storybook": "start-storybook -p 9010",
"publish-storybook": "bash .scripts/publish_storybook.sh"
"publish-storybook": "bash ./.scripts/publish_storybook.sh"
},
"devDependencies": {
"@kadira/storybook": "^1.19.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const ShortcutsHelp = ({ isOpen, onClose, platform }) => (
isOpen = {isOpen}
onRequestClose = {onClose}
style = {modalStyles}
contentLabel = 'Shortcuts'
contentLabel = "Shortcuts"
>
<Shortcuts appShortcuts = {getShortcuts(platform)} />
</ReactModal>
Expand Down
11 changes: 11 additions & 0 deletions scripts/travis/after_success.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "We are in a pull request, not releasing"
exit 0
fi

if [[ $TRAVIS_BRANCH == 'master' ]]; then
# npm run semantic-release
fi
38 changes: 38 additions & 0 deletions scripts/travis/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
set -e
# Note: do not do set -x or the passwords will leak!

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "We are in a pull request, not setting up release"
exit 0
fi

if [[ $TRAVIS_BRANCH == 'master' ]]; then
# rm -rf .git
# git init
# git clean -dfx
# git remote add origin https://github.com/atlassian/lerna-semantic-release.git
# git fetch origin
# git clone https://github.com/$TRAVIS_REPO_SLUG.git $TRAVIS_REPO_SLUG
# git checkout $TRAVIS_BRANCH
#
# git config credential.helper store
# echo "https://${RELEASE_GH_USERNAME}:${RELEASE_GH_TOKEN}@github.com/atlassian/lerna-semantic-release.git" > ~/.git-credentials
#
# npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN -q
# npm prune
#
# git config --global user.email "design-platform@atlassian.com"
# git config --global user.name "Design Platform"
# git config --global push.default simple
#
# git fetch --tags
# git branch -u origin/$TRAVIS_BRANCH
# git fsck --full #debug
# echo "npm whoami"
# npm whoami #debug
# echo "git config --list"
# git config --list #debug
echo "We are on master"
exit 0
fi

0 comments on commit 72a6af5

Please sign in to comment.