Packaging, automation, Continuous Integration

Similar documents
Geo Catching Sprint #3 Kick-off

Content. Development Tools 2(57)

Topics covered. Introduction to Maven Maven for Dependency Management Maven Lifecycles and Plugins Hands on session. Maven 2

MAVEN MOCK TEST MAVEN MOCK TEST IV

AUTOMATION TESTING FRAMEWORK FOR LUMINOUS LMS

What is Maven? Apache Maven is a software project management and comprehension tool (build, test, packaging, reporting, site, deploy).

MAVEN MOCK TEST MAVEN MOCK TEST I

I Got My Mojo Workin'

Maven. INF5750/ Lecture 2 (Part II)

MAVEN INTERVIEW QUESTIONS

Continuous Integration INRIA

Maven POM project modelversion groupid artifactid packaging version name

Continuous Integration with Jenkins

Introduction: Manual Testing :

Continuous Integration (CI) with Jenkins

Setting up a Maven Project

Maven Introduction to Concepts: POM, Dependencies, Plugins, Phases

BUILD AND DEPLOY SOA PROJECTS FROM DEVELOPER CLOUD SERVICE TO ORACLE SOA CLOUD SERVICE

Oracle Code Day Hands On Labs (HOL) (Install, Repository, Local Deploy, DevCS, OACCS)

ONAP Developer Typical Setup 2017 July ONAP Virtual Developers Event

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

Unable To The Artifact From Any Repository Maven-clean-plugin

Spring 2.0 Kickstart. Thomas Risberg Matt Raible

sites</distribsiteroot>

Sample Spark Web-App. Overview. Prerequisites

Selenium Testing Course Content

Jahia Studio JAHIA DOCUMENTION

DevOps and Maven. Eamonn de Leastar Dr. Siobhán Drohan Produced by:

DEVOPS TRAINING COURSE CONTENT

Maven in the wild. An introduction to Maven

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

Component based Development. Table of Contents. Notes. Notes. Notes. Web Application Development. Zsolt Tóth

Checking Out and Building Felix with NetBeans

Continuous Integration and Deployment (CI/CD)

BUILD AND DEPLOY ORACLE SERVICE BUS PROJECTS FROM ORACLE DEVELOPER CLOUD SERVICE TO ORACLE SOA CLOUD SERVICE USING THE ORACLE SERVICE BUS PLUG-IN

Simplified Build Management with Maven

Package Management and Build Tools

Sonatype CLM - CI User Guide. Sonatype CLM - CI User Guide

Oracle Code Day Hands On Labs HOL

Apache Maven. Created by anova r&d bvba

Chapter 1 - Continuous Delivery and the Jenkins Pipeline

Lab 5 Exercise Build and continuous integration tools

TM DevOps Use Case TechMinfy All Rights Reserved

Continuous Integration with Selenium and Jenkins

Jenkins User Conference Israel. #jenkinsconf. CI / Liveperson. Gidi Samuels. July 16, #jenkinsconf

Open XAL Project Architecture

Struts 2 Maven Archetypes

Maven 2 & Continuum. by Trygve Laugstøl

Continuous Integration & Code Quality MINDS-ON NUNO 11 APRIL 2017

Pour aller plus loin : Programmation outillée

Publishing automation using DevOps STC India Annual Conference. Srikanta Dash and Visagan Santhanam, Unisys India Pvt. Ltd.

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright. Jenkins

Cheat Sheet: Wildfly Swarm

SELENIUM. SELENIUM COMPONENTS Selenium IDE Selenium RC Selenium Web Driver Selenium Grid

Seven Habits of Highly Effective Jenkins Users

Sonatype CLM Enforcement Points - Nexus. Sonatype CLM Enforcement Points - Nexus

SOA-14: Continuous Integration in SOA Projects Andreas Gies

JenkinsPipelineUnit. Test your Continuous Delivery Pipeline. Ozan Gunalp - Emmanuel Quincerot

Who Moved My Module? 1

OpenECOMP SDC Developer Guide

ARES: AUTOMATIC RELEASE SERVICE

Continuous Integration using Docker & Jenkins

Building ToCollege.net

Tools. SWE 432, Fall Design and Implementation of Software for the Web

Red Hat Developer Studio 12.0

NetApp Jenkins Plugin Documentation

What s new in IBM Operational Decision Manager 8.9 Standard Edition

Section 1: Tools. Contents CS162. January 19, Make More details about Make Git Commands to know... 3

CONTINUOUS DELIVERY IN THE ORACLE CLOUD

juddi Developer Guide

Construction: version control and system building

Software configuration management

Software Development I

Software Building (Sestavování aplikací)

Apache Maven MarsJUG. Arnaud Héritier exo platform Software Factory Manager

