O documento apresenta padrões e princípios para deploy e entrega contínua de software, incluindo a utilização de pipelines de entrega, deploy incremental e mudança paralela para reduzir riscos, e técnicas como implantação azul-verde, canário e feature toggles.
15. PIPELINE DE ENTREGA
13
Repositório
de Código
Build e Testes
de Unidade
Testes de
Aceitação
Validação
com Usuário
Deploy em
Produção
F
commit
feedback
P
commit
feedback
F
P
commit
P
P
aprovação
16. PIPELINE DE ENTREGA
14
App A
Service B
Service C
Unit
Tests
Version
Control
Artifact
Repository
Integration
Tests
Unit
Tests
Integration
Tests
Unit
Tests
Integration
Tests
Contract
Tests
Contract
Tests
Deploy to
Dev Smoke
Deploy to
Int Application
Testing Smoke
Service D
App E
Service F
Unit
Tests
Integration
Tests
Unit
Tests
Integration
Tests
Unit
Tests
Integration
Tests
Contract
Tests
Deploy to
Dev Smoke
Application
Testing
Contract
Tests
Deploy to
Dev Smoke
Deploy to
Int Smoke
Deploy to
Int
End to End
Testing
Dev
Environment
Deploy to
Performance
QA Smoke
Testing UAT
Integration
Environment
QA
Environment
Deploy to
Production Smoke
COTS
Production
Environment
Deploy to
Int
(...)
(…)
27. FOQUE EM ENTREGAR LOTES PEQUENOS
20
https://www.flickr.com/photos/pelosi/2836152295 https://www.flickr.com/photos/55391407@N03/5137410738
MTBF
Mean Time Between Failure
MTTR
Mean Time To Recover
vs.
28. FOQUE EM ENTREGAR LOTES PEQUENOS
20
https://www.flickr.com/photos/pelosi/2836152295 https://www.flickr.com/photos/55391407@N03/5137410738
MTBF
Mean Time Between Failure
MTTR
Mean Time To Recover
vs.
29. QUALIDADE DEVE ESTAR EMBUTIDA
NO PROCESSO
https://www.flickr.com/photos/edgarallanbro/71979142271 4
30. MUDANÇA PARALELA
22
Também conhecida como “Expansão e Contração”
http://www.thoughtworks.com/insights/blog/mudança-paralela
https://www.flickr.com/photos/telstar/8246798446
31. 1. EXPANSÃO
23
class Grid {
private Cell[][] cells;
…
!
public void addCell(int x, int y, Cell cell) {
cells[x][y] = cell;
}
public Cell fetchCell(int x, int y) {
return cells[x][y];
}
!!
public boolean isEmpty(int x, int y) {
return cells[x][y] == null;
}
!!!
}
32. 1. EXPANSÃO
24
class Grid {
private Cell[][] cells;
…
!
public void addCell(int x, int y, Cell cell) {
cells[x][y] = cell;
}
!
public Cell fetchCell(int x, int y) {
return cells[x][y];
}
!!!
public boolean isEmpty(int x, int y) {
return cells[x][y] == null;
}
!!!
}
33. 1. EXPANSÃO
25
class Grid {
private Cell[][] cells;
private Map<Coordinate, Cell> newCells;
…
!
public void addCell(int x, int y, Cell cell) {
cells[x][y] = cell;
}
public void addCell(Coordinate coordinate, Cell cell) {
newCells.put(coordinate, cell);
}
public Cell fetchCell(int x, int y) {
return cells[x][y];
}
public Cell fetchCell(Coordinate coordinate) {
return newCells.get(coordinate);
}
public boolean isEmpty(int x, int y) {
return cells[x][y] == null;
}
public boolean isEmpty(Coordinate coordinate) {
return !newCells.containsKey(coordinate);
}
}
34. 2. MIGRAÇÃO
26
Nova Versão
Cliente
Versão
Antiga
Cliente
Cliente
addCell(int x, int y, Cell cell)
fetchCell(int x, int y)
isEmpty(int x, int y)
Cell[][] cells
Map<Coordinate, Cell> newCells
35. 2. MIGRAÇÃO
27
Nova Versão
Cliente
Versão
Antiga
Cliente
Cliente
addCell(int x, int y, Cell cell)
fetchCell(Coordinate c)
isEmpty(Coordinate c)
Cell[][] cells
Map<Coordinate, Cell> newCells
36. 3. CONTRAÇÃO
28
Nova Versão
Cliente
Cliente
Cliente
addCell(Coordinate c, Cell cell)
fetchCell(Coordinate c)
isEmpty(Coordinate c)
Cell[][] cells
Map<Coordinate, Cell> cells
37. 3. CONTRAÇÃO
29
class Grid {
private Cell[][] cells;
private Map<Coordinate, Cell> newCells;
…
!
public void addCell(int x, int y, Cell cell) {
cells[x][y] = cell;
}
public void addCell(Coordinate coordinate, Cell cell) {
newCells.put(coordinate, cell);
}
public Cell fetchCell(int x, int y) {
return cells[x][y];
}
public Cell fetchCell(Coordinate coordinate) {
return newCells.get(coordinate);
}
public boolean isEmpty(int x, int y) {
return cells[x][y] == null;
}
public boolean isEmpty(Coordinate coordinate) {
return !newCells.containsKey(coordinate);
}
}
40. IMPLANTAÇÃO AZUL-VERDE
32
Verde
Azul
Servidor
web
Servidor de
aplicação
Servidor de
BD
Usuários Roteador
Servidor
web
Servidor de
aplicação
Servidor de
BD
41. IMPLANTAÇÃO AZUL-VERDE
33
Verde
Azul
Servidor
web
Servidor de
aplicação
Servidor de
BD
Usuários Roteador
Servidor
web
Servidor de
aplicação
Servidor de
BD
43. IMPLANTAÇÃO AZUL-VERDE
35
Azul
Verde
Azul
Verde
Servidor
web
Servidor de
BD
Usuários Roteador
Servidor
web
Servidor de
BD
Servidor de
aplicação
Servidor de
aplicação
44. IMPLANTAÇÃO AZUL-VERDE
36
Azul
Verde
Azul
Verde
Servidor
web
Servidor de
BD
Usuários Roteador
Servidor
web
Servidor de
BD
Servidor de
aplicação
Servidor de
aplicação
45. IMPLANTAÇÃO AZUL-VERDE
37
Azul
Verde
Azul
Verde
Servidor
web
Servidor de
BD
Usuários Roteador
Servidor
web
Servidor de
BD
Servidor de
aplicação
Servidor de
aplicação
48. IMPLANTAÇÃO CANÁRIO
40
Versão Antiga
Nova Versão
Servidor
web
Servidor de
aplicação
Servidor de
BD
Servidor
web
Servidor de
aplicação
Servidor de
BD
Todos os
usuários
Usuários Roteador
49. IMPLANTAÇÃO CANÁRIO
41
Versão Antiga
Nova Versão
Servidor
web
Servidor de
aplicação
Servidor de
BD
Servidor
web
Servidor de
aplicação
Servidor de
BD
Maior parte dos
usuários
(95%)
Usuários Roteador
Alguns
usuários
(5%)
50. IMPLANTAÇÃO CANÁRIO
42
Versão Antiga
Nova Versão
Servidor
web
Servidor de
aplicação
Servidor de
BD
Servidor
web
Servidor de
aplicação
Servidor de
BD
Alguns
usuários
Usuários Roteador
(2%)
Maior parte
dos usuários
(98%)
51. IMPLANTAÇÃO CANÁRIO
43
Versão Antiga
Nova Versão
Servidor
web
Servidor de
aplicação
Servidor de
BD
Servidor
web
Servidor de
aplicação
Servidor de
BD
Usuários
Roteador
Todos os
usuários
53. FEATURE TOGGLE
45
share_with_friends = false
Configuração:
Livro Devops na Prática: Entrega de Software Confiável e Automatizada
http://www.devopsnapratica.com.br Google
54. FEATURE TOGGLE
46
share_with_friends = true
Configuração:
Livro Devops na Prática: Entrega de Software Confiável e Automatizada
http://www.devopsnapratica.com.br Google
55. 47
ENTREGA NO
ESCURO
https://www.flickr.com/photos/dwrose/3967195917
56. ENTREGA NO ESCURO
48
Web Page Title
http://facebook.com Google
João
Backend de Chat
Web Page Title
http://facebook.com Google
Maria
57. ENTREGA NO ESCURO
49
Web Page Title
http://facebook.com Google
Phasellus nulla risus, semper non dictum semper, congue
vitae augue. Nunc vulputate ligula eget neque tempus.
Maria
disse
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur eget ultrices velit.
Suspendisse ut justo elementum felis facilisis aliquam ut
sit amet mi. Praesent sit amet venenatis eros. Fusce est
João
João tellus, congue ac augue in, congue elementum quam.
disse
Backend de Chat
Web Page Title
http://facebook.com Google
Maria
Phasellus nulla risus, semper non dictum semper, congue
vitae augue. Nunc vulputate ligula eget neque tempus.
Maria
disse
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur eget ultrices velit.
Suspendisse ut justo elementum felis facilisis aliquam ut
sit amet mi. Praesent sit amet venenatis eros. Fusce est
João tellus, congue ac augue in, congue elementum quam.
disse
58. ENTREGA NO ESCURO
50
Web Page Title
http://facebook.com Google
Phasellus nulla risus, semper non dictum semper, congue
vitae augue. Nunc vulputate ligula eget neque tempus.
Maria
disse
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur eget ultrices velit.
Suspendisse ut justo elementum felis facilisis aliquam ut
sit amet mi. Praesent sit amet venenatis eros. Fusce est
João
João tellus, congue ac augue in, congue elementum quam.
disse
Backend de Chat
Web Page Title
http://facebook.com Google
Maria
Phasellus nulla risus, semper non dictum semper, congue
vitae augue. Nunc vulputate ligula eget neque tempus.
Maria
disse
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur eget ultrices velit.
Suspendisse ut justo elementum felis facilisis aliquam ut
sit amet mi. Praesent sit amet venenatis eros. Fusce est
João tellus, congue ac augue in, congue elementum quam.
disse
83. PRINCÍPIOS PARA ENTREGAS
DE BAIXO RISCO
1. Incremental é melhor que “big bang”
2. Implantação != Entrega
3. Foque em entregar lotes pequenos
4. Qualidade deve estar embutida no
processo
65