]> git.parisson.com Git - telemeta.git/commitdiff
Manage timeside and timeside-diadems from lib/ directory
authorThomas Fillon <thomas@parisson.com>
Fri, 14 Apr 2017 09:30:51 +0000 (11:30 +0200)
committerThomas Fillon <thomas@parisson.com>
Fri, 14 Apr 2017 09:30:51 +0000 (11:30 +0200)
.gitmodules
Dockerfile
app/scripts/install_plugins.sh [new file with mode: 0644]
app/scripts/setup_plugins.sh [new file with mode: 0644]
lib/timeside-diadems [new submodule]

index 31249a886157208c331f88d55e96775bef79a4fc..bfa4df7eec248fa18699946b5b8beaa0021ed271 100644 (file)
@@ -10,3 +10,7 @@
 [submodule "lib/TimeSide"]
        path = lib/TimeSide
        url = https://github.com/Parisson/TimeSide.git
+[submodule "lib/timeside-diadems"]
+       path = lib/timeside-diadems
+       url = https://github.com/ANR-DIADEMS/timeside-diadems.git
+       branch = dev
index c23a4bbb1d3620a97d259e446be81f0139d6ba73..61c29ac473cc1aeda8bfc69fe34bbb0d7a0c16c4 100644 (file)
@@ -1,6 +1,5 @@
 # Copyright 2013 Thatcher Peskens
-# Copyright 2014-2015 Guillaume Pellerin
-# Copyright 2014-2015 Thomas Fillon
+# Copyright 2014, 2017 Guillaume Pellerin, Thomas Fillon
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -19,16 +18,22 @@ FROM parisson/timeside:latest
 MAINTAINER Guillaume Pellerin <yomguy@parisson.com>, Thomas fillon <thomas@parisson.com>
 
 RUN mkdir -p /srv/src/
-RUN mkdir /srv/src/telemeta
+RUN mkdir -p /srv/src/telemeta
+
+ENV PYTHON_EGG_CACHE=/srv/.python-eggs
+RUN mkdir -p $PYTHON_EGG_CACHE
+RUN chown www-data:www-data $PYTHON_EGG_CACHE
+
 COPY . /srv/src/telemeta
 WORKDIR /srv/src/telemeta
-RUN conda install lxml
+
 RUN pip install -r requirements.txt
 RUN pip install -r requirements-dev.txt --src /srv/src
 
-ENV PYTHON_EGG_CACHE=/srv/.python-eggs
-RUN mkdir -p $PYTHON_EGG_CACHE
-RUN chown www-data:www-data $PYTHON_EGG_CACHE
+# Install Timeside and plugins from ./lib
+COPY ./app/scripts/setup_plugins.sh /srv/app/scripts/setup_plugins.sh
+COPY ./lib/ /srv/src/plugins/
+RUN /bin/bash /srv/app/scripts/setup_plugins.sh
 
 WORKDIR /srv/app
 EXPOSE 8000
diff --git a/app/scripts/install_plugins.sh b/app/scripts/install_plugins.sh
new file mode 100644 (file)
index 0000000..ddd5d0c
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+plugins=/srv/src/plugins
+
+for dir in $(ls $plugins); do
+    if [ -f $plugins/$dir/setup.py ]; then
+        pip install -e $plugins/$dir/.
+    fi
+done
diff --git a/app/scripts/setup_plugins.sh b/app/scripts/setup_plugins.sh
new file mode 100644 (file)
index 0000000..2d9b3c5
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+plugins=/srv/src/plugins
+
+apt-get update
+
+for dir in $(ls $plugins); do
+    env=$plugins/$dir/conda-environment.yml
+    if [ -f $env ]; then
+        conda env update --name root --file $env
+    fi
+    req=$plugins/$dir/debian-requirements.txt
+    if [ -f $req ]; then
+        packs=$(egrep -v "^\s*(#|$)" $req)
+        apt-get install -y --force-yes $packs
+    fi
+    if [ -f $plugins/$dir/setup.py ]; then
+        pip install -e $plugins/$dir/.
+    fi
+done
+
+apt-get clean
diff --git a/lib/timeside-diadems b/lib/timeside-diadems
new file mode 160000 (submodule)
index 0000000..edb5975
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit edb5975d18b4b69a7b413a7795273807ad8c9e7c