mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Enable Node 4.2 testing
* Do not error when node unsupported if GHOST_NODE_VERSION_CHECK=false is set * Run engine check in preinstall script * Add 4.2 to travis issue #5821
This commit is contained in:
parent
b64a0cc1f4
commit
faa1655a50
3 changed files with 18 additions and 17 deletions
|
@ -3,6 +3,7 @@ language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "0.10"
|
- "0.10"
|
||||||
- "0.12"
|
- "0.12"
|
||||||
|
- "4.2"
|
||||||
sudo: false
|
sudo: false
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
|
@ -14,6 +15,7 @@ addons:
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- GITHUB_OAUTH_KEY=003a44d58f12089d0c0261338298af3813330949
|
- GITHUB_OAUTH_KEY=003a44d58f12089d0c0261338298af3813330949
|
||||||
|
- GHOST_NODE_VERSION_CHECK=false
|
||||||
matrix:
|
matrix:
|
||||||
- DB=sqlite3 NODE_ENV=testing
|
- DB=sqlite3 NODE_ENV=testing
|
||||||
- DB=mysql NODE_ENV=testing-mysql
|
- DB=mysql NODE_ENV=testing-mysql
|
||||||
|
|
|
@ -19,19 +19,17 @@ checks = {
|
||||||
// Make sure the node version is supported
|
// Make sure the node version is supported
|
||||||
nodeVersion: function checkNodeVersion() {
|
nodeVersion: function checkNodeVersion() {
|
||||||
// Tell users if their node version is not supported, and exit
|
// Tell users if their node version is not supported, and exit
|
||||||
try {
|
|
||||||
var semver = require('semver');
|
var semver = require('semver');
|
||||||
if (!semver.satisfies(process.versions.node, packages.engines.node) &&
|
|
||||||
|
if (process.env.GHOST_NODE_VERSION_CHECK !== 'false' &&
|
||||||
|
!semver.satisfies(process.versions.node, packages.engines.node) &&
|
||||||
!semver.satisfies(process.versions.node, packages.engines.iojs)) {
|
!semver.satisfies(process.versions.node, packages.engines.iojs)) {
|
||||||
console.error('\x1B[31mERROR: Unsupported version of Node');
|
console.error('\x1B[31mERROR: Unsupported version of Node');
|
||||||
console.error('\x1B[31mGhost needs Node version ' + packages.engines.node +
|
console.error('\x1B[31mGhost needs Node version ' + packages.engines.node +
|
||||||
' you are using version ' + process.versions.node + '\033[0m\n');
|
' you are using version ' + process.versions.node + '\033[0m\n');
|
||||||
console.error('\x1B[32mPlease go to http://nodejs.org to get a supported version\033[0m');
|
console.error('\x1B[32mPlease go to http://nodejs.org to get a supported version or set GHOST_NODE_VERSION_CHECK=false\033[0m');
|
||||||
|
|
||||||
process.exit(0);
|
process.exit(1);
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -57,7 +55,7 @@ checks = {
|
||||||
console.error('\x1B[32mEnsure your config.js has a section for the current NODE_ENV value' +
|
console.error('\x1B[32mEnsure your config.js has a section for the current NODE_ENV value' +
|
||||||
' and is formatted properly.\033[0m');
|
' and is formatted properly.\033[0m');
|
||||||
|
|
||||||
process.exit(0);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -87,7 +85,7 @@ checks = {
|
||||||
console.error('\x1B[32m\nPlease run `npm install --production` and try starting Ghost again.');
|
console.error('\x1B[32m\nPlease run `npm install --production` and try starting Ghost again.');
|
||||||
console.error('\x1B[32mHelp and documentation can be found at http://support.ghost.org.\033[0m\n');
|
console.error('\x1B[32mHelp and documentation can be found at http://support.ghost.org.\033[0m\n');
|
||||||
|
|
||||||
process.exit(0);
|
process.exit(1);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Check content path permissions
|
// Check content path permissions
|
||||||
|
@ -131,7 +129,7 @@ checks = {
|
||||||
console.error(' ' + e.message);
|
console.error(' ' + e.message);
|
||||||
console.error('\n' + errorHelp);
|
console.error('\n' + errorHelp);
|
||||||
|
|
||||||
process.exit(0);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check each of the content path subdirectories
|
// Check each of the content path subdirectories
|
||||||
|
@ -153,7 +151,7 @@ checks = {
|
||||||
console.error(' ' + e.message);
|
console.error(' ' + e.message);
|
||||||
console.error('\n' + errorHelp);
|
console.error('\n' + errorHelp);
|
||||||
|
|
||||||
process.exit(0);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -201,7 +199,7 @@ checks = {
|
||||||
console.error('\n\x1B[32mCheck that the sqlite3 database file permissions allow read and write access.');
|
console.error('\n\x1B[32mCheck that the sqlite3 database file permissions allow read and write access.');
|
||||||
console.error('Help and documentation can be found at http://support.ghost.org.\033[0m');
|
console.error('Help and documentation can be found at http://support.ghost.org.\033[0m');
|
||||||
|
|
||||||
process.exit(0);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./core/index",
|
"main": "./core/index",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"preinstall": "npm install semver && node -e \"require('./core/server/utils/startup-check.js').nodeVersion()\"",
|
||||||
"start": "node index",
|
"start": "node index",
|
||||||
"test": "grunt validate --verbose"
|
"test": "grunt validate --verbose"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue