Added before install to travis for stopping build if only docs changed

This commit is contained in:
Syrus Akbary 2015-11-25 21:00:13 -08:00
parent e55d230faf
commit 2574ee2976
4 changed files with 20 additions and 12 deletions

View File

@ -12,19 +12,27 @@ cache:
- $HOME/.cache/pip - $HOME/.cache/pip
- docs/node_modules/ - docs/node_modules/
- $HOME/docs/node_modules - $HOME/docs/node_modules
- $(npm config get prefix)/bin/gatsby before_install:
- |
if [ "$TEST_TYPE" != build_website ] && \
! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs))/'
then
echo "Only docs were updated, stopping build process."
exit
fi
install: install:
- | - |
if [ "$TEST_TYPE" = build ]; then if [ "$TEST_TYPE" = build ]; then
pip install --download-cache $HOME/.cache/pip/ pytest pytest-cov coveralls six pytest-django pip install --download-cache $HOME/.cache/pip/ pytest pytest-cov coveralls six pytest-django
pip install --download-cache $HOME/.cache/pip/ -e .[django] pip install --download-cache $HOME/.cache/pip/ -e .[django]
python setup.py develop python setup.py develop
elif [ "$TEST_TYPE" = lint ]; then elif [ "$TEST_TYPE" = lint ]; then
pip install --download-cache $HOME/.cache/pip/ flake8 pip install --download-cache $HOME/.cache/pip/ flake8
fi fi
script: script:
- | - |
if [ "$TEST_TYPE" = build_website ]; then if [ "$TEST_TYPE" = build_website ]; then
if [ "$TRAVIS_BRANCH" = "docs" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
echo "Building the web." echo "Building the web."
nvm install 4.0 nvm install 4.0
@ -44,12 +52,13 @@ script:
git push "https://${GITHUB_TOKEN}@github.com/graphql-python/graphene.git" gh-pages-seg git push "https://${GITHUB_TOKEN}@github.com/graphql-python/graphene.git" gh-pages-seg
fi fi
exit exit
fi
elif [ "$TEST_TYPE" = lint ]; then elif [ "$TEST_TYPE" = lint ]; then
echo "Checking Python code lint." echo "Checking Python code lint."
flake8 flake8
exit exit
elif [ "$TEST_TYPE" = build ]; then elif [ "$TEST_TYPE" = build ]; then
py.test --cov=graphene py.test --cov=graphene
fi fi
after_success: after_success:
- | - |

View File

@ -5,7 +5,7 @@
"main": "n/a", "main": "n/a",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"build": "npm install -g gatsby && npm install && gatsby build", "build": "npm install && ./node_modules/.bin/gatsby build",
"deploy": "npm run build" "deploy": "npm run build"
}, },
"keywords": [ "keywords": [
@ -15,6 +15,7 @@
"dependencies": { "dependencies": {
"copy-webpack-plugin": "^0.2.0", "copy-webpack-plugin": "^0.2.0",
"extract-text-webpack-plugin": "^0.9.1", "extract-text-webpack-plugin": "^0.9.1",
"gatsby": "^0.7.2",
"jeet": "^6.1.2", "jeet": "^6.1.2",
"lodash": "^3.10.1", "lodash": "^3.10.1",
"nib": "^1.1.0", "nib": "^1.1.0",

View File

@ -6,7 +6,6 @@ if (IN_BROWSER) {
navigator.userAgent && !navigator.userAgent.match('CriOS'); navigator.userAgent && !navigator.userAgent.match('CriOS');
var browser_supported = !isSafari; var browser_supported = !isSafari;
} }
console.log(browser_supported);
if (IN_BROWSER && browser_supported) { if (IN_BROWSER && browser_supported) {
var glfx = require('../vendor/glfx.optim') var glfx = require('../vendor/glfx.optim')
var particlesJS = require('../vendor/particles.js') var particlesJS = require('../vendor/particles.js')

View File

@ -1,7 +1,6 @@
// React patched version for render in server side always with same ids // React patched version for render in server side always with same ids
if (typeof window === "undefined") { if (typeof window === "undefined") {
var ServerReactRootIndex = require('react/lib/ServerReactRootIndex'); var ServerReactRootIndex = require('react/lib/ServerReactRootIndex');
console.log(ServerReactRootIndex);
ServerReactRootIndex.createReactRootIndex = function(){ ServerReactRootIndex.createReactRootIndex = function(){
return "graphene"; return "graphene";
}; };