Merge pull request #3188 from normanjaeckel/Yarn
Switched from npm to Yarn. Closed #3012.
This commit is contained in:
commit
7d0ce465f4
12
.travis.yml
12
.travis.yml
@ -1,10 +1,8 @@
|
|||||||
language: python
|
language: python
|
||||||
sudo: false
|
sudo: false
|
||||||
cache:
|
cache:
|
||||||
directories:
|
pip: true
|
||||||
- node_modules
|
yarn: true
|
||||||
- $HOME/virtualenv/python$TRAVIS_PYTHON_VERSION/lib/python$TRAVIS_PYTHON_VERSION/site-packages/
|
|
||||||
- $HOME/virtualenv/python$TRAVIS_PYTHON_VERSION/bin/
|
|
||||||
python:
|
python:
|
||||||
- "3.4"
|
- "3.4"
|
||||||
- "3.5"
|
- "3.5"
|
||||||
@ -13,11 +11,13 @@ env:
|
|||||||
- TRAVIS_NODE_VERSION="4"
|
- TRAVIS_NODE_VERSION="4"
|
||||||
before_install:
|
before_install:
|
||||||
- nvm install $TRAVIS_NODE_VERSION
|
- nvm install $TRAVIS_NODE_VERSION
|
||||||
|
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||||
|
- export PATH="$HOME/.yarn/bin:$PATH"
|
||||||
install:
|
install:
|
||||||
- pip install --upgrade setuptools
|
- pip install --upgrade setuptools pip
|
||||||
- pip install --upgrade --requirement requirements.txt
|
- pip install --upgrade --requirement requirements.txt
|
||||||
- pip freeze
|
- pip freeze
|
||||||
- npm install
|
- yarn
|
||||||
- node_modules/.bin/gulp --production
|
- node_modules/.bin/gulp --production
|
||||||
script:
|
script:
|
||||||
- flake8 openslides tests
|
- flake8 openslides tests
|
||||||
|
@ -46,6 +46,9 @@ Core:
|
|||||||
General:
|
General:
|
||||||
- Several bugfixes and minor improvements.
|
- Several bugfixes and minor improvements.
|
||||||
|
|
||||||
|
Other:
|
||||||
|
- Switched from npm to Yarn.
|
||||||
|
|
||||||
|
|
||||||
Version 2.1.1 (2017-04-05)
|
Version 2.1.1 (2017-04-05)
|
||||||
==========================
|
==========================
|
||||||
|
@ -16,14 +16,18 @@ a. Check requirements
|
|||||||
'''''''''''''''''''''
|
'''''''''''''''''''''
|
||||||
|
|
||||||
Make sure that you have installed `Python (>= 3.4) <https://www.python.org/>`_,
|
Make sure that you have installed `Python (>= 3.4) <https://www.python.org/>`_,
|
||||||
`Node.js (>=4.x) <https://nodejs.org/>`_, `npm - Node Package Manager (>=3.x)
|
`Node.js (>=4.x) <https://nodejs.org/>`_, `Yarn <https://yarnpkg.com/>`_ and
|
||||||
<https://npmjs.org/>`_ and `Git <http://git-scm.com/>`_ on your system. You also
|
`Git <http://git-scm.com/>`_ on your system. You also need build-essential
|
||||||
need build-essential packages and header files and a static library for Python.
|
packages and header files and a static library for Python.
|
||||||
|
|
||||||
For Ubuntu 16.04 e. g. run::
|
For Ubuntu 16.04 e. g. follow `Yarn installation instructions
|
||||||
|
<https://yarnpkg.com/en/docs/install>`_ and run::
|
||||||
|
|
||||||
$ sudo apt-get install git nodejs nodejs-legacy npm build-essential python3-dev
|
$ sudo apt-get install git nodejs nodejs-legacy npm build-essential python3-dev
|
||||||
|
|
||||||
|
*Note: For Ubuntu 14.04 you have to update Node.js before. The distribution
|
||||||
|
version is 0.10.25 which is not sufficient.*
|
||||||
|
|
||||||
|
|
||||||
b. Get OpenSlides source code
|
b. Get OpenSlides source code
|
||||||
'''''''''''''''''''''''''''''
|
'''''''''''''''''''''''''''''
|
||||||
@ -49,9 +53,9 @@ Install all required Python packages::
|
|||||||
|
|
||||||
$ pip install --requirement requirements.txt
|
$ pip install --requirement requirements.txt
|
||||||
|
|
||||||
Install all NPM and Bower packages and run several JavaScript build tasks::
|
Install all Node.js and Bower packages and run several JavaScript build tasks::
|
||||||
|
|
||||||
$ npm install
|
$ yarn
|
||||||
|
|
||||||
Optional: To enhance performance run Gulp in production mode::
|
Optional: To enhance performance run Gulp in production mode::
|
||||||
|
|
||||||
|
21
Dockerfile
21
Dockerfile
@ -1,34 +1,37 @@
|
|||||||
FROM python:3.5
|
FROM python:3.5
|
||||||
RUN apt-get -y update && apt-get -y upgrade
|
RUN apt-get -y update && apt-get -y upgrade
|
||||||
|
|
||||||
RUN apt-get install -y libpq-dev supervisor
|
RUN apt-get install -y libpq-dev supervisor curl
|
||||||
## BUILD JS STUFF
|
## BUILD JS STUFF
|
||||||
RUN cd /tmp
|
RUN wget https://nodejs.org/dist/v4.5.0/node-v4.5.0-linux-x64.tar.xz -P /tmp
|
||||||
RUN wget https://nodejs.org/dist/v4.5.0/node-v4.5.0-linux-x64.tar.xz
|
RUN cd /tmp && tar xfvJ node-v4.5.0-linux-x64.tar.xz
|
||||||
RUN cd /tmp && tar xfvJ /node-v4.5.0-linux-x64.tar.xz
|
|
||||||
RUN ln -sf /tmp/node-v4.5.0-linux-x64/bin/node /usr/bin/node
|
RUN ln -sf /tmp/node-v4.5.0-linux-x64/bin/node /usr/bin/node
|
||||||
RUN useradd -m openslides
|
RUN useradd -m openslides
|
||||||
RUN mkdir /app && chown openslides /app
|
RUN mkdir /app
|
||||||
ADD package.json /app
|
ADD package.json /app
|
||||||
|
ADD yarn.lock /app
|
||||||
ADD bower.json /app
|
ADD bower.json /app
|
||||||
|
ADD gulpfile.js /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN /tmp/node-v4.5.0-linux-x64/bin/npm install; exit 0 #ignore errors in npm scripts
|
RUN chown -R openslides /app
|
||||||
RUN su -c 'node_modules/.bin/bower --config.interactive=false install' openslides
|
USER openslides
|
||||||
|
RUN curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||||
|
RUN $HOME/.yarn/bin/yarn --non-interactive
|
||||||
|
|
||||||
# INSTALL PYTHON DEPENDENCIES
|
# INSTALL PYTHON DEPENDENCIES
|
||||||
|
USER root
|
||||||
ADD requirements_production.txt /app/requirements_production.txt
|
ADD requirements_production.txt /app/requirements_production.txt
|
||||||
RUN pip install -r /app/requirements_production.txt
|
RUN pip install -r /app/requirements_production.txt
|
||||||
RUN pip install django-redis asgi-redis django-redis-sessions psycopg2
|
RUN pip install django-redis asgi-redis django-redis-sessions psycopg2
|
||||||
|
|
||||||
## Clean up
|
## Clean up
|
||||||
RUN apt-get remove -y python3-pip wget
|
RUN apt-get remove -y python3-pip wget curl
|
||||||
RUN rm -rf /var/lib/apt/lists/*
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# BUILD APP
|
# BUILD APP
|
||||||
ADD . /app
|
ADD . /app
|
||||||
|
|
||||||
RUN node_modules/.bin/gulp --production
|
RUN node_modules/.bin/gulp --production
|
||||||
RUN rm -fr /tmp/node-v4.5.0-linux-x64/
|
|
||||||
RUN rm -fr /app/bower_components
|
RUN rm -fr /app/bower_components
|
||||||
RUN rm -fr /app/node_modules
|
RUN rm -fr /app/node_modules
|
||||||
|
|
||||||
|
@ -12,10 +12,6 @@
|
|||||||
* for production mode.
|
* for production mode.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TODO: Remove the next line when support for Node 0.10.x is dropped.
|
|
||||||
// See https://github.com/postcss/postcss#nodejs-010-and-the-promise-api
|
|
||||||
require('es6-promise').polyfill();
|
|
||||||
|
|
||||||
var argv = require('yargs').argv,
|
var argv = require('yargs').argv,
|
||||||
gulp = require('gulp'),
|
gulp = require('gulp'),
|
||||||
concat = require('gulp-concat'),
|
concat = require('gulp-concat'),
|
||||||
@ -26,7 +22,6 @@ var argv = require('yargs').argv,
|
|||||||
jshint = require('gulp-jshint'),
|
jshint = require('gulp-jshint'),
|
||||||
mainBowerFiles = require('main-bower-files'),
|
mainBowerFiles = require('main-bower-files'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
rename = require('gulp-rename'),
|
|
||||||
sourcemaps = require('gulp-sourcemaps'),
|
sourcemaps = require('gulp-sourcemaps'),
|
||||||
templateCache = require('gulp-angular-templatecache'),
|
templateCache = require('gulp-angular-templatecache'),
|
||||||
through = require('through2'),
|
through = require('through2'),
|
||||||
|
46
package.json
46
package.json
@ -5,31 +5,27 @@
|
|||||||
"prepublish": "bower install && gulp"
|
"prepublish": "bower install && gulp"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"angular-mocks": "~1.5.7",
|
"angular-mocks": "~1.5.11",
|
||||||
"bower": "~1.7.2",
|
"bower": "^1.8.0",
|
||||||
"es6-promise": "~3.0.2",
|
"gulp": "^3.9.1",
|
||||||
"gulp": "~3.9.0",
|
"gulp-angular-gettext": "^2.2.0",
|
||||||
"gulp-angular-gettext": "~2.1.0",
|
|
||||||
"gulp-angular-templatecache": "^2.0.0",
|
"gulp-angular-templatecache": "^2.0.0",
|
||||||
"gulp-concat": "~2.6.0",
|
"gulp-concat": "^2.6.1",
|
||||||
"gulp-cssnano": "~2.1.0",
|
"gulp-cssnano": "^2.1.2",
|
||||||
"gulp-if": "~2.0.0",
|
"gulp-if": "^2.0.2",
|
||||||
"gulp-inject-string": "~1.1.0",
|
"gulp-inject-string": "^1.1.0",
|
||||||
"gulp-jshint": "~2.0.0",
|
"gulp-jshint": "^2.0.4",
|
||||||
"gulp-rename": "~1.2.2",
|
"gulp-sourcemaps": "^2.5.0",
|
||||||
"gulp-sourcemaps": "~1.6.0",
|
"gulp-uglify": "^2.1.2",
|
||||||
"gulp-uglify": "~1.5.2",
|
"jasmine-core": "^2.5.2",
|
||||||
"jasmine": "~2.4.1",
|
"jshint": "^2.9.4",
|
||||||
"jshint": "~2.9.2",
|
"karma": "^1.5.0",
|
||||||
"karma": "~1.1.0",
|
"karma-chrome-launcher": "^2.0.0",
|
||||||
"karma-chrome-launcher": "~1.0.1",
|
"karma-jasmine": "^1.1.0",
|
||||||
"karma-phantomjs-launcher": "~1.0.0",
|
"karma-phantomjs-launcher": "^1.0.4",
|
||||||
"karma-jasmine": "~1.0.2",
|
"main-bower-files": "^2.13.1",
|
||||||
"main-bower-files": "~2.11.1",
|
"sprintf-js": "^1.0.3",
|
||||||
"phantomjs-prebuilt": "~2.1.14",
|
"through2": "^2.0.3",
|
||||||
"po2json": "~0.4.1",
|
"yargs": "^7.0.2"
|
||||||
"sprintf-js": "~1.0.3",
|
|
||||||
"through2": "~2.0.0",
|
|
||||||
"yargs": "~3.32.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user