]> git.parisson.com Git - mezzo.git/commitdiff
Add all front tools to build it from app container, update doc
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 5 Dec 2016 14:21:26 +0000 (15:21 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 5 Dec 2016 14:21:48 +0000 (15:21 +0100)
12 files changed:
Dockerfile
bin/front_build.sh [new file with mode: 0644]
bin/upgrade.sh
debian-requirements.txt
doc/src/architecture.rst
doc/src/index.rst
doc/src/install.rst
doc/src/maintenance.rst
doc/src/overview.rst
doc/src/production.rst [deleted file]
doc/src/related.rst [deleted file]
etc/apt/sources.list

index b34446115133b5f9018f428958ee2fafe40f2e40..559e12493c28c215b731884cd9504b6d56d9739c 100644 (file)
@@ -4,13 +4,13 @@ ENV PYTHONUNBUFFERED 1
 
 RUN mkdir /srv/app
 RUN mkdir /srv/lib
-WORKDIR /srv/app
+WORKDIR /srv
 
 RUN apt-get update && apt-get install apt-transport-https
 COPY etc/apt/sources.list /etc/apt/
-COPY debian-requirements.txt /srv/app/
+COPY debian-requirements.txt /srv
 RUN apt-get update && \
-    DEBIAN_PACKAGES=$(egrep -v "^\s*(#|$)" debian-requirements.txt) && \
+    DEBIAN_PACKAGES=$(egrep -v "^\s*(#|$)" /srv/debian-requirements.txt) && \
     apt-get install -y --force-yes $DEBIAN_PACKAGES && \
     echo fr_FR.UTF-8 UTF-8 >> /etc/locale.gen && \
     locale-gen && \
@@ -20,10 +20,25 @@ ENV LANG fr_FR.UTF-8
 ENV LANGUAGE fr_FR:fr
 ENV LC_ALL fr_FR.UTF-8
 
-ADD requirements.txt /srv/app/
+COPY requirements.txt /srv
 RUN pip install -r requirements.txt
 
-ADD requirements-dev.txt /srv/app/
+COPY requirements-dev.txt /srv
 RUN pip install -r requirements-dev.txt --src /srv/lib
 
+COPY package.json /srv
+RUN npm install
+
+COPY Gemfile /srv
+RUN gem install bundler
+RUN bundle install
+
+COPY bower.json /srv
 RUN npm install -g bower
+RUN bower --allow-root install
+
+COPY gulpfile.js /srv
+RUN npm install -g gulp
+RUN gulp build
+
+WORKDIR /srv/app
diff --git a/bin/front_build.sh b/bin/front_build.sh
new file mode 100644 (file)
index 0000000..26da357
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+docker-compose run app bash -c "cd /srv && bower install && gulp build"
index f9870000d48a65944ea2aa7102bde12f7ab3c381..46fa0fb235936e25390d314e16c445540b98f029 100755 (executable)
@@ -1,12 +1,9 @@
 #!/bin/sh
 
-# Use this script to update a dev/prod server
-
 git pull
 git submodule foreach git pull
 docker-compose run app python /srv/app/manage.py migrate
 # docker-compose run app python /srv/app/manage.py update_translation_fields
-bower install
-gulp build
+docker-compose run app bash -c "cd /srv && bower install && gulp build"
 docker-compose run app python /srv/app/manage.py collectstatic --noinput
 docker-compose run app bash /srv/doc/build.sh
index 04c6b888f682286168fc39b54de4b8e184df28c5..aff02e3e5575fc8159ddcdba987a71686f0cfbcc 100644 (file)
@@ -3,9 +3,10 @@ wget
 bzip2
 build-essential
 netcat
-npm
+nodejs
 locales
 pandoc
-nodejs-legacy
 vim
 python-sphinx
+ruby
+ruby-dev
index 3435e3982528642e0912a58dcadc076389c60134..cd884fd8279f8da3582769c6482b74908d16f964 100644 (file)
@@ -46,25 +46,25 @@ Paths
         uwsgi logs (not versioned)
 
 - bower.json \
-    javascript dependencies (cf `Front`_ section)
+    javascript dependencies
 - debian-requirements.txt \
-    used by docker to install debian packages (cf `In case of broken app`_ section)
+    used by docker to install debian packages
 - docker-compose.yml \
-    description of all docker containers. This file is used by command "docker-compose" (cf `In case of broken app`_ section)
+    configuration file for docker containers used by docker-compose
 - Dockerfile \
-    instructions to build app image (cf `In case of broken app`_ section)
+    instructions to build the app image
 - Gemfile \
-    gem dependecies for ruby. For our case, it will install _Sass and _Compass. (cf `Front`_ section)
+    gem dependecies for ruby. For our case, it will install _Sass and _Compass.
 - gulpfile.js \
-    script to compile all css, js files (cf `Front`_ section)
+    script to compile all CSS and JS files
 - install.py \
-    cf section 'Install as a daemon' (cf `Install as a daemon`_ section)
+    daemon and init boot script installer (Linux only)
 - package.json \
-    gulp dependencies when running "gulp install" (cf `Front`_ section)
+    gulp dependencies when running "gulp install"
 - requirements-dev.txt \
-    application package in dev version (cf `In case of broken app`_ section)
+    application package in dev version
 - requirements.txt \
-    application package (cf `In case of broken app`_ section)
+    application package
 
 
 
@@ -93,3 +93,7 @@ Main modules embed in app/organization
     represent projects related to a team or a person
 - shop \
     manage product from prestashop (softwares and subscriptions), using _Cartridge
+
+
+.. _Compass : http://compass-style.org/
+.. _Sass: http://sass-lang.com/
index efb8c4b469dd8a3173f1472bd8daee4a321ffa7d..027cfaf2e8ab9eea536b7dccc8dcacc0ba65a975 100644 (file)
@@ -16,10 +16,9 @@ Contents:
    architecture
    install
    development
-   production
    maintenance
    copyright
-   licence
+   license
 
 Indices and tables
 ==================
index a7088c2ede0b109cc248dfe8a2ae97005fa19cb2..f35d8b2fc027c87c1c5d13f2c4ab6a0c45dd0d38 100644 (file)
@@ -14,55 +14,24 @@ Then run these commands::
     git clone --recursive https://github.com/Ircam-RnD/mezzanine-organization.git
 
 
-Compile static files
-+++++++++++++++++++++
-
-Gulp_ allow to compile scss to css, concatenate js files and has a watcher, who do this tasks on file change.
-Gulp_ require NodeJS_ installed on your computer to work.
-
-1. Install gulp globally::
-
-    sudo npm install --g gulp
-
-2. Install bower globally::
-
-    sudo npm install -g bower
-
-3. Install gulp dependencies::
-
-    npm install
-
-4. Install ruby dependencies::
-
-    sudo apt install ruby
-    sudo gem install bundler
-    bundle install
-
-5. Build::
-
-    bower install
-    gulp build
-
-
-/!\ If you have an issue with ffi module, try to install dev package from ruby::
-
-    apt-get install ruby-dev
-
-
 Start
 +++++
 
+Our docker composition already bundles some powerful containers and bleeding edge frameworks like: Nginx, MySQL, Redis, Celery, Django and Python. It thus provides a safe and continuous way to deploy your project from an early development stage to a massive production environment.
+
 For a production environment setup::
 
     cd mezzanine-organization
     docker-compose up
 
-which builds, (re)creates, starts, and attaches to containers.
+which builds, (re)creates, starts, and attaches all containers.
 
 Then browse the app at http://localhost:8020/
 
 On MacOS or Windows, we need to replace 'localhost' by the IP given by the docker terminal.
 
+.. warning :: Before any serious production usecase, you *must* modify all the passwords and secret keys in the configuration files of the sandbox.
+
 
 Daemonize
 +++++++++++
@@ -79,7 +48,7 @@ options::
     --systemd : use systemd
     --composition_file : the path of the YAML composition file to use (optional)
 
-This will install a init script in /etc/init.d. For example, if your app directory is named `mezzanine-organization`, `/etc/init.d/mezzanine-organization` becomes the init script for the OS booting procedure and for you if you need to start the daemon by hand::
+This will install a init script in /etc/init.d. For example, if your app directory is named `mezzanine-organization` then `/etc/init.d/mezzanine-organization` becomes the init script for the OS booting procedure and for you if you need to start the daemon by hand::
 
     sudo /etc/init.d/mezzanine-organization start
 
@@ -116,5 +85,3 @@ Prod
 .. _Gulp: http://gulpjs.com/
 .. _Mezzanine-Agenda : https://github.com/jpells/mezzanine-agenda
 .. _Cartridge : https://github.com/stephenmcd/cartridge/
-.. _Sass: http://sass-lang.com/
-.. _Compass : http://compass-style.org/
index 9c7b038a73b04a9ed2d623e910b30f478bb7014c..ce31678a5546ec6399b6ec1f481dee1ec0463d9d 100644 (file)
@@ -11,24 +11,29 @@ Log
 - var/log/uwsgi/app.log \
     uwsgi log of the app
 
-Upgrade
-+++++++++
 
-Upgrade application, all dependencies, data from master branch and also recompile assets::
+Backup & restore
++++++++++++++++++
 
-    bin/upgrade.sh
+To backup the database and all the media, this will push all of them to the var submodule own repository::
 
+    bin/push.sh
 
-Backup & restore DB
-++++++++++++++++++++
+.. warning :: use this ONLY from the **production** environment!
 
-To backup the database and push it to the var (data) own repository (**only** prod!)::
+To restore the backuped the database, all the media and rebuild front ()::
 
-    bin/push.sh
+    bin/pull.sh
 
-To restore the backuped database and rebuild front::
+.. warning :: use this ONLY from the **development** environment!
 
-    bin/pull.sh
+
+Upgrade
++++++++++
+
+Upgrade application, all dependencies, data from master branch and also recompile assets::
+
+    bin/upgrade.sh
 
 
 Repair
@@ -50,7 +55,7 @@ If the containers are still broken, try to delete exisiting containers (this wil
     docker-compose rm
     docker-compose up
 
-In case you have installed the init script to run the app as a daemon (cf. section "Install as a daemon"), you can use it to restart the app:
+In case you have installed the init script to run the app as a daemon (cf. section "Daemonize"), you can use it to restart the app:
 
     /etc/init.d/mezzanine-organization restart
 
index 0c90c52a636ed72d73dc31d2d2b67c0b8a2435ea..6fab30472f0c5f2c11f7cf2c5b9907c1ec65af0d 100644 (file)
@@ -4,7 +4,7 @@ Mezzanine-organization
 
 This application is a CMS for organizations with workflows
 
-It is based on Mezzanine and Django.
+It is based on Mezzanine_ and Django_.
 
 Use cases
 ==========
diff --git a/doc/src/production.rst b/doc/src/production.rst
deleted file mode 100644 (file)
index a6b77a1..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-
-Production
-===========
-
-Deploying
----------
-
-Our docker composition already bundles some powerful containers and bleeding edge frameworks like: Nginx, MySQL, Redis, Celery, Django and Python. It thus provides a safe and continuous way to deploy your project from an early development stage to a massive production environment.
-
-.. warning :: Before any serious production usecase, you *must* modify all the passwords and secret keys in the configuration files of the sandbox.
-
-The best
-
-Scaling
---------
-
-Thanks to Celery, each TimeSide worker of the server will process each task asynchronously over independant threads so that you can load all the cores of your CPU.
-
-To scale it up through your cluster, Docker provides some nice tools for orchestrating it very easily: `Machine and Swarm <https://blog.docker.com/2015/02/orchestrating-docker-with-machine-swarm-and-compose/>`_.
diff --git a/doc/src/related.rst b/doc/src/related.rst
deleted file mode 100644 (file)
index cada6a1..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-
-Sponsors and Partners
-=====================
-
-* `Parisson <http://parisson.com>`_
-* `CNRS <http://www.cnrs.fr>`_ (National Center of Science Research, France)
-* `Huma-Num <http://www.huma-num.fr/>`_ (big data equipment for digital humanities, ex TGE Adonis)
-* `CREM <http://www.crem-cnrs.fr>`_ (french National Center of Ethomusicology Research, France)
-* `Université Pierre et Marie Curie <http://www.upmc.fr>`_ (UPMC Paris, France)
-* `ANR <http://www.agence-nationale-recherche.fr/>`_ (CONTINT 2012 project : DIADEMS)
-* `MNHN <http://www.mnhn.fr>`_ : Museum National d'Histoire Naturelle (Paris, France)
-
-
-Related projects
-=================
-
-* `Telemeta <http://telemeta.org>`__ : open web audio platform
-* `Sound archives <http://archives.crem-cnrs.fr/>`_ of the CNRS, CREM and the "Musée de l'Homme" in Paris, France.
-* The `DIADEMS project <http://www.irit.fr/recherches/SAMOVA/DIADEMS/en/welcome/>`_ sponsored by the ANR.
index 0237e67831df9b28b934238778734a23fe084764..5d05410269f9739db4d13f083b581c954267da41 100644 (file)
@@ -6,3 +6,9 @@ deb-src http://security.debian.org/ jessie/updates main
 
 deb http://mirrors.ircam.fr/pub/debian/ jessie-updates main
 deb-src http://mirrors.ircam.fr/pub/debian/ jessie-updates main
+
+deb http://mirrors.ircam.fr/pub/debian/ jessie-backports main contrib non-free
+deb-src http://mirrors.ircam.fr/pub/debian/ jessie-backports main contrib non-free
+
+deb https://deb.nodesource.com/node_6.x jessie main
+deb-src https://deb.nodesource.com/node_6.x jessie main