STEVE SMITH • DEVOPS ADVOCATE • ATLASSIAN • @TARKASTEVE
Docker, Bamboo and the Pipeline
https://bitbucket.org/ssmith/dockercon2015-docker-bamboo
Good WP
Testing with Docker
The example project
?
https://bitbucket.org/ssmith/atlascamp2015-docker-ci
The example project
Transfer
Trigger / Async
Data
Data
(See http://bit.do/postgres-es for details)
Docker testing
Reuse images Startup speed Idempotent tests
Dev / Test match Deploy to Docker
Docker And Bamboo
Plan
Stage
Job
Tasks
QA
Staging
Prod
Artifacts
Deployment
Environments
Git Repo
All New! Bamboo Docker Task!
AWS cloud agents with Docker
With Docker
Or create
your own
Require Docker support
Bamboo will start
on-demand
Building
Running
Linking
Compose with BambooSouth Florida
Classical Review
No Compose? No problem…
Running Compose
Cleaning up
Extracting ResultsAtlantic Sentinel
Fetching in Bamboo
Fetching container files
[ssmith] docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------
devweek15code_elasticsearch_1 /bin/sh -c /opt/elasticsea ... Exit -1
devweek15code_postgres_1 /docker-entrypoint.sh postgres Exit 0
devweek15code_transfer_1 /bin/sh -c waitport elasti ... Exit 0
[ssmith] docker-compose ps -q transfer
fd7e728e3e9a361d96c253f5aeadab1a3506538d1b0e19d27c82848d9bf48bf8
[ssmith] ID=`docker-compose ps -q transfer`
[ssmith] docker cp $ID:/code/testreports.xml .
[ssmith] file testreports.xml
testreports.xml: XML document text
Using Test Parsers
Parsing JUnit results
Using JUnit results
Deployment Environments
Plan
Stage
Job
Tasks
QA
Staging
Prod
Artifacts
Deployment
Environments
Git Repo
Deployment Environments
QA
Staging
Prod
Artifacts
Deployment
Environments
Sharing Artifacts
Configuring the Environment
Configuring the Environment
Configuring the Environment
Custom Bamboo VMs
Hodinkee
Packer File
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}"
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"source_ami": "ami-1c247d74",
"instance_type": "m1.medium",
"ssh_username": "ubuntu",
"ami_name": "bamboo-ami {{timestamp}}"
}],
"provisioners": [{
"type": "shell",
"execute_command": "echo 'vagrant'|{{.Vars}} sudo -S -E
bash '{{.Path}}'",
"scripts": ["scripts/ansible.sh"]
},
{
"type": "ansible-local",
"playbook_dir": ".",
"playbook_file": "bamboo-docker-update.yml"
}
]
}
---
- name: Add Docker repo key
apt_key: keyserver=keyserver.ubuntu.com id=36A1D7869245C8950F966E9
- name: Add Docker repo
apt_repository: repo='deb https://get.docker.com/ubuntu docker main’
- name: Install Docker
apt: pkg=lxc-docker
- name: Add users to docker group
user: name={{item}} groups=docker append=yes
with_items: docker_users
- name: Install Compose
get_url: url="https://github.com/docker/compose/releases/download/
{{compose_version}}/docker-compose-{{ansible_system}}-
{{ansible_machine}}" dest=/usr/local/bin/docker-compose
- name: Set Compose permissions
file: path=/usr/local/bin/docker-compose mode=a+x
Ansible Role
STEVE SMITH • DEVOPS ADVOCATE • ATLASSIAN • @TARKASTEVE
Thank you!

Dockercon2015 bamboo