Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Sendra committed Oct 7, 2016
2 parents bfbde79 + a82e617 commit 552ee01
Show file tree
Hide file tree
Showing 166 changed files with 3,907 additions and 1,082 deletions.
2 changes: 1 addition & 1 deletion .bowerrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"directory": "static/bower_components"
"directory": "bower_components"
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ test/e2e/reports
.idea
dump/
docker-compose-custom.yml
static/bower_components
bower_components
phantomjsdriver.log
*.sublime-*
39 changes: 31 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
sudo: required
dist: trusty
services:
- docker

sudo: false
#dist: trusty
language: node_js
node_js:
- 4.2.6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- g++-4.9
#services:
#- docker
env:
COMPOSE_VERSION: 1.2.0
global:
- secure: IVNUEIDEb4Uh/5T+SXIrPuQV8x33Kzhf9oE4hIdsSQFKDNqophryVpSo3Xg34SX1ZViVau9TU8ec2E3zTxPSDyeW5Emfo7Xhzf/6oUQaN3OW+xi1HSCUGg7Tq5jIdRDnVXgFnWLl2fRoGtOrz5lfvQ5e3q6+EpCPyVDUpEjlVNDTibWvibKj4d5BR349THpOeGOUbzr87uke1TOxBkbsceVt55G3xyYRNI6DfLg4MjqaYLzhf5WnduwZc5RyZLFC5EHEhvxRy0BOfbpF20NBva05qjO1GcuNaHPfJhuuQcsaSAGmzHXi67QvDAjmCLLd7lA5HwCC2+51CGccw/CqnM64cZIJVMZnh68wd9gRHszKU8VhMx8K2eNPcGa5WTER+ald5pK2XBycm/fUNPTy/3zf30Svk5l9pyuT22WepGHmWrPxU3HzxpyGE0zPcPmzVjl23J40PBIHAHt3p2yoX2fQOKsA7c7dci6lcgX/aO3g6UGY8nd8OtEmeP9FybgVgNqJGdQP6gtT7rk6zf0lStbkC0RWu52GvLxTLthDgaQkqOFjwc0tVDYydsNZ/n046uDXw1eytt8lJT7ayu0+mnT2jzsLBvCDia1uwVRr5zHZUAuYHk+P5FM7yMjv5BaMwMbnSxU1AgIe+n0ojeb/f5wuKMBbGXTReyszPrXq/AY=

before_install:
- export CC="gcc-4.9" CXX="g++-4.9"
before_script:
- "curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash"

- npm install -g bower
#- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash
script:
- docker-compose -f docker-compose/test.yml run backoffice
- ./docker-compose/run-test.sh
#script:
#- docker-compose -f docker-compose/test.yml run backoffice

deploy:
provider: releases
api_key: ${GH_TOKEN}
file: "kuzzle-backoffice.tar"
skip_cleanup: true
on:
branch: master
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM kuzzleio/bo-base:alpine
MAINTAINER Kuzzle <[email protected]>

ADD ./docker-compose /
ADD ./ /var/app

RUN cd /var/app && \
npm install && \
bower install --allow-root && \
npm run build
npm run build && \
rm -rf node_modules && \
npm install http-server

