-=========
-WWW IRCAM
-=========
+======================
+Mezzanine-organization
+======================
+
+This application is a CMS dedicated to organizations which is based on Mezzanine and Django.
+
+Architecture
+============
+
+For easier development and production workflow, this application has been dockerized.
+
+Paths
+++++++
+
+- `app` : django application
+
+ - `app/templates` : main templates
+ - `app/locale` : locales
+
+- `data` : all application data versioned on a separate repository
+
+ - `data/media` : all media uploaded through the app
+ - `data/var/lib/postgresql` : postgresql DB (not versioned)
+ - `data/var/log/nginx` : nginx logs (not versioned)
+ - `data/var/log/uwsgi` : uwsgi logs (not versioned)
+
+- `env` : docker-compose environment files
+- `etc` : custom config files
+- `lib` : custom libraries added as git submodules
+- `scripts` : maintenance scripts
+
+
+Models
+++++++
-This is the new IRCAM www website. It is based on the Mezzanine CMS which is itself based on Django.
Install
=======
-For easier development and production workflow, it has been dockerized including Django, Mezzanine, MariaDB and Nginx.
+Clone
+++++++
On Linux, first install Git_, Docker-engine_ and docker-compose_ and open a terminal.
Then run these commands::
git clone --recursive git+ssh://git@git.forge.ircam.fr/ircam-www.git
- cd ircam-www
- docker-compose up db
-
-Press CTRL-C to exit (the last command is needed to init the database).
-Start
-=====
+Compile static files
++++++++++++++++++++++
-For a production environment setup::
+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.
- docker-compose up (it will builds, (re)creates, starts, and attaches to containers for a service.)
+1. Install gulp globally::
-Then browse the app at http://localhost:8020/ (replacing 'localhost' by the IP given by the docker terminal on OSX or Windows)
+ sudo npm install --g gulp
-For a development environment setup::
+2. Install bower globally::
- docker-compose -f docker-compose.yml -f env/dev.yml up
+ sudo npm install -g bower
-Then browse the app at http://localhost:9020/ (replacing 'localhost' by the IP given by the docker terminal on OSX or Windows)
+3. Install gulp dependencies::
+ npm install
-Backup / Restore
-================
+4. Install ruby dependencies::
-To backup the database, in **another** terminal (or a Docker Quickstart Terminal)::
+ sudo apt install ruby
+ sudo gem install bundler
+ bundle install
- cd ircam-www
- scripts/push.sh
+5. Build::
-giving your user password if asked...
+ bower install
+ gulp build
-To restore the backuped database, in another terminal (or a Docker Quickstart Terminal)::
- cd ircam-www
- scripts/pull.sh
+/!\ If you have an issue with ffi module, try to install dev package from ruby::
-If the app is broken after a restore script, restart the composition with::
+ apt-get install ruby-dev
- docker-compose restart
+Start
++++++
-Installing dependencies
-==================
+For a production environment setup::
-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.
+ cd ircam-www
+ docker-compose up (it will builds, (re)creates, starts, and attaches to containers for a service.)
-1. Install gulp globally:
+Then browse the app at http://localhost:8020/ (replacing 'localhost' by the IP given by the docker terminal on OSX or Windows)
- sudo npm install --g gulp
-2. Install bower globally:
+Install as a daemon
++++++++++++++++++++++
- sudo npm install -g bower
+Run daemon install script::
-3. Install gulp dependencies::
+ sudo ./install.py
- npm install
-4. Install ruby dependencies::
+Prod
+======
- sudo apt install ruby
- sudo gem install bundler
- bundle install
+Update prod on master branch::
+ ./scripts/upgrade.sh
-/!\ If you have an issue with ffi module, try to install dev package from ruby:
-apt-get install ruby-dev
+Backup manually database::
-Compile static files
-==================
+ ./scripts/push.sh (only prod !)
-Static files are not included in Git. You need to compile them locally.
-1. Installing gulp dependencies::
+Development
+============
- See previous section.
-2. Fetching Bower components::
+Start in dev mode
++++++++++++++++++
- bower install
+For a development environment setup::
-3. Run gulp::
+ docker-compose -f docker-compose.yml -f env/dev.yml up
- gulp build
+Then browse the app at http://localhost:9020/ (replacing 'localhost' by the IP given by the docker terminal on OSX or Windows)
-Work on static files (CSS/JS)
-==================
-If you want to modify CSS or JS
+Modify CSS or JS
++++++++++++++++++
1. Installing gulp dependencies::
- See previous section.
+ See previous section.
2. Run gulp::
Gulp will launch BrowserSync. BrowserSync is a middleware that expose the website on port 3000.
Any change on CSS or JS files will trigger the build system and reload the browser.
-Paths
-======
-- `app/templates` : Main templates
-- `app/data/var/log/nginx` : nginx logs
-- `app/data/var/log/postgresql` : postgresql logs
-- `app/data/var/log/uwsgi` : uwsgi logs
+Maintenance
+============
-.. _Git: http://git-scm.com/downloads
+Find logs
++++++++++
-Prod
-======
-Update prod on master branch :
-./scripts/upgrade.sh
+Backup / Restore DB
++++++++++++++++++++++
+
+To backup the database, in **another** terminal (or a Docker Quickstart Terminal)::
+
+ cd ircam-www
+ scripts/push.sh
+
+giving your user password if asked...
+
+To restore the backuped database, in another terminal (or a Docker Quickstart Terminal)::
+
+ cd ircam-www
+ scripts/pull.sh
+
+If the app is broken after a restore script, restart the composition with::
+
+ docker-compose restart
-Backup manually database :
-./scripts/push.sh (only prod !)
Docker
-======
++++++++
+
+Restart service docker::
-Restart service docker :
-sudo /etc/init.d/docker restart
+ sudo /etc/init.d/docker restart
+
+List containers::
+
+ docker-compose ps
+
+Inspect a container (usefully to know IP of a container)::
+
+ docker inspect [CONTAINER_ID]
-List containers :
-docker-compose ps
-Inspect a container :
-(usefully to know IP of a container)
-docker inspect [CONTAINER_ID]
.. _Docker-engine: https://docs.docker.com/installation/
.. _docker-compose: https://docs.docker.com/compose/install/
.. _docker-compose reference: https://docs.docker.com/compose/reference/
.. _Docker-Toolbox: https://www.docker.com/products/docker-toolbox
+.. _Git: http://git-scm.com/downloads