Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)
« Projet dev » : différence entre les versions
Aucun résumé des modifications |
|||
| Ligne 188 : | Ligne 188 : | ||
<applications> | <applications> | ||
<ad84 svn="svn+ssh://svn.ajlsm.com/home/svn/ad84/branches/new-design_20141010" installDirProperty="pleade.install.dir" childApplication="pleade-entreprise" webappDir="src/pleade3"> | <ad84 svn="svn+ssh://svn.ajlsm.com/home/svn/ad84/branches/new-design_20141010" installDirProperty="pleade.install.dir" childApplication="pleade-entreprise" webappDir="src/pleade3"> | ||
</ad84> | </ad84> | ||
<ajlsm/> | <ajlsm/> | ||
| Ligne 254 : | Ligne 199 : | ||
<thesx /> | <thesx /> | ||
</applications> | </applications> | ||
==== <target name="prepare.***"> ==== | </syntaxhighlight> | ||
==== <target name="prepare.client"> ==== | |||
<syntaxhighlight lang="bash"> | |||
<target name="prepare.ad84" unless="quick" depends="properties"> | |||
<antcall target="prepare.pleade-entreprise"/> | |||
<regex file="app/build/ad84/ad84.properties" property="install.dir" value="${pleade.install.dir}" /> | |||
<regex file="app/build/ad84/ad84.properties" property="pleade.src.dir" value="${basedir}/app/build/pleade-entreprise" /> | |||
<regex file="app/build/ad84/ad84.properties" property="src.module.thesaurus" value="${basedir}/thesx/src/web/pleade" /> | |||
<regex file="app/build/ad84/build.xml" find='<property file="\$\{user\.home\}/\$\{project\.code\}.properties"\s*>' replace="" /> | |||
<regex file="app/build/ad84/build.xml" find='<property file="\$\{user\.home\}/\.ant\.properties"\s*/>' replace="" /> | |||
<regex file="app/build/ad84/build.xml" find='<property file="\./\.ant\.properties"\s*/>' replace="" /> | |||
<regex file="app/build/ad84/build.xml" find='\$\{ant\.home\}/\$\{build\.webapp[^}]*\.dir\}' replace="${basedir.regex.escaped}/app/build/ad84/build/webapp/pleade" /> | |||
<regex file="app/build/ad84/src/pleade3/WEB-INF/properties/pleade-admin.properties" property="pleade.url-interne" value="${pleade.url-interne}" /> | |||
</target> | |||
</syntaxhighlight> | |||
==== <target name="build.client"> ==== | |||
<syntaxhighlight lang="bash"> | |||
<target name="build.ad84" depends="properties"> | |||
<copy todir="app/build" verbose="true"> | |||
<fileset dir="." excludes="**/.project" includes="ad84/**"/> | |||
<fileset dir="." excludes="**/.project" includes="pleade-libre/**"/> | |||
<fileset dir="." excludes="**/.project" includes="pleade-entreprise/**"/> | |||
<fileset dir="." excludes="**/.project" includes="sdx-ajlsm/**"/> | |||
<fileset dir="." excludes="**/.project" includes="ajlsm/**"/> | |||
</copy> | |||
<antcall target="prepare.ad84"/> | |||
<if> | |||
<equals arg1="${dev.user}" arg2="ctate"/> | |||
<then> | |||
<antcall target="build.only.ad84"/> | |||
</then> | |||
<else> | |||
<!--<exec dir="app/build/ad84/dev/webapp" executable="sh">--> | |||
<exec dir="app/build/ad84" executable="sh"> | |||
<arg value="ant.sh" /> | |||
<arg value="install" /> | |||
</exec> | |||
</else> | |||
</if> | |||
</target> | |||
</syntaxhighlight> | |||
==== <target name="build.only.client"> ==== | |||
<syntaxhighlight lang="bash"> | |||
<target name="build.only.ad84" depends="properties"> | |||
<antcall target="copy.pleade-libre"/> | |||
<antcall target="copy.pleade-entreprise"/> | |||
<antcall target="copy.ad84"/> | |||
<antcall target="compile.sdx-ajlsm"/> | |||
<antcall target="compile.pleade-libre"/> | |||
<antcall target="compile.pleade-entreprise"/> | |||
<copy todir="${install.dir}" overwrite="true"> | |||
<fileset dir="surcharge" /> | |||
</copy> | |||
</target> | |||
</syntaxhighlight> | |||
==== <target name="copy.client"> ==== | |||
<syntaxhighlight lang="bash"> | |||
<target name="copy.ad84" depends="properties"> | |||
<copy todir="${install.dir}" overwrite="true"> | |||
<fileset dir="app/build/ad84/src/pleade3" includes="**"> | |||
</fileset> | |||
</copy> | |||
</target> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Version du 26 janvier 2015 à 15:17
Prérequis
Installer des paquets
sudo apt-get install subversion libsvn-java
- subversion est pour utiliser svn dans le terminal.
- libsvn-java est pour utiliser le plugin Subclipse pour utiliser SVN dans Eclipse.
Configurer SSH
Sur le serveur moorea, configurer votre même utilisateur (remplacer ctate par votre utilisateur).
groupadd ctate
useradd -m -k -d -g ajlsm ctate
usermod -G ajlsm,ctate ctate
passwd ctate
vi /etc/ssh/sshd_config
/etc/init.d/sshd restart
Sur la nouvelle machine du développeur :
ssh-keygen -t dsa
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_dsa.pub ctate@192.168.123.16
ssh-copy-id -i ~/.ssh/id_rsa.pub ctate@192.168.123.16
Installation du SDK
cd ~/projet/pleade-libre/dev/applications/java6
chmod u+x jdk-6u38-linux-x64.bin
./jdk-6u38-linux-x64.bin
sudo mv jdk1.6.0_38/ /usr/lib/jvm/
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_38/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_38/bin/javac 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_38/bin/javaws 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
Installation d'eclipse
sudo apt-get install eclipse
sudo updatedb
locate eclipse.ini
locate libsvnjavahl-1.so
Il faut modifier le fichier eclipse.ini pour ajouter -Djava.library.path qui est le chemin vers le repertoire qui contient le fichier libsvnjavahl-1.so :
-vmargs
-Djava.library.path=/usr/lib/x86_64-linux-gnu/jni
Pour installer le subclipse plugin, il faut trouver le version de subversion dans le système :
svn --version | grep version
Si c'est 1.7.x, il faut utiliser l'eclipse update site ici : http://subclipse.tigris.org/update_1.8.x
Si c'est 1.8.x ou plus, il faut utiliser l'eclipse update site ici : http://subclipse.tigris.org/update_1.10.x
Installez : "Subclipse" et "Subversion JavaHL Native Library Adapter"
Environnement Linux
On commence par éditer le fichier /home/ctate/.profile et ajouter cette ligne :
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_38
Le projet dev est dans SVN sur le serveur moorea. SVN est accessible depuis l'exterieur depuis le host svn.ajlsm.com, mais à l'interne à 192.168.123.16. Parce que j'utilisent le projet dev sur des serveurs à distant comme mercure mais aussi au bureau, je configure le fichier /etc/hosts pour le host svn.ajlsm.com :
192.168.123.16 moorea svn.ajlsm.com redmine.ajlsm.com mw.ajlsm.com
Installation d'un projet dev
Le projet dev peut installer pleade-libre, pleade-entreprise, pleade-mets ou les applications pour presque tous nos clients. Pour commencer, il faut créer un nouveau répertoire pour le projet que tu veut installer :
mkdir pleade
cd pleade
Après il faut récupérer le fichier ant build pour installer le projet dev :
svn export svn+ssh://svn.ajlsm.com/home/svn/dev/workspace/build_workspace.xml
ant -f build_workspace.xml
Après un moment, il va demander quel projet vous voulez installer. Par exemple, taper : pleade-mets
Voici les clients :
- ad21
- ad33
- ad44
- ad64-pleade3
- ad84
- ad94
- ark
- basse-bretagne
- bm-grenoble
- bm-languedoc
- bm-orleans
- bm-orleans-old
- bnf-pleade
- cnd
- college-de-france
- credit-agricole
- Ead-Publisher
- mercure_ajlsm
- msh-dijon
- oai
- pleade-entreprise
- pleade-entreprise-3-5
- pleade-entreprise-gmaps
- pleade-entreprise-html5
- pleade-entreprise-mysql
- pleade-entreprise-osd
- pleade-libre
- pleade-libre-3-5
- pleade-libre-cocoon-2-1-12
- pleade-mets
- pleade-social-media
- pleade-solr
- ville-dijon
- ville-dole
Configurer un client
- Les clients sont configuré dans dev/clients/{nom du client}/client.xml.
- Pour ajouter un nouveau client, créer un repertoire avec le nom d'un nouveau client, ou plus facile un projet dans svn, dans dev/clients. Copier le client.xml d'un autre client le plus proche dans le repertoire. Il faut surtout changer l'attribut <client id="..."/> au nom du répertoire parent. Faire une recherche remplace de l'ancien nom client au nouveau nom client dans le fichier.
Voici un exemple court d'un fichier client.xml :
<client id="ad84">
<dev>
</dev>
<applications>
</applications>
<machine>
</machine>
</client>
<dev>...</dev>
Le section <dev> est pour configurer le client pour un développeur à AJLSM. Voici un explication pour plusiers properties importants :
- "port.prefix" qui est différent pour chaque client dans le projet dev pour démarrer plusiers tomcats pour plusiers clients au même temps.
- "database" peut-être "mysql", "postgresql", "oracle", "mssql" ou "hsql" si on utilisent les sources dans la branche Pleade_3.5 ou avant.
- "pleade.install.dir" est lié à "install.dir" mais c'est important pour bm-grenoble par exemple qui utilisent 2 applications AJLSM : pleade et notix, est c'est le chemin vers le webapp dans tomcat où vont les sources quand on fait un build.
- "install.dir" utilise "pleade.install.dir" est c'est envoyé au build.xml de pleade.
- "pleade.url-interne" l'url vers le webapp de tomcat pour faire des requêtes qui doivent éviter de contacter le réseau depuis le public URL, comme avec la publication.
- "pleade.public-url" L'url pour accèder l'application normalement, soit vers tomcat, soit vers apache.
- "pleade.data-dir" le chemin vers le datadir pour pleade, sans le préfixe "file://".
- "pleade.sdx-data-dir" le chemin vers le datadir pour pleade, avec le préfixe "file://".
- "pleade.img-server.racines" les chemins vers les images.
- "pleade.images.preparees" les chemins vers les images préparées.
- "pleade.ead-docs-dir" les chemins vers les documents ead.
<dev>
<property name="port.prefix" value="209" />
<property name="database" value="mysql"/>
<property name="pleade.install.dir" location="${basedir}/tomcat/webapps/ad84" />
<property name="install.dir" value="${pleade.install.dir}"/>
<property name="pleade.url-interne" value="http://${computer.hostname}:${port.prefix}80/ad84" />
<property name="pleade.public-url" value="http://${computer.hostname}:${port.prefix}80/ad84" />
<property name="pleade.data-dir" value="${basedir}/data/datadir/ad84"/>
<property name="pleade.sdx-data-dir" value="file://${pleade.data-dir}"/>
<property name="pleade.img-server.racines" value="/mnt/disk500g/ad84/images"/>
<property name="pleade.images.preparees" value="/mnt/disk500g/ad84/images-preparees"/>
<property name="pleade.images.preparees.copier" value="true"/>
<property name="pleade.ead-docs-dir" value="${basedir}/data/ead"/>
</dev>
<applications>...</applications>
Le section <applications> est pour specifier tous les applications AJLSM qui sont utilisés (pleade-libre, pleade-entreprise, pleade-mets, sdx-ajlsm, ajlsm, et d'autres applications dans svn pour le client). Voici un exemple :
<applications>
<ad84 svn="svn+ssh://svn.ajlsm.com/home/svn/ad84/branches/new-design_20141010" installDirProperty="pleade.install.dir" childApplication="pleade-entreprise" webappDir="src/pleade3">
</ad84>
<ajlsm/>
<pleade-entreprise/>
<pleade-libre/>
<sdx-ajlsm/>
<tomcat />
<thesx />
</applications>
<target name="prepare.client">
<target name="prepare.ad84" unless="quick" depends="properties">
<antcall target="prepare.pleade-entreprise"/>
<regex file="app/build/ad84/ad84.properties" property="install.dir" value="${pleade.install.dir}" />
<regex file="app/build/ad84/ad84.properties" property="pleade.src.dir" value="${basedir}/app/build/pleade-entreprise" />
<regex file="app/build/ad84/ad84.properties" property="src.module.thesaurus" value="${basedir}/thesx/src/web/pleade" />
<regex file="app/build/ad84/build.xml" find='<property file="\$\{user\.home\}/\$\{project\.code\}.properties"\s*>' replace="" />
<regex file="app/build/ad84/build.xml" find='<property file="\$\{user\.home\}/\.ant\.properties"\s*/>' replace="" />
<regex file="app/build/ad84/build.xml" find='<property file="\./\.ant\.properties"\s*/>' replace="" />
<regex file="app/build/ad84/build.xml" find='\$\{ant\.home\}/\$\{build\.webapp[^}]*\.dir\}' replace="${basedir.regex.escaped}/app/build/ad84/build/webapp/pleade" />
<regex file="app/build/ad84/src/pleade3/WEB-INF/properties/pleade-admin.properties" property="pleade.url-interne" value="${pleade.url-interne}" />
</target>
<target name="build.client">
<target name="build.ad84" depends="properties">
<copy todir="app/build" verbose="true">
<fileset dir="." excludes="**/.project" includes="ad84/**"/>
<fileset dir="." excludes="**/.project" includes="pleade-libre/**"/>
<fileset dir="." excludes="**/.project" includes="pleade-entreprise/**"/>
<fileset dir="." excludes="**/.project" includes="sdx-ajlsm/**"/>
<fileset dir="." excludes="**/.project" includes="ajlsm/**"/>
</copy>
<antcall target="prepare.ad84"/>
<if>
<equals arg1="${dev.user}" arg2="ctate"/>
<then>
<antcall target="build.only.ad84"/>
</then>
<else>
<!--<exec dir="app/build/ad84/dev/webapp" executable="sh">-->
<exec dir="app/build/ad84" executable="sh">
<arg value="ant.sh" />
<arg value="install" />
</exec>
</else>
</if>
</target>
<target name="build.only.client">
<target name="build.only.ad84" depends="properties">
<antcall target="copy.pleade-libre"/>
<antcall target="copy.pleade-entreprise"/>
<antcall target="copy.ad84"/>
<antcall target="compile.sdx-ajlsm"/>
<antcall target="compile.pleade-libre"/>
<antcall target="compile.pleade-entreprise"/>
<copy todir="${install.dir}" overwrite="true">
<fileset dir="surcharge" />
</copy>
</target>
<target name="copy.client">
<target name="copy.ad84" depends="properties">
<copy todir="${install.dir}" overwrite="true">
<fileset dir="app/build/ad84/src/pleade3" includes="**">
</fileset>
</copy>
</target>