Make the easiest installation as possible

This commit is contained in:
Aurélien Georget 2016-12-07 13:19:01 +01:00
parent 9fe12ce4b6
commit 576a1903ec
5 changed files with 67 additions and 49 deletions

View File

@ -5,58 +5,18 @@ git:
language: node_js
cache:
yarn: true
directories:
- node_modules
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
install:
- cd packages/strapi-utils
- npm link
- cd ../strapi-mongoose
- npm link strapi-utils
- npm link
- cd ../strapi-bookshelf
- npm link strapi-utils
- npm link
- cd ../strapi-generate-migrations
- npm link strapi-bookshelf
- npm link strapi-utils
- npm link
- cd ../strapi-generate
- npm link strapi-utils
- npm link
- cd ../strapi-generate-admin
- npm link strapi-utils
- npm link
- cd ../strapi-generate-api
- npm link
- cd ../strapi-generate-policy
- npm link
- cd ../strapi-generate-service
- npm link
- cd ../strapi-generate-new
- npm link strapi-utils
- npm link
- cd ../strapi
- npm link strapi-generate-new
- npm link strapi-generate
- npm link strapi-generate-admin
- npm link strapi-generate-api
- npm link strapi-generate-policy
- npm link strapi-generate-service
- npm link strapi-generate-migrations
- npm link strapi-mongoose
- npm link strapi-utils
- npm install
- cd ./node_modules/koa-joi-router
- sed -i.bu 's/await-busboy/co-busboy/' joi-router.js
- npm install co-busboy
- cd ..
- cd ..
- cd ..
- cd ..
- npm install
- yarn run setup
node_js:
- "7"
@ -64,4 +24,4 @@ node_js:
sudo: false
script:
- npm test
- yarn run test

View File

@ -12,3 +12,6 @@ test: lint
docs:
mkdocs build --clean
setup:
./scripts/setup.sh

View File

@ -48,7 +48,8 @@
}
},
"scripts": {
"test": "make test"
"test": "make test",
"setup": "make setup"
},
"author": {
"email": "hi@strapi.io",

View File

@ -32,7 +32,7 @@ module.exports = strapi => {
initialize: cb => {
if (strapi.config.static === true) {
const isIndexRoute = strapi.config.routes.find(route => route.path === '/');
const isIndexRoute = _.isEmpty(strapi.config.routes) ? false : strapi.config.routes.find(route => route.path === '/');
strapi.app.use(strapi.middlewares.convert(strapi.middlewares.betterStatic(path.resolve(strapi.config.appPath, strapi.config.paths.static), {
index: isIndexRoute ? false : 'index.html',

54
scripts/setup.sh Executable file
View File

@ -0,0 +1,54 @@
#!/bin/sh
set -e
cd packages/strapi-utils
npm link
cd ../strapi-mongoose
npm link strapi-utils
npm link
cd ../strapi-bookshelf
npm link strapi-utils
npm link
cd ../strapi-generate-migrations
npm link strapi-bookshelf
npm link strapi-utils
npm link
cd ../strapi-generate
npm link strapi-utils
npm link
cd ../strapi-generate-admin
npm link strapi-utils
npm link
cd files/admin/public
npm install
npm run build
cd ../../../
cd ../strapi-generate-api
npm link
cd ../strapi-generate-policy
npm link
cd ../strapi-generate-service
npm link
cd ../strapi-generate-new
npm link strapi-utils
npm link
cd ../strapi
npm link strapi-generate-new
npm link strapi-generate
npm link strapi-generate-admin
npm link strapi-generate-api
npm link strapi-generate-policy
npm link strapi-generate-service
npm link strapi-generate-migrations
npm link strapi-mongoose
npm link strapi-utils
npm install
npm link
cd ./node_modules/koa-joi-router
sed -i.bu 's/await-busboy/co-busboy/' joi-router.js
npm install co-busboy
cd ..
cd ..
cd ..
cd ..
npm install