/!\ Ce tuto est obsolète, utilisez plutôt l'installation à base de package :
https://bitbucket.org/sdorra/scm-manager/wiki/RPM%20and%20DEB%20packages
Installation¶
Prérequis¶
Installer Java (headless)
aptitude install default-jre-headless
Installer SCM server¶
Télécharger scm-server sur http://www.scm-manager.org
wget http://maven.scm-manager.org/nexus/content/repositories/releases/sonia/scm/scm-server/1.22/scm-server-1.22-app.tar.gz
Extraire scm-server
tar xzvf scm-server-1.22-app.tar.gz
Déplacer scm server vers /opt/
mv scm-server /opt/
Configurer scm-server pour utiliser la bonne JVM¶
Trouver le chemin vers java :¶
Méthode 1¶
which java
Remonter jusqu'au répertoire réel
ls -l /usr/bin/java ls -l /etc/alternatives/java ls -l /usr/lib/jvm/java-6-openjdk/jre/bin/java
Dans ce cas notre JAVA_HOME sera /usr/lib/jvm/java-6-openjdk
Méthode 2¶
Utiliser la JVM par default :
/usr/lib/jvm/default-java
Configurer le chemin vers JAVA¶
Créer le fichier /etc/default/scm-server
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
Test¶
Tester le bon fonctionnement de scm-server
/opt/scm-server/bin/scm-server start
Accéder http://server:8080/scm
SCM Manager doit fonctionner
Ne pas oublier de stopper le server :
/opt/scm-server/bin/scm-server stop
Service scm-server¶
Créer /etc/init.d/scm-server
source : http://mrexception.blogspot.com/2011/12/scm-manager.html
#!/bin/sh # ### BEGIN INIT INFO # Provides: scmserver # Required-Start: $remote_fs $syslog $network # Required-Stop: $remote_fs $syslog $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start scmserver at boot time # Description: Control Repositories ### END INIT INFO # Source function library. if [ -x /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions fi # Check for and source configuration file otherwise set defaults RETVAL=0 appname=ScmServerDaemon # See how we were called. start() { # Call the scm-server script as our user /bin/su - scmserver -c "/opt/scm-server/bin/scm-server start >> /home/scmserver/scm-manager-output.log 2>&1 & " } stop() { if [ ! status = 0 ] then SCM_PID=$( ps auxwww | grep java | grep ${appname} | awk '{print $2 }' ) kill -9 $SCM_PID else echo "SCM is not running" fi } status() { ps auxwww | grep java | grep ${appname} || echo "SCM is not running" } restart() { stop SECONDS=0 STAT=$( ps auxwww | grep java | grep ${appname} | wc -l ) while [ $STAT -ne 0 ] do sleep 3 if [ $SECONDS -gt 300 ] then SCM_PID=$( ps auxwww | grep java | grep ${appname} | awk '{ print$2 }' ) kill -9 $SCM_PID fi STAT=$( ps auxwww | grep java | grep ${appname} | wc -l ) done start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) status ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac exit $RETVAL
Rendre le script exécutable
chmod +x /etc/init.d/scm-server
Ajouter l'utilisateur scmserver
adduser scmserver
Donner les bons droits sur le répertoire de scm-server
chown -R scmserver:scmserver /opt/scm-server/
Tester le server :
service scm-server start
Tester la page http://server:8080/scm/
Lancement de scm-server au démarrage¶
Ajouter le service au démarrage :
update-rc.d scm-server defaults
Note¶
Les identifiants par defauts sont :
id : scmadmin
mdp : scmadmin