Red Hat JBoss Developer Studio 10.3 Getting Started with JBoss Developer Studio Tools

Git. Christoph Matthies Software Engineering II WS 2018/19. Enterprise Platform and Integration Concepts group

Produced by. Agile Software Development. Eamonn de Leastar

Con$nuous Integra$on Development Environment. Kovács Gábor

Push up your code next generation version control with (E)Git

The Actual Real World at EclipseCon/ALM

Build Automation Kurt Christensen

DevOps Online Training

Turbo boost your digital app test automation with Jenkins

Administering Apache Geronimo With Custom Server Assemblies and Maven. David Jencks

Red Hat JBoss Developer Studio 11.3

Geronimo Server Release Process

Overview of Web Application Development

Oracle Corporation

CPSC 491. Lecture 19 & 20: Source Code Version Control. VCS = Version Control Software SCM = Source Code Management

An Introduction to Eclipse Che Lets build a custom cloud IDE. October 2015 Tyler Jewell, Eclipse Che Project

Session 24. Spring Framework Introduction. Reading & Reference. dev.to/lechatthecat/how-to-use-spring-boot-java-web-framework-withintellij-idea-202p

By: Jeeva S. Chelladhurai

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

Continuous integration from the ground up

Getting started with Geomajas. Geomajas Developers and Geosparc

Cloud Native Java with Kubernetes

AALOK INSTITUTE. DevOps Training

Belle II - Git migration

Developing Applications Using Continuous Integration 12c ( )

Transcription:

LP IDSE - GL Packaging, automation, Continuous Integration Based on Simon Urli and Sébastien Mosser courses 18/10/2016 Cécile Camillieri/Clément Duffau 1

Previously. 2

Development process Develop features and tests Launch tests Develop Launch tests Release and/or deployment of a stable version 3

Development process Develop features and tests code Launch tests commands Develop code Launch tests commands Release and/or deployment of a stable version commands 4

Development process Develop features and tests code Launch tests commands -> script? Develop code Launch tests commands -> script? Release and/or deployment of a stable version commands -> script? 5

Compiling during lab sessions Sébastion Mosser 6

How far can you go like this?

Sébastion Mosser 8

Sébastion Mosser 9

Sébastion Mosser 10

Sébastion Mosser 11

One cannot do it by hand

Towards automation Automate = no human intervention => Speed => Avoid mistakes => Concentrate on the code «Lorsque vous écrivez une commande plus de trois fois, pensez à l automatiser.» - Raphaël Marvie 13

What to automate? Creation of a new project: structure, configuration, Creation of a new element: class, resource file, Tests execution Publication of tests results Packaging: creation of.jar,.zip, Deployment of software Documentation creation Documentation deployment... 14

Continuous Integration

Continuous Integration (CI) Continuous: Integration: Forming an unbroken whole; without interruption. The process of combining two or more things into one, to assemble in order to create an organic whole. Continuous Integration: The process to assemble without interruption 16

Continuous Integration Automate building of your product Have an overview of your system Trace the results of these activities 17

Building? Source code compilation Tests execution Software deployment 18

When to build? Clock: scheduled jobs Code change: job execution on commit Dependencies: after the build of another project 19

What context for building? Different OS: Windows, Mac OS, Linux,... Different architectures: 32/64 bits Called nodes 20

Example scenario Bob commits and pushes code Pull the repository Checkout on master Compile the source code Execute tests Summarize the results Bob knows if something failed 21

Example scenario Bob commits and pushes code Pull the repository Checkout on master Bob can do something else (hopefully) productive Compile the source code Execute tests Summarize the results Bob knows if something failed http://xkcd.com 22

Tools for CI Versioning Build automation Testing Assembly of these tasks: CI 23

Tools for CI Versioning For us: git Build automation For us: maven Testing For us: JUnit Assembly of these tasks: CI For us: Jenkins 24

Maven

What s maven? Descendant of Make and Ant Objectives => Handle dependencies => Automate tasks (compile, test, ) Configuration with a pom.xml file Javascript equivalent: npm for dependencies, grunt for tasks 26

pom.xml 27

pom.xml Identify uniquely a project 28

Maven repositories 29

Default maven lifecycle 30

Maven goals mvn clean: clean the project (by default, delete the target folder) mvn compile: compile the project mvn test: compile the project and tests and run the tests mvn package: compile + test then creates a package containing binaries (.jar,.war) mvn install: package + install the package locally mvn deploy: install + deploy the package on a remote maven repository 31

Back to Shapes WS <project> Identify uniquely the project <groupid>fr.unice.iut</groupid> <artifactid>shapes-ws</artifactid> <version>0.0.1-snapshot</version> Package into a war (web app) <packaging>war</packaging> <dependencies> </dependencies> <build> <plugins> </plugins> </build> </project> Required dependencies External plugins 32

