This is an old revision of the document!


Cursul 01 - Git/BitBucket, Nexus

1. Context DevOps

DevOps = Development & Operations Echipele de development coopereaza cu cele de suport sisteme si au de obicei motivatii, terminologii, tool-uri diferite. In timp ce echipele de development vor viteza si flexibilitate, cele de suport sistem vor sisteme stabile, standardizate. Conceptul DevOps urmareste sa gaseasca o punte comuna si un compromis intre cele doua directii printr-o cultura comuna, un set de principii de operare si set de “best practices” astfel incat fiecare parte implicata sa isi indeplineasca rolul cu un impact minim asupra celeilalte.

Metoda principala este un set de practici care sa automatizeze pasii operationali si sa asigurare configuratii standardizate:

  • Dev: standardizeaza si automatizeaza pasii de la development la testare, securizare si executie peste mai multe medii
  • Ops: automatizeaza configurarea si deploymentul infrastructurii, monitorizand peste mai multe domenii si permitand rezolvarea rapida a eventualelor probleme
Practici DevOps
  • Controlul versiunilor si strategii de branching
  • Pipeline-uri de CI/CD
  • Containere care standardizeaza si izoleaza mediile de executie
  • Scriptarea infrastructurii IaC
  • Monitorizarea pipeline-urilor si integritatii aplicatiilor
CI/CD Pipeline

Continuous Integration - Continuous Development = CI/CD Un pipeline CI/CD este un proces segmentat in mai multi pasi (“stages”) de livrare a unei noi versiuni de software. Introduce automatizarea si monitorizarea pe fiecare din acesti pasi mai ales privind fazele de integrare si testare dar si in timpul livrarii produsului. Desi este posibila executia manuala a fiecarui pas din pipeline, adevarata valoare este adusa prin automatizare.

Elemente tipice ale unui pipeline CI/CD: * Versionarea codului - * Build - compilarea aplicatiei * Test - testare: unitare, functionala, de integrare, end-to-end * Release - livrarea aplicatiei in repository * Deploy- instalare * Validation & Compliance - verificare vulnerabilitati/ conformitate

2. Controlul Versiunii codului

Sistemul de control al versiunii codului inregistreaza schimbarile asupra unui fisier sau set de fisiere astfel incat s aputem accesa versiuni anterioare ale codului. Dezvoltarea de software fiind un domeniu foarte dinamic,aplicatiile si codul sunt constant supuse modificarilor. Astfel incat monitorizarea acestor modificari este un aspect esential.

De obicei orice proiect software este gestionat de o echipa de developeri. Fiecare din ei lucreaza pe un anumit topic al proiectului general.Fiecare trebuie sa scrie cod si sa il testeze pe taskul asociat fara sa impacteze munca celorlalti colegi.

In plus fata de facilitarea lucrului in paralel pe orice proiect, cand s-a comis o greseala, putem folosi versionarea sa identificam problema si sa ne intoarcem la ultima versiune functionala a codului. Cu cat un proiect devine mai mare, mai complex si mai versatil, cu atat devine mai important sa stapanim si sa dezvolatm acest skill.

2.1 Concepte

* Repository - baza de date incluzand schimbarile asupra proiectului * Commit - un snapshot al proiectului la un animit moment * Checkout - copie locala a proiectului * Branch - pointer la un commit * Upstream/ downstream - remote vs local * HEAD - pointer la branch-ul curent

Tipuri de sisteme de control versiune

Types of Version Control Systems There are two main types of version control systems: centralized and distributed version control systems. Centralized version control systems

Image by the author (made using Canva) Centralized version control systems (CVCS) are a type of version control system with a single server containing all versions of the code files — often stored in repositories — the number of contributors (programmers working on the code files), and the backup files for the main project. This setup allows every contributor to the code to know what the others are working on, making it easier to communicate and manage the people based on a specific task. The main downside for this setup is that since all the code files and the backup files are stored on one centralized server, if something were to happen to the server, then everything will be lost. Subversion and Perforce are examples of CVCS. Distributed version control systems

Image by the author (made using Canva) Distributed Version Control Systems (DVCS) such as Git, Mercurial, or Bazaar are version control systems with one or more main server containing the code files. However, unlike CVCS, in DVCS, the code files are mirrored on every contributors’ computer, meaning each one of them has its own version of the code, including its full history to work on locally. So, if any server dies, any of the contributors’ repositories can be copied back up to the server once it’s back on and restore the history of the code files. This could be done easily because every clone of the original code files is really a full backup of all the project’s data. DVCS allows different groups of people in different physical locations to collaborate within the same project simultaneously. This is an advantage that wasn’t possible in centralized systems. Benefits of Version Control Using a version control system has various benefits to any team of software developers, including: 1 Generate backups Perhaps the most vital benefit of using a version control system is that every time a contributor clones a repository, they are, in a sense creating a backup of the current version of that repository. Having multiple backups on different machines is valuable so we can secure the data from losing in the cause of server failure. 2 Test and experiment In today’s world, any source code is always under development. New features are always added, a new audience to be targeted, and new applications to be developed. When a team works on a software project, they often have different main project clones to develop new features on, test them, and make sure they function properly before this new feature can be added to the main project. This could save time as different aspects of the code can be developed simultaneously. 3 Keep history and track changes Having a record of the changes in a specific code file could help you and new contributors understand how a specific part of the code came to be. How did it start and develop over time to reach its current version. Moreover, if over time, the addition of a certain feature causes difficulties in extending or expanding the project, using version control allows the developers to track that particular feature out and change it or remove it without affecting the project's functionality. 4 Collaborate and contribute One of the main benefits of version control systems, especially DVCS, is that it allowed us to contribute to projects we liked despite being in different countries. I would argue that the existence of DVCS was one of the main facilitators that allowed open-source technology to reach its current success. Takeaways Fully understanding version control systems, how they work and using them efficiently is one of the essential skills any programmer or software developers need to work on and grow to excel in their career. Version control systems could be one of these topics that are quite complex and difficult to wrap your head around. That’s why I decided to create a series of articles tackling the different aspects of version control. The goal of these articles is to get you comfortably and easily started with version control. The upcoming articles in this series will cover Git basics commands that every developer should know, some advanced commands to make you stand out, and how to use Git efficiently to make your workflow smooth and pleasant.

4. Managementul Outputului: Nexus

5. Resurse utile

devops/cursuri/01.1626697278.txt.gz · Last modified: 2021/07/19 15:21 by laura.stoilescu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0