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

Similar documents
Computer Science Design I Version Control with Git

GUIDE TO MAKE A REAL CONTRIBUTION TO AN OPEN SOURCE PROJECT 1. 1

From Continuous Integration To Continuous Delivery With Jenkins

Version Control Systems

GIT. CS 490MT/5555, Spring 2017, Yongjie Zheng

Practical C Programming

Revision control. INF5750/ Lecture 2 (Part I)

Version Control Systems


Version Control. Version Control

CSCI 2132: Software Development. Norbert Zeh. Faculty of Computer Science Dalhousie University. Subversion (and Git) Winter 2019

Configura)on Management Founda)ons. Leonardo Gresta Paulino Murta

Version Control System - Git. zswu

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

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

Version Control. So#ware Quality Quality Audit and Cer2fica2on. Master in Computer Engineering. Roberto García

Introduction to Version Control

Weak Consistency and Disconnected Operation in git. Raymond Cheng

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

Object Oriented Programming. Week 1 Part 2 Git and egit

GIT TUTORIAL. Creative Software Architectures for Collaborative Projects CS 130 Donald J. Patterson

Source Code Management wih git

Submitting your Work using GIT

[Software Development] Development Tools. Davide Balzarotti. Eurecom Sophia Antipolis, France

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

Version Control with GIT

Versioning with git. Moritz August Git/Bash/Python-Course for MPE. Moritz August Versioning with Git

Index. Alias syntax, 31 Author and commit attributes, 334

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 17, 2018

CSE 391 Lecture 9. Version control with Git

Version Control. Version Control

Introduction to distributed version control with git

Software configuration management

A BASIC UNDERSTANDING OF VERSION CONTROL

M E R C U R I A L (The Source Control Management)

Git. Ľubomír Prda. IT4Innovations.

! #Running this command from the top directory of your project will add all your changes."! $ git add."

Version control with Git.

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

Project Management. Overview

Configuring Git. Matthieu Moy. configuring-git-slides.

CS108, Stanford Handout #37. Source Control CVS

Laboratorio di Programmazione. Prof. Marco Bertini

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

Tools for software development:

Best Practices and Pitfalls for Building Products out of OpenDaylight

Git Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : October, More documents are freely available at PythonDSP

2/9/2013 LAB OUTLINE INTRODUCTION TO VCS WHY VERSION CONTROL SYSTEM(VCS)? II SENG 371 SOFTWARE EVOLUTION VERSION CONTROL SYSTEMS

Revision Control and GIT

Topics covered. Introduction to Git Git workflows Git key concepts Hands on session Branching models. Git 2

Version Control: Gitting Started

2/8/18. Overview. Project Management. The First Law. What is Project Management? What Are These Changes? Software Configuration Management (SCM)

Revision Control II. - svn

CS314 Software Engineering Configuration Management

CS 320 Introduction to Software Engineering Spring February 06, 2017

February 2 nd Jean Parpaillon

Git Basi, workflow e concetti avanzati (pt2)

Version Control Systems (VCS)

2 Initialize a git repository on your machine, add a README file, commit and push

Technology Background Development environment, Skeleton and Libraries

Version Control Systems. Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University

Software Revision Control for MASS. Git Installation / Configuration / Use

Common Git Commands. Git Crash Course. Teon Banek April 7, Teon Banek (TakeLab) Common Git Commands TakeLab 1 / 18

Lab Exercise Git: A distributed version control system

GIT for companies Mark Struberg, INSO TU Vienna

Fundamentals of Git 1

Construction: version control and system building

Integrating Selenium with Confluence and JIRA

1. Git. Robert Snapp

Continuous Integration (CI) with Jenkins

Working in Teams CS 520 Theory and Practice of Software Engineering Fall 2018

GETTING TO KNOW GIT: PART II JUSTIN ELLIOTT PENN STATE UNIVERSITY

Version Control with Git

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

AIS Grid School 2015

Outline. Version Control System (VCS) basics Git terminology & concepts Basic Git commands Branches in Git Git over the network (time permitting)

Software Development I

Version Control with GIT: an introduction

Revision Control. An Introduction Using Git 1/15

Lab Objective. Lab Assignment. Downloads and Installation

Introduction to Git and Github

Preliminary ACTL-SLOW Design in the ACS and OPC-UA context. G. Tos? (19/04/2016)

Outline. Configuration management. Main Phases MOTIVATION

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

Documentation External Synchronization FirstSpirit

Version Control for Fun and Profit

Version control system (VCS)

DevOps and Microservices. Cristian Klein

CS 390 Software Engineering Lecture 5 More Git

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

Using git to download and update BOUT++

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

Git tutorial. Katie Osterried C2SM. October 22, 2015

Charlie Garrod Bogdan Vasilescu

