Slide 1

Slide 1 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e GitOps Using Git as a deployment mechanism Jachim Coudenys [email protected] @coudenysj

Slide 2

Slide 2 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 3

Slide 3 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 4

Slide 4 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 5

Slide 5 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 6

Slide 6 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e GitOps Using Git as a deployment mechanism

Slide 7

Slide 7 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 8

Slide 8 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Quiz Repository Commit Cloning Branch Tag Remote Push Merge Request

Slide 9

Slide 9 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Remotes Remotes

Slide 10

Slide 10 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Other features Code Repository Tickets Merge Requests Wiki ... Running idle most of the time

Slide 11

Slide 11 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Important Git "events" & "concepts" special branches merge commits tags ...

Slide 12

Slide 12 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e git-flow

Slide 13

Slide 13 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 14

Slide 14 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e develop The main development branch Ideally this branch only contains merge commits

Slide 15

Slide 15 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 16

Slide 16 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e master This branch represents code in production This branch must only contain merge commits

Slide 17

Slide 17 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 18

Slide 18 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e feature/* New development is done in a feature branch This branch is started from develop and will be merged back into develop when it’s done By using a feature branch, you can leverage merge request

Slide 19

Slide 19 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 20

Slide 20 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e release/* This branch sits between develop and master (getting ready for a new production release) This branch is short-lived and totally optional

Slide 21

Slide 21 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 22

Slide 22 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e hotfix/* When something is wrong in production, a fix can be produced via a hotfix branch This branch is started from master and will be merged into both master and develop

Slide 23

Slide 23 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 24

Slide 24 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Summary develop master

Slide 25

Slide 25 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Continuous Integration

Slide 26

Slide 26 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e In software engineering, continuous integration (CI) is the practice of merging all developer working copies to a shared mainline several times a day. -- https://en.wikipedia.org/wiki/Continuous_integration

Slide 27

Slide 27 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Extreme programming (XP) adopted the concept of CI and did advocate integrating more than once per day – perhaps as many as tens of times per day. -- https://en.wikipedia.org/wiki/Continuous_integration

Slide 28

Slide 28 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Avoiding Integration Hell

Slide 29

Slide 29 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Key Points 1. Commit Early, Commit Often 2. Never Commit Broken Code 3. Fix build failures immediately 4. Fail Fast 5. Act on metrics 6. Build in every target environment 7. Create artefacts from every build

Slide 30

Slide 30 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Continuous Delivery

Slide 31

Slide 31 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Continuous delivery (CD) is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time. -- https://en.wikipedia.org/wiki/Continuous_delivery

Slide 32

Slide 32 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e It aims at building, testing, and releasing software faster and more frequently. The approach helps reduce the cost, time, and risk of delivering changes by allowing for more incremental updates to applications in production. A straightforward and repeatable deployment process is important for continuous delivery. -- https://en.wikipedia.org/wiki/Continuous_delivery

Slide 33

Slide 33 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Deployment pipeline

Slide 34

Slide 34 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 35

Slide 35 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Continuous Delivery ≠ Continuous Deployment Continuous deployment: every change is automatically deployed to production. Continuous delivery: ensures every change can be deployed to production. In order to do continuous deployment one must be doing continuous delivery.

Slide 36

Slide 36 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e GitOps?

Slide 37

Slide 37 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Coined by Weaveworks

Slide 38

Slide 38 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Operations by Pull Requests

Slide 39

Slide 39 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Git as the Source of Truth version control history peer review rollback

Slide 40

Slide 40 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e SvnOps at my first job Mimic server filesystem in SVN Rsync new files to server Restart services (linked to file path)

Slide 41

Slide 41 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e ChatOps How GitOps relates to ChatOps

Slide 42

Slide 42 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 43

Slide 43 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e ChatOps, a term widely credited to GitHub, is all about conversation-driven development. By bringing your tools into your conversations and using a chat bot modified to work with key plugins and scripts, teams can automate tasks and collaborate, working better, cheaper and faster. -- https://www.pagerduty.com/blog/what-is-chatops/

Slide 44

Slide 44 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e While in a chat room, team members type commands that the chat bot is configured to execute through custom scripts and plugins. These can range from code deployments to security event responses to team member notifications. The entire team collaborates in real-time as commands are executed. -- https://www.pagerduty.com/blog/what-is-chatops/

Slide 45

Slide 45 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Visibility Across The Board

Slide 46

Slide 46 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Automate Manual Tasks

Slide 47

Slide 47 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e GitOps in combination with ChatOps Git has better history Git(lab) has a more bundled view Report to chat, finale GO from chat ...

Slide 48

Slide 48 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 49

Slide 49 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Pipelines

Slide 50

Slide 50 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e .gitlab-ci.yml

Slide 51

Slide 51 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 52

Slide 52 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Semantic Versioning

Slide 53

Slide 53 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Semantic versioning is a way of applying versions to your software so it’s clear what impact it may have. https://blog.jachim.be/2017/07/git-flow-dtap-semver/

Slide 54

Slide 54 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

Slide 55

Slide 55 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Only the master branch receives tags

Slide 56

Slide 56 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Merge develop in master: MAJOR.MINOR tag (only increment the MAJOR number is the change is big enough)

Slide 57

Slide 57 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Merge hotfix branch into master: increase the PATCH version

Slide 58

Slide 58 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 59

Slide 59 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e DevOps How GitOps relates to DevOps

Slide 60

Slide 60 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 61

Slide 61 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e DevOps toolchain Code — code development and review, source code management tools, code merging Build — continuous integration tools, build status Test — continuous testing tools that provide feedback on business risks Package — artifact repository, application pre-deployment staging Release — change management, release approvals, release automation Configure — infrastructure configuration and management, Infrastructure as Code tools Monitor — applications performance monitoring, end–user experience

Slide 62

Slide 62 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Combell Autogit

Slide 63

Slide 63 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e

Slide 64

Slide 64 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Further reading How we're building GitLab into the complete DevOps toolchain. Beyond CI/CD: GitLab's DevOps vision Auto DevOps Auto DevOps brings DevOps best practices to your project by automatically configuring your build, test, code quality assurance, review apps, deployment, and monitoring in a single environment.

Slide 65

Slide 65 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Summary Put everything it Git Don't do anything manually Put the server to work! Take a look at Gitlab CI/CD

Slide 66

Slide 66 text

Jachim Coudenys - - [email protected] @coudenysj https://joind.in/talk/d8b4e Thank you Jachim Coudenys [email protected] @coudenysj https://joind.in/talk/d8b4e