Commit 19931a30 authored by Herve Marie's avatar Herve Marie
Browse files

Lecture Fichier CSV en convertion JSON (section Millestones)

- Ajout du nécessaire REGEX et traitement des différents cas de figure avec desccription ou non du jalon
- Command ok
- Service OK
- Tests mis à jour OK
parent e9a2deab
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ Cet utilitaire sera utilisé pour importer et synchroniser des activités dans O
La procédure de synchronisation s'utilise en ligne de commande :

```bash
$ php public/index.php oscar activity:sync path/to/file.json
$ php bin/oscar.php activity:cvstojson --fichier=path/to/fileSourceDatas.csv --config=path/to/fileConfig.php
```

# Source des données
+4 −4
Original line number Diff line number Diff line
@@ -14,10 +14,10 @@ les containers créé :
```
cd dev
# build
docker-composer build
docker-compose build

# Run
docker-composer up -d
docker-compose up -d
```

Accès à oscar (pour les opérations en ligne de commande) : 
@@ -30,7 +30,7 @@ Une fois dans l'instance :

```
su
cd /var/OscarApp/oscar
cd /var/OscarApp/
```

Enjoy
+14 −37
Original line number Diff line number Diff line
####################################
# DOCKERFILE TO BUILD APACHE2, PHP7
# BASED ON DEBIAN
####################################
#FROM debian
#####################################
# DOCKERFILE TO BUILD APACHE2, PHP7.4
# BASED ON DEBIAN:BULLSEYE-BACKPORTS
#####################################
FROM debian:bullseye-backports

# Issue du docker-compose
@@ -32,7 +31,7 @@ RUN apt-get install -y\
        && apt-get update && apt-get upgrade -y && apt-get clean

# PROXY (wget)
# Ca ca marche pas...
# Des doutes sur le fonctionnement, perso j'ai eu des soucis derrière le proxy unicaen (HM)
COPY etc/apt/wgetrc /etc/apt/wgetrc

# INSTALL PACKAGES OS
@@ -46,7 +45,6 @@ RUN apt-get install -y \
        nano \
        supervisor \
        curl \
        # Pour OCI 8
        libaio1 \
        libpng-dev \
        libpq-dev \
@@ -56,7 +54,6 @@ RUN apt-get install -y \
        libgearman-dev \
        libzip-dev \
        zip \
        #wget \
        gettext \
        libbz2-dev \
        unzip \
@@ -64,6 +61,7 @@ RUN apt-get install -y \
        gearman-tools \
        postgresql-client \
        php7.4 \
        php7.4-gearman \
        php7.4-bz2 \
        php7.4-cli \
        php7.4-curl \
@@ -79,13 +77,12 @@ RUN apt-get install -y \
        php7.4-dev \
        php-pear \
        php-xdebug \
        #php-mcrypt \
        && apt-get clean

# Enable xdebug -> Need to install later xdebug
#RUN pecl install xdebug

# Install OCI
# Install OCI (penser à forcer le proxy)
#RUN pear config-set http_proxy "${http_proxy}"
RUN pear config-set http_proxy "http://proxy.unicaen.fr:3128"
COPY resources/instantclient-basiclite-linux.x64-18.5.0.0.0dbru.zip /tmp/
@@ -104,33 +101,7 @@ RUN echo "extension=oci8.so" > /etc/php/7.4/apache2/conf.d/30-php-oci8.ini && \
    echo "extension=oci8.so" > /etc/php/7.4/cli/conf.d/30-php-oci8.ini && \
    echo "/usr/local/instantclient" > /etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig


#Install GEARMAN CLIENT FROM SOURCE
#RUN mkdir -p /tmp/install \
#    && cd /tmp/install \
#    && wget https://github.com/wcgallego/pecl-gearman/archive/master.zip \
#    && unzip master.zip \
#    && cd pecl-gearman-master \
#    && phpize \
#    && sh configure \
#    && make install

RUN echo "http_proxy = http://proxy.unicaen.fr:3128"  >> /etc/wgetrc && echo "https_proxy = http://proxy.unicaen.fr:3128" >> /etc/wgetrc;

RUN mkdir -p /tmp/install \
    && cd /tmp/install \
    && wget https://github.com/gearman/gearmand/releases/download/1.1.19.1/gearmand-1.1.19.1.tar.gz \
    && tar xzf gearmand-1.1.19.1.tar.gz \
    && cd  gearmand-1.1.19.1
WORKDIR /tmp/install/gearmand-1.1.19.1/
RUN ./configure \
    && make \
    && make install

#RUN echo "extension=gearman.so" >> /etc/php/7.4/mods-available/gearman.ini
RUN echo "extension=gearman.so" > /etc/php/7.4/cli/conf.d/gearman.so
RUN phpenmod -v ALL -s ALL gearman