USING GIT FOR AUTOMATION AND COLLABORATION JUSTIN ELLIOTT - MATT HANSEN PENN STATE UNIVERSITY

Versioning. Terms. Configuration item (CI) Version Configuration Management aggregate Configuration Baseline

TDDC88 Lab 4 Software Configuration Management

Introduction to Git. Database Systems DataLab, CS, NTHU Spring, 2018

Transcription:

Con$nuous Integra$on Development Environment Kovács Gábor kovacsg@tmit.bme.hu

Before we start anything Select a language Set up conven$ons Select development tools Set up development environment Set up hardware and middleware configura$ons

What is a good language? What is easy to refactor Later More difficult: No garbage collec$on No object orienta$on

What APIs to use? When to decide? Last responsible moment For most of the adopted technologies it is before wri$ng any code How to select the appropriate technologies, APIs? Experience of team members Take dependencies into account If new, try it before use!

Development environment client Use the same IDE Use the same version control system Binary repository client Desktop sharing tools VPN access Virtual machines

Development environment central Version control server Con$nuous Integra$on server Plugins Repor$ng Binary repository manager

Version control What is version control? Records changes of files Controlled files or the whole project can be reverted to a stable version What should be controlled? Source code Configura$on files Plain text documenta$on What should not be controlled? Binaries (exe, jar) Non- plain text documenta$on (pdf, doc etc.)

Version control Version control system types: Local Centralized Distributed Version control methods: Backup files Store only differences (deltas), and apply patches when upgrading or rever$ng

Local version control File backup into another directory Simple Uses a lot of disk space Accidental overwri$ng Difficult rever$ng RCS Local database Stores only patches in a version database No collabora$on

Centralized version control Provides collabora$on Popular: CVS, SVN Version database is on a centralized server Easy administra$on and access control Stores only patches in the version database The centralized server is a single point of failure Server goes down The repository gets corrupted

Distributed version control Local mirroring of the central repository A corrupted version database can be restored from the local ones Supports offline work Popular: Git, Mercurial Stores either files (Git) or patches (Mercurial) Mul$- level repositories for groups A bit more difficult to administer and to use

Version control terms Repository: where the master copy of version controlled files is stored Working copy: developers copy that is changed Check out: get a working copy of a set of files from the repository Commit: send changes to the repository Revision, snapshot: a commi_ed change of a set of files Log message: a comment describing the changes in a commit Update: fetch commi_ed changes made by others Merge: applying commits to the repository Conflict: contradic$ng changes commi_ed to the same region of the same file by mul$ple users

Merge, patch Patch: a series of instruc$ons to transform input text T to a different T Lines are numbered Two opera$ons: Dele$on of old text The index of the line where to start dele$ng text The number of lines to be deleted Addi$on of new text The index of line where to add the text The text to be added Replacement is the combina$on of a dele$on followed by an addi$on Merge tools

Controlled file states Unchanged, current Locally changed, current Unchanged, out of date Locally changed, out of date

Version control conflict Source: SVN documenta$on

Version control conflict resolu$on Lock modify unlock: One person can change a file at a $me Unlocking may require administrator interven$on Edi$ng different parts of a file is not possible Does not handle the func$onal dependency between files Copy modify merge: Checkout a file at any $me Aeer a commit by another user the file becomes out- of- date à user must update the working copy before a commit

Version control conflict resolu$on Automa$c resolu$on: The version control system can do that if different parts of the file have been edited Manual resolu$on: Same parts edited Seman$c conflicts Coding conven$ons not kept Solu$on: user communica$on

Repository addressing schemas The address is an URI The URI is associated with the server and its the authen$ca$on method, e.g.: File system path: the user must have read/write permissions cvs d file:///usr/local/cvs command SSH: the user must have a user account cvs d :pserver:user@server.com:/usr/local/cvs command HTTP: the user must pass through a web server authen$ca$on svn co h_p://server.com/svn/project Custom protocol: custom authen$ca$on segngs svn co svn://server.com/svn/project

Revision labeling, numbering

Version graph Directed acyclic graph (DAG) Nodes: revisions Edges: commit From the node of the new revision To the node that the changes are made to Each node (commit) has proper$es: author comment number (integer or hash) Each node can be associated with arbitrary number of labels used for version master: the default branch in the DAG HEAD: the branch the user is working on

Version graph Configura$on: Set user data like user name and user email used in commits git config - - global user.name alice git config - - global user.email alice@server.com Set up an alias for commands git config - - global alias.ci commit Set core proper$es like the editor for commits git config - - global core.editor vi Configura$on in configura$on file Repository specific in <repository>/config, user specific in ~/.gitconfig, global in /etc/gitconfig The files store key=value pairs [user] name = Alice