Back to Shapes WS <dependencies> <dependency> <groupid>javax.xml.bind</groupid> <artifactid>jaxb-api</artifactid> <version>2.1</version> </dependency> Serialization to XML/Json <dependency> <groupid>javax.ws.rs</groupid> <artifactid>javax.ws.rs-api</artifactid> <version>2.0.1</version> </dependency> Annotations (@POST, @Consumes,... </dependencies> 33

Back to Shapes WS <dependencies> <dependency> <groupid>org.eclipse.jetty</groupid> <artifactid>jetty-servlets</artifactid> <version>8.1.10.v20130312</version> </dependency> Handle HTTP communication, deployment (sockets, etc.) <dependency> <groupid>com.sun.jersey</groupid> <artifactid>jersey-servlet</artifactid> <version>1.19</version> </dependency> Implementation of the JAX RS interface </dependencies> 34

Back to Shapes WS <build><plugins> Unique identifier of the plugin <plugin> <groupid>org.mortbay.jetty</groupid> <artifactid>jetty-maven-plugin</artifactid> <version>8.1.10.v20130312</version> <configuration> <scanintervalseconds>10</scanintervalseconds> <webapp> <contextpath>/</contextpath> <descriptor> [...] web.xml</descriptor> </webapp> </configuration> Configuration (ports, url, etc.) </plugin> </plugins></build> 35

Plugins for custom goals mvn jetty:run run a jetty (server) instance based on the configuration <configuration> <scanintervalseconds>10</scanintervalseconds> <webapp> <contextpath>/</contextpath> <descriptor> [...] web.xml</descriptor> </webapp> </configuration> Contains configuration for the web-service 36

Going further: dependencies 37

Going further: dependencies 38

Going further: modules hierarchy Parent module <groupid>fr.unice.iut</groupid> <artifactid>my-parent-project</artifactid> <version>1.0</version> 39

Going further: modules hierarchy Parent module <groupid>fr.unice.iut</groupid> <artifactid>my-parent-project</artifactid> <version>1.0</version> <modules> <module>child-a-folder</module> </module> child of Child module A <groupid>fr.unice.iut</groupid> <artifactid>child-a</artifactid> <version>0.1</version> <parent> <groupid>fr.unice.iut</groupid> <artifactid>my-parent-project</artifactid> <version>1.0</version> </parent> 40

Going further: modules hierarchy Parent module Build parent mvn install child of Child module A Build child mvn install 41

Going further: modules hierarchy Parent module Dependency in pom Parent s dependencies child of JUnit Child module A Dependency inherited from parent Child s dependencies 42

Going further: modules hierarchy <groupid>fr.unice.iut</groupid> <artifactid>my-parent-project</artifactid> <version>1.0</version> <modules> <module>child-a-folder</module> <module>child-b-folder</module> </module> Parent module child of Child module A child of Child module B <groupid>fr.unice.iut</groupid> <artifactid>child-b</artifactid> <version>0.1</version> <parent> <groupid>fr.unice.iut</groupid> <artifactid>my-parent-project</artifactid> <version>1.0</version> </parent> 43

Going further: modules hierarchy <groupid>fr.unice.iut</groupid> <artifactid>my-parent-project</artifactid> <version>1.0</version> <modules> <module>child-a-folder</module> <module>child-b-folder</module> </module> Parent module child of Child module A child of Dependency in pom Child module B <groupid>fr.unice.iut</groupid> <artifactid>child-b</artifactid> <version>0.1</version> <parent> <groupid>fr.unice.iut</groupid> <artifactid>my-parent-project</artifactid> <version>1.0</version> </parent> <dependencies><dependency> <groupid>fr.unice.iut</groupid> <artifactid>child-a</artifactid> <version>0.1</version> </dependency></dependencies> 44

Going further: modules hierarchy Parent module child of child of child of Child module A Dependency in pom Child module B Child module B2 Dependency inherited from parent 45

Maven to Build... Test Deploy...

CI to Automate... Trace...

...Sleep at night

Jenkins Setup http://iut-outils-gl.i3s.unice.fr/jenkins/job/lpidse16-17 /job/lpidse16-17/ Plug-and-play solution with maven goals Need a Jenkinsfile file at git repository root 49

The default Jenkinsfile The node where it will be executed node ('master') { checkout scm Keep an eye on multi-branch sh 'mvn clean package' } The maven goal to apply 50

The default Jenkinsfile The server node where it will be executed. This is not the git branch. Do not change. node ('master') { checkout scm Keep an eye on multi-branch sh 'mvn -f myfolder clean package' } The maven goal to apply -f to reference the folder containing the pom.xml file 51

?