#RUN echo "http_proxy = http://proxy.unicaen.fr:3128"  >> /etc/wgetrc && echo "https_proxy = http://proxy.unicaen.fr:3128" >> /etc/wgetrc;
RUN echo "XDEBUG"
COPY etc/php/7.4/mods-available/xdebug.ini /etc/php/7.4/mods-available/xdebug.ini
RUN phpenmod -v ALL -s ALL xdebug
@@ -152,6 +123,12 @@ COPY run /usr/local/bin/run
RUN chmod +x /usr/local/bin/run
RUN a2enmod rewrite && a2enmod ssl

#Composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php composer-setup.php
RUN php -r "unlink('composer-setup.php');"
RUN mv composer.phar /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer

#SUPERVISOR FICHIERS DE CONFIG POUR MULTIPLES SERVICES IN CONTAINER DOCKER
COPY supervisor /etc/supervisor/conf.d/oscar.conf
+3 −1
Original line number Diff line number Diff line
@@ -45,5 +45,7 @@ return [
    28  => "currency",
    29  => "assietteSubventionnable",
    30  => "status",
    32  => "disciplines"
    32  => "disciplines",

    34  => "milestones.Rapport scientifique 9.1"
];
+4 −4
Original line number Diff line number Diff line
0 uid,1 Description,2 Projet ACRONYME,3 Label,4 Project LABEL,5 PFI,Composante Responsable,Laboratoire1,Responsable Scientifique,Ingénieur 1,Ingénieur 2,Montant,Versement montant 1,Versement date 1,Versement date prévue 1,Versement montant 2,Versement date 2,Versement date prévue 2,Rapport financier,Date PFI,Type,Laboratoire 2,Date de signature,Versement Date 3,Versement Montant 3,Participants,TVA,Impact financier,Devise,Assiette Subventionnable,Statut,Non Imorté,Discipline
R1,Description 1,RELATIV,Relativité restreinte,Théorie de la gravitation,EOTP201400002,Université des sciences de Berne,Olympia,Albert Einstein,HEUZE VOURC'H NATHALIE,Serge Le Normand,0,,,,,,,,,Concours scientifique,US Robot,,,,"Batman,Robin  ",,Recette,,,,foo,Physique
R2,Description 2,RELATIV,Relativité générale,Théorie de la gravitation,EOTP201400003,Université des sciences de Berne,Université des sciences de Berlin,Albert Einstein,JO JO LA PIN,Maurice Solovine,45000,20000,2018-01-06,2018-01-01,25000,,2018-06-01,2018-04-15,2017-12-24,Concours scientifique,US Robot,2017-12-31,2020-12-31,"666,66","Spiderman, Pollux",,Dépense,$,15,102,bar,Autre discipline
R3,Mécanique quantique,QUANTIK,Théorie des cordes,Mécanique quantique,EOTP201600004,Université des sciences de Berne,Université des sciences de Berlin,Max Plank,Niels Bohr,Erwin Schrödinger,15000,15000,,2020-01-01,,,,,,ERASMUS+,US Robot,,,,,19.6,Aucune,Yens,5,101,hop,Physique des particules
0 uid,1 Description,2 Projet ACRONYME,3 Label,4 Project LABEL,5 PFI,Composante Responsable,Laboratoire1,Responsable Scientifique,Ingénieur 1,Ingénieur 2,Montant,Versement montant 1,Versement date 1,Versement date prévue 1,Versement montant 2,Versement date 2,Versement date prévue 2,Rapport financier,Date PFI,Type,Laboratoire 2,Date de signature,Versement Date 3,Versement Montant 3,Participants,TVA,Impact financier,Devise,Assiette Subventionnable,Statut,Non Imorté,Discipline,Description,Rapport scientifique,Description
R1,Description 1,RELATIV,Relativité restreinte,Théorie de la gravitation,EOTP201400002,Université des sciences de Berne,Olympia,Albert Einstein,HEUZE VOURC'H NATHALIE,Serge Le Normand,0,,,,,,,,,Concours scientifique,US Robot,,,,"Batman,Robin  ",,Recette,,,,foo,Physique,,,
R2,Description 2,RELATIV,Relativité générale,Théorie de la gravitation,EOTP201400003,Université des sciences de Berne,Université des sciences de Berlin,Albert Einstein,JO JO LA PIN,Maurice Solovine,45000,20000,2018-01-06,2018-01-01,25000,,2018-06-01,2018-04-15,2017-12-24,Concours scientifique,US Robot,2017-12-31,2020-12-31,"666,66","Spiderman, Pollux",,Dépense,$,15,102,bar,Autre discipline,Bla Bla Bla,2022-01-01,Description rapport scientifique
R3,Mécanique quantique,QUANTIK,Théorie des cordes,Mécanique quantique,EOTP201600004,Université des sciences de Berne,Université des sciences de Berlin,Max Plank,Niels Bohr,Erwin Schrödinger,15000,15000,,2020-01-01,,,,,,ERASMUS+,US Robot,,,,,19.6,Aucune,Yens,5,101,hop,Physique des particules,,2022-02-02,Description rapport scientifique 2
Loading