Version graph How to get a repository? Ini$alizing a local repository local: git init <directory> Ini$alizing a central repository Bare repositories cannot be edited locally central: git init - - bare Cloning a remote repository git clone <repository> <directory> First push to a remote repository git push origin master

Version graph Crea$ng a new label for HEAD, a new branch: git create branch tes$ng

Version graph Aeer checking out tes$ng and commi$ng git checkout tes$ng git commit a m a change Branch switch: files change

Version graph Checking out master again, the head pointer moves git checkout master

Version graph Aeer a commit master and tes$ng diverge git commit - a - m changes

Version graph Merging git merge master iss53 Base is the common anscestor

Version graph Remote branching Same graph, special labels, merging works the same way Local vs. remote repository: <remote>/<branch> <remote> refers to a remote Git server <branch> refers to a local branch default remote is called origin Mul$ple remote repositories If the project is distributed to mul$ple Git servers Mul$ple master branches can exist

Version graph Local branch to remote branch git push <remote> <localname>[:<remotename>] Remote branch to local branch Get all changes from the remote repository git fetch <remote> Get all changes from the remote repository and merge with the local changes git pull <remote> Get all changes from the remote and forget all local changes git checkout <remote>/<branch> Get the remote master branch git clone <repository>

Version graph Branch management git branch Branch states merged not merged head Aeer merging merged branch can be deleted git branch - d iss53

Version graph Progressive stability branches: labels along the same branch master = stable or produc$on tes$ng development

Version control commands New repository Ini$alizing one in an exis$ng directory git init Version control files git add *.c Remote files from version control git rm *.c.gi$gnore file What s been changed git diff Commigng changes git commit - m Message Rename or move a version controlled file: add + rm

Con$nuous Integra$on Goal: be able to deploy for produc$on all but the last few hours work at any $me How? Integrate code every few hours Keep build, test infrastructure up- to- date The integrated code must work on all machines Works on my computer is not sufficient The build must not be cancelled To be able to find the loca$on of errors in logs

Con$nuous integra$on How does it work? Fetch others work from the repository Test locally if local changes s$ll pass tests Send local changes to the repository Take the integra$on token Trigger build Release the integra$on token if all tests pass, otherwise fix error and repeat the procedure holding the token

Build automa$on Local build Done every few minutes to test a new feature Allows build and test Integra$on build Build $me: local + integra$on can be slow usually because of the tests Distributed compila$on Incremental compila$on Mul$stage build: Run a few tests on commit Complete build asynchronously with all tests

Ten- minute build Programmers maintain a ten- minute build that can build a complete release package at any $me For release For new member of the team What does it cover? Compile sources Run tests Configure segngs Ini$alize database schemas Set up web servers

Ten- minute build When to write the build scripts and configura$on files? Before things get out of control at the first itera$on Difficult for exis$ng systems with lots of components Build scripts and tools should be version controlled

CI Server Jenkins (Hudson) Prerequisites Java interpreter: Jenkins is wri_en in Java Deploying Running the bundle starts an embedded web container java - jar jenkins.war Deploy the war in any Java web container

Jenkins configura$on Mandatory: Version controller configura$on: cvs, svn, git etc., flags Version control repository: address, authen$ca$on Build scripts: a set of command that transforms the source code into ar$facts Not just compiling, but packaging as well

Jenkins configura$on Op$onal: Interpreters Build engine Binary repository and dependency manager Security Authen$ca$on: LDAP, Jenkins database, container s database Authoriza$on: free for all, login required, policies

Jenkins build Inputs: Source code in any language, not just Java Configura$on files: property files, XML Resources: images, sta$c web pages Outputs: Binaries: jar, exe, dll, so Installer Documenta$on: javadoc, doxygen Source package

Jenkins build Build configura$on file The work is done by a build engine: make, ant, maven, rake or a custom shell script Build can execute tests When to build? Scheduled, cron- like On demand, triggered on the web page On commit Feedback: email, RSS, on the web page

External dependencies Where to put project dependencies? Source repository Dependency management

Jenkins plugins Code quality Repor$ng Documenta$on Later

Binary repository manager We said that Source files are version controlled Binaries should not be version controlled What to do with object code?

Binary repository manager Repository manager stores ar$facts Build versions Test versions Source in a binary archive Dependencies, third party libraries Documenta$on in a binary archive Build metadata: like date and $me

Binary repository manager Ar$facts are language and target dependent C/C++: zip or tar Java: jar, war, ear Windows: dll Linux: tar with metadata like deb or rpm

Maven Maven is: Command line Java tool for Java projects: compile, test, package, deploy etc. Dependency management tool Ar$fact repository An ar$fact (project) is described with a POM (Project Object Model) that is an XML file: groupid, ar$factid, version and dependencies Maven goals, archetypes: what to do with a POM Similar to Ant tasks It is a plugin