IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Intégration Continue Discussion :

Ajout de BuildDefinition- Continuum XmlRpc Client API


Sujet :

Intégration Continue

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    86
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Juin 2007
    Messages : 86
    Par défaut Ajout de BuildDefinition- Continuum XmlRpc Client API
    Bonjour,

    j'utilise continuum 1.1-beta-2 avec son API XmlRpc client de la même version (avec maven 2.0.4), j'ai un problème, je n'arrive pas à ajouter un BuildDefinition correctement; quand je l'ajoute, il genère un Id automatiquement que je ne peux pas recuperer
    Avec le code suivant:

    Code java : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    (....)
    
            client = new ContinuumXmlRpcClient( 
        			new URL( "http://localhost:8080/continuum/xmlrpc" ), 
        			"admin", 
        			"dev09" );
    
            System.out.println( "Adding project..." );
            AddingResult result = client.addMavenTwoProject( "http://repo1/projets_java/projet1/tags/V0.4-beta12/pom.xml" );
            if ( result.hasErrors() )
            {
                System.out.println( result.getErrorsAsString() );
                return;
            }
            System.out.println( "Project Groups added." );
            System.out.println( "=====================" );
            int projectGroupId = 0;
            ProjectGroupSummary pg = null;;
            for ( Iterator i = result.getProjectGroups().iterator(); i.hasNext(); )
            {
                pg = (ProjectGroupSummary) i.next();
                projectGroupId = pg.getId();
                System.out.println( "Id: " + pg.getId() );
                System.out.println( "Group Id" + pg.getGroupId() );
                System.out.println( "Name: " + pg.getName() );
                System.out.println( "Description:" + pg.getDescription() );
            }
    
            System.out.println();
    
            System.out.println( "Projects added." );
            System.out.println( "=====================" );
            for ( Iterator i = result.getProjects().iterator(); i.hasNext(); )
            {
                ProjectSummary p = (ProjectSummary) i.next();
                printProjectSummary( client.getProjectSummary( p.getId() ) );
            }
    
            System.out.println();
    
            System.out.println( "Waiting the end of the check out..." );
    
            ProjectSummary ps = (ProjectSummary) result.getProjects().get( 0 );
            
            
            ps.setScmUrl("scm:svn:" +"http://serapis/projets_java/Neo/tags/V0.4-beta12");
           
            BuildDefinition bd = getMyBuilDefinition();
            
            bd = client.addBuildDefinitionToProjectGroup(pg.getId(), bd);
            
           
            
                           
            pg = client.updateProjectGroup(pg);
            pg = client.refreshProjectGroupSummary(pg); // je ne sais pas si ça sert à grand chose !
            
            System.out.println(bd.getId()); // tjrs = 0
            
            List bds = client.getBuildDefinitionsForProjectGroup(pg.getId());
            
           for (Iterator iterator = bds.iterator(); iterator.hasNext();) {
    		BuildDefinition bdd = (BuildDefinition) iterator.next();
    		System.out.println(bdd.getId()); // tjrs = 0
    		
    	}
    
       System.out.println("SCM changé avec succès !");							//  <========================= MaJ Scm (ça marche)
            
            while ( !"New".equals( client.getProjectStatusAsString( ps.getState() ) ) )
            {
                ps = client.refreshProjectSummary( ps );
                System.out.println( "State of " + ps.getName() + "(" + ps.getId() + "): " +
                    client.getProjectStatusAsString( ps.getState() ) );
                Thread.sleep( 1000 );
            }
    (...)
    }
    
    
     public static BuildDefinition getMyBuilDefinition(){
        	
        	BuildDefinition bd = new BuildDefinition();
        	
        	bd.setArguments("-Pdev");
        	bd.setGoals("deploy");
        	bd.setId(99); // je mets l'Id en dûr !
        	bd.setSchedule(getDefaultSchedule());
        	return bd;
        }
    
     public static Schedule getDefaultSchedule(){
        	
    	 Schedule sc = new Schedule();
        	
        	sc.setCronExpression("0 15 10 15 * ?");
        	sc.setId(66);
        	sc.setActive(true);
        	sc.setName("Default_SC");
        	return sc;
        }

    le BuildDefinition s'ajoute correctement le temps que l'état de ps passe de "Checking out" à "New", puis il n'y est plus !

    quelqu'un peut m'aider?

    Merci.

  2. #2
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    86
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Juin 2007
    Messages : 86
    Par défaut
    Quand je je rajoute le BuildDefinition après l'etat "New", il ne diparait pas, sauf que je n'arrive tjrs pas à récuperer l'ID grâce auquel je pourrai faire le Build.

  3. #3
    Membre Expert

    Profil pro
    Inscrit en
    Mai 2006
    Messages
    1 172
    Détails du profil
    Informations personnelles :
    Âge : 50
    Localisation : France, Yvelines (Île de France)

    Informations forums :
    Inscription : Mai 2006
    Messages : 1 172
    Par défaut
    oui, il faut attendre l'étt New.

    concernant l'id, crée une entrée dans Jira et je regarderai

  4. #4
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    86
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Juin 2007
    Messages : 86
    Par défaut
    c'est fait, Mister Emmanuel

  5. #5
    Membre Expert

    Profil pro
    Inscrit en
    Mai 2006
    Messages
    1 172
    Détails du profil
    Informations personnelles :
    Âge : 50
    Localisation : France, Yvelines (Île de France)

    Informations forums :
    Inscription : Mai 2006
    Messages : 1 172
    Par défaut
    Merci, je regarderais çà asap

  6. #6
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    86
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Juin 2007
    Messages : 86
    Par défaut lancement du build...
    J'ai aussi quelques petits problèmes quand j'essaye de forcer le build via l'XmlRpc; j'ai un projet avec ses BuildDefinitions que j'ai créés avec l'interface continuum, quand je fais
    client.buildProject(2, 3);
    , ça mùarche pour la première fois, la deusième fois ça ne marche plus, même si je modifie le BuildDefinition!!

    voici la trace:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    jvm 2    | 2007-09-21 11:24:49,078 [pool-1-thread-1] INFO  BuildController:default        - Initializing build
    jvm 2    | 2007-09-21 11:24:49,078 [pool-1-thread-1] INFO  BuildController:default        - Starting build of SOFFWK_DEMO_IMETIER
    jvm 2    | 2007-09-21 11:24:49,093 [pool-1-thread-1] INFO  BuildController:default        - Updating working dir
    jvm 2    | 2007-09-21 11:24:49,093 [pool-1-thread-1] INFO  BuildController:default        - Performing action check-working-directory
    jvm 2    | 2007-09-21 11:24:49,109 [pool-1-thread-1] INFO  BuildController:default        - Performing action update-working-directory-from-scm
    jvm 2    | 2007-09-21 11:24:49,125 [pool-1-thread-1] INFO  ContinuumScm:default           - Updating project: id: '2', name 'SOFFWK_DEMO_IMETIER'.
    jvm 2    | 2007-09-21 11:24:49,171 [pool-1-thread-1] INFO  ScmManager:default             - Executing: cmd.exe /X /C '"svn --non-interactive update"'
    jvm 2    | 2007-09-21 11:24:49,171 [pool-1-thread-1] INFO  ScmManager:default             - Working directory: C:\Developpement\Continuum_20-09-07\con
    tinuum-1.1-beta-2\working-directory\2
    jvm 2    | 2007-09-21 11:24:50,265 [pool-1-thread-1] INFO  BuildController:default        - Merging SCM results
    jvm 2    | 2007-09-21 11:24:50,281 [pool-1-thread-1] INFO  BuildController:default        - The project was not built because no changes were detected
     in sources since the last build.
    jvm 2    | 2007-09-21 11:24:50,296 [pool-1-thread-1] INFO  BuildController:default        - No changes, not building
    il ne refait pas le build s'il n'y a pas de changement Scm! mais pourquoi c'est pas le cas quand on le force avec l'interface web, et pourquoi avec un
    client.buildProjetc(2)
    (BuildDefinition par défaut) il le refais sans problème même si le scm est inchangé.

    c'est un peu bizar tout ça

    (on ne peut pas faire un buildAll pour le groupe ?!)

    j'ai besoin d'aide, MERCI.

Discussions similaires

  1. Ajout de Famille statistique table client
    Par ibtissam.oujeddou dans le forum SAGE
    Réponses: 1
    Dernier message: 01/03/2012, 18h10
  2. [EJB2.1] comment ajouter dependent module dans le client
    Par tntneo dans le forum Java EE
    Réponses: 0
    Dernier message: 28/02/2011, 16h04
  3. Réponses: 2
    Dernier message: 14/01/2010, 19h19
  4. Réponses: 1
    Dernier message: 17/06/2009, 11h56
  5. Ajout de buffer pour optimiser client/serveur
    Par Piki dans le forum Langage
    Réponses: 9
    Dernier message: 18/04/2007, 07h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo