Slide 1

Slide 1 text

Bamboo & Docker Consistent Build Environments Steve Teo

Slide 2

Slide 2 text

BACKGROUND QUICK INTRO TO BAMBOO & DOCKER BAMBOO + DOCKER + DEMO Q & A Agenda

Slide 3

Slide 3 text

• 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

Slide 4

Slide 4 text

Quick Intro

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Bamboo in a CI/CD Toolchain (Example)

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Easy Setup & Usage Why Bamboo? Tight Integration with the Atlassian Stack Pipelines & Feature Branches as First-Class Citizens

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

https://blog.logentries.com/2015/07/an-all-inclusive-log-monitoring-container-for-docker/

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

Build Once Efficient Consistency Run Anywhere Dev + Ops Why Docker?

Slide 20

Slide 20 text

Bamboo + Docker + Demo

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

My Setup: Docker for Mac Adapted from https://www.codeproject.com/Articles/1104540/Testing-the-Docker-for-Mac-Beta

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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 /bin/bash • docker ps

Slide 25

Slide 25 text

Bamboo Remote Agent on Host Mac • Run the following • java -jar atlassian-bamboo-agent-installer-5.15.0.1.jar http://localhost:8085/agentServer/

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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/

Slide 28

Slide 28 text

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/

Slide 29

Slide 29 text

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-

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

Q & A

Slide 32

Slide 32 text

Thank you