mirror of
https://github.com/strapi/strapi.git
synced 2025-10-14 17:43:01 +00:00
Build documentation with Travis it works as expected
This commit is contained in:
parent
f9666f21cb
commit
364e6c39ad
@ -20,4 +20,5 @@ install:
|
|||||||
- npm run setup
|
- npm run setup
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
- npm run doc
|
||||||
- npm run test
|
- npm run test
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
"eslint-plugin-jsx-a11y": "^2.2.3",
|
"eslint-plugin-jsx-a11y": "^2.2.3",
|
||||||
"eslint-plugin-react": "^6.8.0",
|
"eslint-plugin-react": "^6.8.0",
|
||||||
"eslint-plugin-redux-saga": "^0.3.0",
|
"eslint-plugin-redux-saga": "^0.3.0",
|
||||||
|
"gitbook-cli": "^2.3.2",
|
||||||
"istanbul": "~0.4.2",
|
"istanbul": "~0.4.2",
|
||||||
"lerna": "^2.0.0",
|
"lerna": "^2.0.0",
|
||||||
"mocha": "~2.4.5",
|
"mocha": "~2.4.5",
|
||||||
@ -23,6 +24,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "npm run removesymlinkdependencies && rm -rf package-lock.json && rm -rf packages/*/package-lock.json",
|
"clean": "npm run removesymlinkdependencies && rm -rf package-lock.json && rm -rf packages/*/package-lock.json",
|
||||||
"clean:all": "npm run removesymlinkdependencies && rm -rf package-lock.json && rm -rf packages/*/package-lock.json && rm -rf packages/*/node_modules",
|
"clean:all": "npm run removesymlinkdependencies && rm -rf package-lock.json && rm -rf packages/*/package-lock.json && rm -rf packages/*/node_modules",
|
||||||
|
"doc": "node ./scripts/documentation.js",
|
||||||
"release": "npm run clean:all && npm install && npm run createsymlinkdependencies && lerna exec --concurrency 1 -- npm install && npm run removesymlinkdependencies && node ./scripts/publish.js $TAG",
|
"release": "npm run clean:all && npm install && npm run createsymlinkdependencies && lerna exec --concurrency 1 -- npm install && npm run removesymlinkdependencies && node ./scripts/publish.js $TAG",
|
||||||
"createsymlinkdependencies": "node ./scripts/createSymlinkDependencies.js",
|
"createsymlinkdependencies": "node ./scripts/createSymlinkDependencies.js",
|
||||||
"removesymlinkdependencies": "node ./scripts/removeSymlinkDependencies.js",
|
"removesymlinkdependencies": "node ./scripts/removeSymlinkDependencies.js",
|
||||||
@ -56,6 +58,5 @@
|
|||||||
"node": ">= 7.0.0",
|
"node": ">= 7.0.0",
|
||||||
"npm": ">= 3.0.0"
|
"npm": ">= 3.0.0"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT"
|
||||||
"dependencies": {}
|
|
||||||
}
|
}
|
||||||
|
23
scripts/documentation.js
Normal file
23
scripts/documentation.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
const _ = require('lodash');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const shell = require('shelljs');
|
||||||
|
|
||||||
|
try {
|
||||||
|
const versions = fs.readdirSync(path.resolve(process.cwd(), 'docs'), 'utf8');
|
||||||
|
|
||||||
|
_.forEach(versions, (version) => {
|
||||||
|
console.log(`Strapi install plugins version ${version}`);
|
||||||
|
shell.exec(`${path.join(process.cwd(), 'node_modules', '.bin', 'gitbook')} install ${path.join(process.cwd(), 'docs', version)}`);
|
||||||
|
console.log(`Strapi build version ${version}`);
|
||||||
|
shell.exec(`${path.join(process.cwd(), 'node_modules', '.bin', 'gitbook')} build ${path.join(process.cwd(), 'docs', version)}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('Documentation has been built with success');
|
||||||
|
} catch (err) {
|
||||||
|
if (err.stdout) {
|
||||||
|
return console.log(err.stdout.toString('utf8'));
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(err);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user