RUN chmod 755 /*.sh
CMD ["/run-prod.sh"]
CMD ["npm", "start"]
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Releases mapping
| Back-office | Kuzzle |
|---|---|
| 1.1.0 | 1.0.0-RC7 |
| 1.0.0 | 1.0.0-RC6 |


Expand Down Expand Up @@ -39,9 +40,9 @@ If you already have a Kuzzle stack running somewhere, be sure your Kuzzle Proxy

```
$ docker pull kuzzleio/backoffice
$ docker run -p 3000:3000 -e "BACKEND_HOST=<BACKEND_HOST>" kuzzleio/backoffice
$ docker run -p 3000:3000 -e "BACKOFFICE_PORT=3000" kuzzleio/backoffice
```
>Where `BACKEND_HOST` _(default: localhost)_ is the Kuzzle Proxy IP. You can also override `BACKEND_IOPORT` _(default: 7512)_ and `BACKEND_WSPORT` _(default: 7513)_ corresponding to Proxy sockets ports and `BACKOFFICE_PORT` _(default: 3000)_ corresponding to the port for accessing to the Back-office.
>`BACKOFFICE_PORT` _(default: 3000)_ corresponding to the port for accessing to the Back-office.
## Without Docker
Be sure to have node v4.4 and bower installed.
Expand All @@ -56,17 +57,16 @@ At this point you can choose whether to run with the embed server or without:

### With the embed server
```
$ BACKEND_HOST=<BACKEND_HOST> npm run prod
$ npm run build && BACKOFFICE_PORT=3000 npm start
```
>Where `BACKEND_HOST` _(default: localhost)_ is the Kuzzle Proxy IP. You can also override `BACKEND_IOPORT` _(default: 7512)_ and `BACKEND_WSPORT` _(default: 7513)_ corresponding to Proxy sockets ports and `BACKOFFICE_PORT` _(default: 3000)_ corresponding to the port for accessing to the Back-office.
>`BACKOFFICE_PORT` _(default: 3000)_ corresponding to the port for accessing to the Back-office.
You can now access `http://<back-office-ip>:<BACKOFFICE_PORT>`

### Without the server
You can choose to only build the `dist/` folder and access it with your own server:
```
$ BACKEND_HOST=<BACKEND_HOST> npm run build
$ npm run build
```
>Where `BACKEND_HOST` _(default: localhost)_ is the Kuzzle Proxy IP. You can also override `BACKEND_IOPORT` _(default: 7512)_ and `BACKEND_WSPORT` _(default: 7513)_ corresponding to Proxy sockets port.

The `dist` folder is now generated. In order to let this folder be accessible from your browser without CSRF error, you have to create a server web (like with nginx).
The `dist` folder is now generated. You can either open the `index.html` file or in order to prevent CSRF error, you can create a web server (like with nginx).
21 changes: 9 additions & 12 deletions build/build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// https://github.com/shelljs/shelljs
/* eslint-disable */
require('shelljs/global')
env.NODE_ENV = 'production'

Expand All @@ -8,12 +9,6 @@ var ora = require('ora')
var webpack = require('webpack')
var webpackConfig = require('./webpack.prod.conf')

console.log(
' Tip:\n' +
' Built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
)

var spinner = ora('building for production...')
spinner.start()

Expand All @@ -22,14 +17,16 @@ rm('-rf', assetsPath)
mkdir('-p', assetsPath)
cp('-R', 'static/*', assetsPath)

cp('-R', path.join('bower_components', 'ace-builds', 'src-min-noconflict', 'worker-json.js'), path.join(assetsPath, '..'))

webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n')
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n')
})
10 changes: 3 additions & 7 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = {
test: /\.js$/,
loader: 'eslint',
include: projectRoot,
exclude: /node_modules/
exclude: /(node_modules|bower_components)/
}
],
loaders: [
Expand All @@ -49,7 +49,7 @@ module.exports = {
test: /\.js$/,
loader: 'babel',
include: projectRoot,
exclude: /node_modules/
exclude: /(node_modules|bower_components)/
},
{
test: /\.json$/,
Expand All @@ -69,11 +69,7 @@ module.exports = {
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url',
query: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
loader: 'url'
}
]
},
Expand Down
9 changes: 2 additions & 7 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module.exports = {
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true,
assetsPublicPath: '',
productionSourceMap: false,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
Expand All @@ -21,10 +21,5 @@ module.exports = {
port: 3000,
host: 'localhost',
proxyTable: {}
},
backend: {
host: process.env.BACKEND_HOST || 'localhost',
ioPort: process.env.BACKEND_IOPORT || 7512,
wsPort: process.env.BACKEND_WSPORT || 7513
}
}
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ backoffice:
- BACKEND_PORT
ports:
- 3000:3000
environments:
- BACKOFFICE_PORT

kuzzle:
image: kuzzleio/kuzzle:1.0.0-RC6
Expand Down
5 changes: 0 additions & 5 deletions docker-compose/run-prod.sh

