Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bamboo & Docker

7bcb468888a82bfeb38a2818207e53c6?s=47 Steve Teo
February 22, 2017

Bamboo & Docker

This is a talk regarding consistent build environments using Bamboo and Docker. It was presented during Singapore Atlassian User Group's February 2017 Meetup

7bcb468888a82bfeb38a2818207e53c6?s=128

Steve Teo

February 22, 2017
Tweet

More Decks by Steve Teo

Other Decks in Technology

Transcript

  1. Bamboo & Docker Consistent Build Environments Steve Teo

  2. BACKGROUND QUICK INTRO TO BAMBOO & DOCKER BAMBOO + DOCKER

    + DEMO Q & A Agenda
  3. • Me - Cloud DevOps Lead in SGX - Previous

    Build Tooling Experience: Jenkins / Teamcity - Baby steps into Bamboo & Docker • Current Environment - Jira / Confluence / Bitbucket / Bamboo - Mobile: Swift / Android - FE: SPA (HTML5/CSS/JS) - BE: Java / PHP - Infra: On-Prem & AWS • Goal - Provide consistent build & deployment environments Background
  4. Quick Intro

  5. None
  6. Bamboo in a CI/CD Toolchain (Example)

  7. None
  8. None
  9. None
  10. None
  11. Easy Setup & Usage Why Bamboo? Tight Integration with the

    Atlassian Stack Pipelines & Feature Branches as First-Class Citizens
  12. None
  13. https://blog.logentries.com/2015/07/an-all-inclusive-log-monitoring-container-for-docker/

  14. http://www.slideshare.net/Kiratech/container-security-seccomp-network-e-namespaces

  15. https://washraf.gitbooks.io/the-docker- ecosystem/content/Chapter%201/Section%203/union_file_system.html

  16. http://blog.octo.com/en/docker-registry-first-steps/

  17. Pets vs Cattle https://www.youtube.com/watch?v=F1-UEIG7u5g

  18. https://azure.microsoft.com/en-us/blog/new-windows-server-containers-and-azure-support-for-docker/

  19. Build Once Efficient Consistency Run Anywhere Dev + Ops Why

    Docker?
  20. Bamboo + Docker + Demo

  21. Goal: Consistent CI Environments • Problem • Traditional Challenges of

    Build Environment • Use Case • Building traditional artifacts eg. jar, golang, rpm, deb • Minimize your need for bamboo remote agents • Solves • Consistent Runtime Environment: “It runs on my computer” • Dependency Hell from OS to App
  22. My Setup: Docker for Mac Adapted from https://www.codeproject.com/Articles/1104540/Testing-the-Docker-for-Mac-Beta

  23. Docker Baby Steps • Docker Hub • https://hub.docker.com/explore/ • https://hub.docker.com/_/hello-world/

    • Run the following • docker pull hello-world • docker run hello-world • docker ps -a
  24. Bamboo Server on Docker • Source • https://github.com/cptactionhank/docker-atlassian-bamboo • https://hub.docker.com/r/cptactionhank/atlassian-bamboo

    • Run the following • docker run -d -p 8085:8085 -p 54663:54663 cptactionhank/atlassian- bamboo:latest • docker exec -i -t <container> /bin/bash • docker ps
  25. Bamboo Remote Agent on Host Mac • Run the following

    • java -jar atlassian-bamboo-agent-installer-5.15.0.1.jar http://localhost:8085/agentServer/
  26. Sample Java Project with Unit Test • Source Image •

    https://hub.docker.com/r/niaquinto/gradle/ • Project • https://github.com/stevepotayteo/saug-bamboo-docker-example • Not the best design of course • Every source code change results in a new docker image • Answer: Maybe use Docker Volume to mount source code from host
  27. Food for Thought & Future Investigations • Separating Code from

    Tests • Containers as a Deployment Unit • Integration Testing • Running Bamboo Agent in a Container • https://confluence.atlassian.com/bamboo/getting-started-with-docker-and- bamboo-687213473.html • Elastic Bamboo • Container Orchestration • Good Read: Docker Testing Strategies • http://blog.terranillius.com/post/docker_testing/
  28. Learning References • Up & Running • https://deninet.com/blog/1582/docker-scratch-part-1-installing-and-your- first-container •

    http://www.tricksofthetrades.net/2015/12/23/installing-running-docker/ • Docker & Bamboo • https://confluence.atlassian.com/bamboo/getting-started-with-docker-and- bamboo-687213473.html • Docker Testing Strategies • http://blog.terranillius.com/post/docker_testing/
  29. Learning References • Running Bamboo Agents • https://confluence.atlassian.com/bamboo/getting-started-with-docker-and- bamboo-687213473.html •

    https://blog.avisi.nl/2016/01/22/get-more-out-of-bamboo-with-docker-part-1/ • http://blog.brianmkelley.com/leveraging-bamboo-with-docker/ • Automating Docker Deployments to Amazon ECS • http://www.tothenew.com/blog/how-to-automate-docker-deployments-in-aws-ecs/ • https://github.com/awslabs/aws-cicd-docker-containers • CI with Docker & Docker-Compose • https://www.digitalocean.com/community/tutorials/how-to-configure-a- continuous-integration-testing-environment-with-docker-and-docker-compose-on-
  30. Learning References • CI with Docker & Docker-Compose • https://www.digitalocean.com/community/tutorials/how-to-configure-a-

    continuous-integration-testing-environment-with-docker-and-docker-compose-on- ubuntu-14-04 • Bamboo Feature Branches • https://www.atlassian.com/continuous-delivery/building-feature-branches-with- bamboo
  31. Q & A

  32. Thank you