5 – Intégration continue 625-1.1 Industrialisation du logiciel Bachelor en informatique de gestion – 3IGPT/4IGTP ulysse.rosselet@he-arc.ch
Analyse Conception Production Déploiement
Build tools, récapitulation
Jusqu’ici… • Méthodes de développement • Différence industrie/artisanat • Produire un artefact Builder Au cœur du processus de «fabrication» logicielle Reproductible Industrialisation = processus automatisé!
Intégration continue • Approche développée par Kent Beck et Martin Fowler • A chaque changement de code, le build est exécuté automatiquement et continuellement. • Les changements apportés par les différents développeurs sont intégrés en continu. • Cette tâche est réalisée par un serveur de build, qui récupère la dernière version du code et déclenche le build avec le build tool. • Ainsi, les erreurs sont détectées plus vite. • L’utilisation de l’intégration continue est très répandue dans les entreprises de nos jours.
Intégration continue
https://developers.redhat.com/blog/2017/09/06/continuous-integration-a-typical-process/
Serveurs d’intégration Jenkins, TeamCity, TravisCI • Solutions cloud: • Peu de barrières à l’entrée (couts bas) surtout pour les projets open-source • Intéressant pour les entreprises en combinaison avec des repositories privés. Même le code source dans le cloud n’est pas une option pour certaines compagnies pour protéger les données sensibles • Solution interne • Nécessite la mise en place de l’infrastructure d’intégration continue • Prendre en compte les nécessités d’évolution future • Attention au «quick and dirty» Le serveur d’intégration continue est le maillon central de la chaîne d’industrialisation logicielle
Jenkins - factoids • the most widely used CI server. • simple, extensible, and user friendly open source tool • provides continuous integration services for application development. • Jenkins supports SCM tools such as Git, Subversion, Star Team, and CVS, AccuRev. • Jenkins can build Apache Ant and Apache Maven-based projects.
Jenkins – basic vocabulary For Jenkins a build is a job , which runs in a workspace . directory in the file system into which the build saves its files
Jenkins – jobs • In the standard installation, Jenkins offers freestyle jobs in which arbitrary steps can be combined in a build, • and Maven jobs , which expect a Maven call as a central build step. • Additional job types can be offered by plug-ins.
Managing jobs • A number of settings for determining the environment and the job behavior are common to all jobs. • They can be modified via the Jenkins web surface
Parametrization • If necessary, build jobs can be parameterized. • Modifiable data of a build can be easily passed in from outside without having to be held directly in the build script or in the build configuration. • There the parameters can be read out as variables.
Source Code Management (SCM) • Here, the Source Code Management repository is configured from where the source code is checked out. • The Jenkins standard installation offers support for CVS and SVN (Subversion). • Support for other versioning tools like Git can easily be added via plug-ins. • Depending on the used SCM here, specific configurations can still be performed.
Build Triggers • This defines the point in time at which the build is supposed to run: • Time-directed and independent of changes in the Source Code Repository. • Upon changes in the Source Code Repository. • After a successful completion of other build jobs. • When SNAPSHOT dependencies of the project were created on the same build server.
Build Environment • In this section, if necessary, the build environment can be modified. • For instance, it is possible via plug-ins to ensure that the build always takes place on an empty workspace or that additional environment variables are read from files.
Build • This is a central part since the build commands are configured here. • For Maven jobs this is the respective call, if necessary with a reference to the POM to be used. • For freestyle jobs a number of build steps can be indicated and thus several tools can be combined in a build.
Post-Build Actions • Here tasks are defined which are supposed to be executed after the build. • Examples : • the initiation of additional jobs, • the archiving of built artifacts or test results, • or an email notification in case of unsuccessful builds. • Via plug-ins Jenkins can trigger many different actions.
Intégration continue processus automatisé • Méthodes de développement • Différence industrie/artisanat • Produire un artefact Builder Au cœur du processus de «fabrication» logicielle Reproductible Industrialisation = processus automatisé!
Garbage in, garbage out! DESIGN SIGN CODE BUILD LD
Recommend
More recommend