This file was deleted.

31 changes: 20 additions & 11 deletions docker-compose/run-test.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/sh
set -e
kuzzle=${KUZZLE_HOST:-kuzzle:7511}
#kuzzle=${KUZZLE_HOST:-kuzzle:7511}

echo "Installing dependencies..."
npm install
bower install --allow-root
bower install --allow-root --no-interactive

echo "Starting Tests..."

Xvfb :10 -ac &
export DISPLAY=:10
#Xvfb :10 -ac &
#export DISPLAY=:10

# Launch unit tests as soon as possible
npm run unit
return_value=$?
#return_value=$?

npm run codecov

Expand All @@ -29,13 +29,22 @@ npm run codecov
# return_value=$?
#fi

if [ $return_value -gt 0 ]; then
echo "Tests exited with errors. Dumping the state of the system..."
mkdir /var/app/dump
curl -XGET http://elasticsearch:9200/kuzzle-bo-testindex/_search/?size=1000 -o /var/app/dump/kuzzle-bo-testindex.json
curl -XGET http://elasticsearch:9200/%25kuzzle/_search/?size=1000 -o /var/app/dump/kuzzle.json
#if [ $return_value -gt 0 ]; then
# echo "Tests exited with errors. Dumping the state of the system..."
# mkdir /var/app/dump
# curl -XGET http://elasticsearch:9200/kuzzle-bo-testindex/_search/?size=1000 -o /var/app/dump/kuzzle-bo-testindex.json
# curl -XGET http://elasticsearch:9200/%25kuzzle/_search/?size=1000 -o /var/app/dump/kuzzle.json
#fi

if [ "${TRAVIS_BRANCH}" = "master" ]
then
echo "Building dist file"
npm run build
echo "Creating archive"
tar -cvf kuzzle-backoffice.tar dist
chmod 777 kuzzle-backoffice.tar
fi

echo "We're done here!"

exit $return_value
#exit $return_value
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<meta charset="utf-8">
<title>kuzzle-backoffice</title>
<style>.app-loading{position:fixed;top:0;left:0;bottom:0;right:0;padding-top:50px;height:100%;overflow:auto}html{background-color:#F5F5F5}.app-loading>div{box-sizing:border-box;font-family:Arial,sans-serif;padding:30px 40px;width:400px;text-align:center;margin:0 auto;font-weight:400;left:50%;right:50%;display:block;background-color:#fff;transition:box-shadow .25s;border-radius:2px;box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12);font-size:20px}.app-loading .loader,.app-loading .loader:after,.app-loading .loader:before{border-radius:50%;width:2.5em;height:2.5em;-webkit-animation:load7 1.8s infinite ease-in-out;animation:load7 1.8s infinite ease-in-out}.app-loading .loader{color:#00757F;font-size:6px;margin:30px auto;position:relative;text-indent:-9999em;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation-delay:-.16s;animation-delay:-.16s}.app-loading .loader:before{left:-3.5em;-webkit-animation-delay:-.32s;animation-delay:-.32s}.app-loading .loader:after{left:3.5em}.app-loading .loader:after,.app-loading .loader:before{content:'';position:absolute;top:0}@-webkit-keyframes load7{0%,100%,80%{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}@keyframes load7{0%,100%,80%{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}</style>
<link rel="icon" href="static/favicon.ico" />
<link rel="icon" href="static/favicon.ico"><link rel="manifest" href="manifest.json">
</head>
<body>
<app>
Expand All @@ -15,6 +17,5 @@
</div>
</app>
<!-- built files will be auto injected -->
<script src="static/bower_components/ace-builds/src-noconflict/ace.js"></script>
</body>
</html>
9 changes: 9 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"short_name": "Back-office",
"name": "Kuzzle back-office",
"start_url": "./",
"display": "standalone",
"orientation": "portrait",
"theme_color": "#29BDBB",
"background_color": "#29BDBB"
}
Loading

0 comments on commit 552ee01

Please sign in to comment.