Integração Contínua com containers Docker Fabricio Leotti fabricio.leotti@gmail.com @lonefreak
Agenda Stacks Continuous Integration Docker Dockerize Continuous Integration Docker + Jenkins
Devtools
Stacks
Stacks
Stacks
Stacks
Stacks
Stacks
Stacks
Stacks
Stacks
Stacks
Continuous Integration Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. -- Martin Fowler
Continuous Integration Maintain a code repository Automate the build Make the build self-testing Everyone commits to the baseline every day Every commit (to baseline) should be built Test in a clone of the production environment Make it easy to get the latest deliverables Everyone can see the results of the latest build Keep the build fast Automate deployment
Continuous Integration Maintain a code repository Automate the build Make the build self-testing Everyone commits to the baseline every day Every commit (to baseline) should be built Test in a clone of the production environment Make it easy to get the latest deliverables Everyone can see the results of the latest build Keep the build fast Automate deployment
Continuous Integration Maintain a code repository Automate the build Make the build self-testing Everyone commits to the baseline every day Every commit (to baseline) should be built Test in a clone of the production environment Make it easy to get the latest deliverables Everyone can see the results of the latest build Keep the build fast Automate deployment
Continuous Integration Maintain a code repository Automate the build Make the build self-testing Everyone commits to the baseline every day Every commit (to baseline) should be built Test in a clone of the production environment Make it easy to get the latest deliverables Everyone can see the results of the latest build Keep the build fast Automate deployment
Continuous Integration Maintain a code repository Automate the build Make the build self-testing Everyone commits to the baseline every day Every commit (to baseline) should be built Test in a clone of the production environment Make it easy to get the latest deliverables Everyone can see the results of the latest build Keep the build fast Automate deployment
Continuous Integration Maintain a code repository Automate the build Make the build self-testing Everyone commits to the baseline every day Every commit (to baseline) should be built Test in a clone of the production environment Make it easy to get the latest deliverables Everyone can see the results of the latest build Keep the build fast Automate deployment
Continuous Integration Maintain a code repository Automate the build Make the build self-testing Everyone commits to the baseline every day Every commit (to baseline) should be built Test in a clone of the production environment Make it easy to get the latest deliverables Everyone can see the results of the latest build Keep the build fast Automate deployment
Continuous Integration
Continuous Integration
Continuous Integration
Continuous Integration
Continuous Integration
Continuous Integration
Continuous Integration
Continuous Integration
Docker
Docker
Docker
Docker PRODUCTION READY??
Docker
Docker
Docker
Dockerize Continuous Integration
Dockerize Continuous Integration
Dockerize Continuous Integration
Dockerize Continuous Integration
Dockerize Continuous Integration
Dockerize Continuous Integration
Dockerize Continuous Integration
Dockerize Continuous Integration
Dockerize Continuous Integration
empacotamento de aplicações Docker + Jenkins = Amor build.sh $FPM_OPTS FPM https://github.com/jordansissel/fpm
empacotamento de aplicações Docker + Jenkins = Amor Especialmente útil para linguagens que sem facilidades para empacotar Desacoplamento entre a aplicação e o ambiente Script de empacotamento no controle de versão Container precisa de acesso ao workspace Nem sempre é a melhor solução Cuidado com a arquitetura em que ocorre o empacotamento Sem conflito entre dependências
Docker + Jenkins = Amor teste e análise uniformes
Docker + Jenkins = Amor teste e análise uniformes Ideal para ambientes de CI com mutas necessidades diferentes Liberdade na escolha da sua pilha de testes Ambiente de integração contínua organizado Fácil reprodução e manutenção do ambiente de testes Container precisa de acesso ao workspace CI Server precisa ter permissão pra manipular artefatos É uma caixa preta se os devs não conhecerem Docker Manutenção do Docker host Código de execução dos testes no controle de versão
Jenkins slaves com containers Docker + Jenkins = Amor
Jenkins slaves com containers Docker + Jenkins = Amor Funciona bem para casos onde não há ambiente sob demanda Mais rápido do que usar VMs Escala facilmente com muito jobs Permite usar containers como artefatos de build Documentação escassa Cada job necessita de uma imagem cadastrada Volumes para os caches de dependências Container precisa de acesso ao workspace CI Server/Container precisa ter permissão pra manipular artefatos
Docker + Jenkins = Amor testes de integração
Docker + Jenkins = Amor integração contínua de cookbooks driver_plugin: docker driver_config: socket: tcp://docke.host:5000 dockerfile: test/dockerfile http://kitchen.ci/
fabricio.leotti@gmail.com @lonefreak