ci/cd with rancher cli + jenkins
TRANSCRIPT
CI/CD with Rancher CLI + Jenkins
Rancher Meetup Tokyo #1 Go Chiba @go_chiba
About me Go Chiba
– WorkSystem Integrator
– RoleApache CloudStackPMC/Commiter
– ContactTwitter: @go_chiba
CI/CDDev Test Staging Production
Dev Team QA Team Release Manager
Rancher CLI CLI Tool to manage Rancher server and resources
– Environment/Hosts/Stacks/Services/Containers
https://github.com/rancher/cli
# rancher hostsID HOSTNAME STATE IP DETAIL1h4 rancher-host01 active X.X.X.X1h6 rancher-host02 active Y.Y.Y.Y
Jenkins
Preparation
Build Image A Build Image B Build Image C
Deploy to Rancher
Commit/PR Push/Merge
Staging Production
Jenkins
# git fetch
# docker build -t XXX:$GIT_BRANCH .
# rancher up -d
Commit/PR Push/Merge
Staging Production
Demo Design
Production Staging
Ubuntu Rancher OS
Rancher OS Ubuntu
http://vote.gochiba.net http://result.gochiba.net
Ubuntu
Demo
Scenario 1
I Don’t like“Cats” or “Dogs”
voting...
OK, Change it and can you send
me a PR?
Scenario 1
Issue ReportSend PR Assign Developer
Developer Owner
Scenario 2
Let’s check on Staging...
?
Scenario 2
StagingStack
up
fetch build/push
rancher pull
CheckOwner
Scenario 3Hi Cattle,
your code has merged to
master.Plz check our
site.
Thanks!I’ll be check your
production :)
Scenario 3
ProductionStack
up
Owner
fetch build/push
rancher pull
Check
merge
TODO Re-design Jenkins job units.
Validate YAML files on preparation.
Garbage Collect test images/stacks.
Thank you!