Top Banner
Continuous Delivery in the Cloud with Grails and CloudBees ® 09/12/11 ©2011 Cloud Bees, Inc. All Rights Reserved
26

Continuous Delivery with Grails and CloudBees

May 13, 2015

Download

Technology

Marco Vermeulen

A presentation given at the 2011 Grails Exchange on Continuous Delivery in the Cloud with Grails using CloudBees PaaS.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Continuous Delivery with Grails and CloudBees

Continuous Delivery in the Cloud with Grails and CloudBees®

09/12/11

©2011 Cloud Bees, Inc. All Rights Reserved

Page 2: Continuous Delivery with Grails and CloudBees

About Marco

©2011 CloudBees, Inc. All Rights Reserved

Enterprise Java developer.Now working primarily with Groovy & Grails.Advocate of using G&G on Linux!

Previously: Shazam, Associated NewspapersCurrently: Burberry

Maintainer:Groovy, Grails and Griffon PPA for Ubuntu Grails plugins: cloud-bees, itunes-service, jmock

@marcoVermeulen

Page 3: Continuous Delivery with Grails and CloudBees

About Nicolas

©2011 CloudBees, Inc. All Rights Reserved

Senior Engineer Cloudbees● customer support● conferences & evangelism● DEV@Cloud contributor

Jenkins contributorMaven committerJUG-Leader

Page 4: Continuous Delivery with Grails and CloudBees

Overview

©2011 CloudBees, Inc. All Rights Reserved

● All things Continuous: some terminology● The Deployment Pipeline● Our Quest in taking it to the Cloud● The Matrix● About CloudBees● The Grails cloud-bees plugin● Demo 1: grails cloud-bees● Demo 2: Continuous Deployment● The Web Console

Page 5: Continuous Delivery with Grails and CloudBees

All Things Continuous...

©2011 CloudBees, Inc. All Rights Reserved

Continuous Integration (CI):

What is it?

Page 6: Continuous Delivery with Grails and CloudBees

All Things Continuous...

©2011 CloudBees, Inc. All Rights Reserved

Continuous Integration (CI):

Coined by Kent Beck as part of eXtreme Programming.

● integrate work frequently into mainline● multiple integrations per day● integration verified by automated tests● results in subsequent build● detect integration errors early!● results in cohesive software more rapidly

-Martin Fowlerhttp://martinfowler.com/articles/continuousIntegration.html

Page 7: Continuous Delivery with Grails and CloudBees

All Things Continuous...

©2011 CloudBees, Inc. All Rights Reserved

Continuous Deployment:

"...is actually deploying every change into production, every day or more frequently."

-Martin Fowler

http://martinfowler.com/delivery.html

Page 8: Continuous Delivery with Grails and CloudBees

All Things Continuous...

©2011 CloudBees, Inc. All Rights Reserved

Continuous Delivery:

"...is about keeping your application in a statewhere it is always able to deploy into production."

-Martin Fowler

http://martinfowler.com/delivery.html

Page 9: Continuous Delivery with Grails and CloudBees

The Deployment Pipeline

©2011 CloudBees, Inc. All Rights Reserved

Page 10: Continuous Delivery with Grails and CloudBees

The Deployment Pipeline

©2011 CloudBees, Inc. All Rights Reserved

DEV

Integ.

Staging

PROD

build, test, analyse,...

Page 11: Continuous Delivery with Grails and CloudBees

● smaller jobs● parallelism● build promotion

Implementing efficient build pipeline

Page 12: Continuous Delivery with Grails and CloudBees

The Quest

©2011 CloudBees, Inc. All Rights Reserved

● PaaS not IaaS● Groovy & Grails support● Robust Developer Tooling● Hosted Continuous Integration (CI) solution● Support for Continuous Deployment● Cloud based● Holistic Solution● Runtime monitoring and tooling

Page 13: Continuous Delivery with Grails and CloudBees

The Matrix

©2011 CloudBees, Inc. All Rights Reserved

Vendor PaaS/IaaS Deployment Availability Tooling Hosted CI Database

EC2 Iaas Deploy any WAR

Fully Available Eclipse None, may be provisioned

Amazon RDS: MySQL,Oracle

Elastic Beanstalk

PaaS Fully Available None

CloudBees PaaS Deploy and WAR

Fully Available Eclipse Plugin Jenkins & Nectar

MySQL,3rd party DS

CloudFoundry PaaS Any Spring or Grails app.

Still in Beta Spring Source Tool Suite +CLI

None MySQL, Mongo, Redis

Google App Engine

PaaS Java + Servlet environment

Fully Available Eclipse + CLI None BigTable, MySQL with JPA or JDO

Gaelyk PaaS Java + Servlet env + Groovy!

Fully Available Eclipse + CLI None BigTable, MySQL with JPA or JDO

Heroku PaaS Not JEE compliant! No WARs!

Fully Available CLI None Postgres,3rd party SaS

Side-by-side comparison of Cloud Vendors

Page 14: Continuous Delivery with Grails and CloudBees

About CloudBeesOur Mission Become the leading Java™ Platform

as a Service (PaaS)

Strategy

● CloudBees services the complete lifecycle of Cloud application development and deployment.

● Focus on Applications● Transparent management of

servers, VMs and IT.

Why we're differentDEV@cloud: Cloud Services for DevelopersRUN@cloud: Frictionless runtime PaaS for Java apps

Page 15: Continuous Delivery with Grails and CloudBees

CloudBees PaaS

©2011 CloudBees, Inc. All Rights Reserved

Continuous Development - Continuous Deployment

JenkinsRepositories

DEV@cloud

MySQL Java EE 6 WP

Code Build ManageStage DeployTest

Scalability Availability Reliability

Monitoring Alerting Billing

Core Services

Deployment Manager

Page 16: Continuous Delivery with Grails and CloudBees

CloudBees founding team

Page 17: Continuous Delivery with Grails and CloudBees

Grails cloud-bees Plugin

©2011 CloudBees, Inc. All Rights Reserved

● Provides CloudBees SDK with no installation● Handy CLI scripts from within Grails project● Allow for interaction with Apps and DBs● All provided scripts can be called from within

a Jenkins build!

Page 18: Continuous Delivery with Grails and CloudBees

Grails cloud-bees Plugin

©2011 CloudBees, Inc. All Rights Reserved

Applications can be Deployed and Deleted:

grails bees-app-deploygrails bees-app-delete

Applications can be Interrogated:

grails bees-app-infograils bees-app-list

Applications can be Controlled:

grails bees-app-startgrails bees-app-stopgrails bees-app-restart

Page 19: Continuous Delivery with Grails and CloudBees

Grails cloud-bees Plugin

©2011 CloudBees, Inc. All Rights Reserved

Application logs tailed in real time!

grails bees-app-tail

Dec 5, 2011 3:30:42 PM com.staxnet.appserver.utils.AppServerConfiguration readAppServerConfigINFO: loading app config: /var/staxapps/8995/appserver.xmlDec 5, 2011 3:30:42 PM com.staxnet.appserver.TomcatServerBase initConfigurationINFO: Creating Tomcat server configuration at /var/staxapps/8995/staxcat/workDec 5, 2011 3:30:42 PM net.stax.appserver.admin.AdminEngine createAdminHttpConnectorINFO: Initializing admin-http-connector protocol: org.apache.coyote.http11.Http11ProtocolDec 5, 2011 3:30:43 PM net.stax.appserver.webapp.WebAppEngine createWebContextsINFO: loading app [] from /var/staxapps/8995/staxcat/install/webapp.warDec 5, 2011 3:30:43 PM net.stax.appserver.webapp.WebAppEngine...

Page 20: Continuous Delivery with Grails and CloudBees

Grails cloud-bees Plugin

©2011 CloudBees, Inc. All Rights Reserved

Databases can be Provisioned and Deleted:

grails bees-db-creategrails bees-db-delete

Databases can be Interrogated:

grails bees-db-infograils bees-db-list

Page 21: Continuous Delivery with Grails and CloudBees

Grails cloud-bees Plugin

©2011 CloudBees, Inc. All Rights Reserved

Demo!

Page 22: Continuous Delivery with Grails and CloudBees

Deploying the Beeline

©2011 CloudBees, Inc. All Rights Reserved

Setup● Open your CloudBees account.● Add config to: $HOME/.grails/settings.groovy

cloudbees.account = 'ACCOUNT'cloudbees.api.key = 'KEY'cloudbees.api.secret = 'SECRET'

The ProjectClone the project from GitHub:

git clone [email protected]:marcoVermeulen/beeline.git

Page 23: Continuous Delivery with Grails and CloudBees

Deploying the Beeline

©2011 CloudBees, Inc. All Rights Reserved

The Plugingrails install-plugin cloud-beesResolving plugin cloud-bees. Please wait......Plugin cloud-bees-0.5 installedPlugin provides the following new scripts:------------------------------------------grails bees-app-stopgrails bees-app-listgrails bees-app-restartgrails bees-app-deletegrails bees-db-infograils bees-app-startgrails bees-test-appgrails bees-app-checksumsgrails bees-db-creategrails bees-app-tailgrails bees-db-deletegrails bees-app-deploygrails bees-app-infograils bees-db-list

Page 24: Continuous Delivery with Grails and CloudBees

Deploying the Beeline

©2011 CloudBees, Inc. All Rights Reserved

Create a Database in the Cloud!

grails bees-db-createDatabase created successfully.Database ID : beelinez

grails bees-db-infoDatabase Name : beelinez created : Wed Dec 07 23:10:57 GMT 2011 owner : hashcode username : beelinez password : changeme! master : ec2-174-129-9-255.compute-1.amazonaws.com port : 3306 slaves : [] status : active

Also gives a handy datasource definition to copy and pasteinto your DataSource.groovy file!!!

Page 25: Continuous Delivery with Grails and CloudBees

Deploying the Beeline

©2011 CloudBees, Inc. All Rights Reserved

To the Cloud we go!

grails bees-app-deployPreparing the BeesClient ...Deploying hashcode/beeline tagged at version 0.1........................uploaded 25%........................uploaded 50%........................uploaded 75%........................upload completeddeploying application to server(s)...Application uploaded successfully to: http://beeline.hashcode.cloudbees.net

That's all there is to it!

Page 26: Continuous Delivery with Grails and CloudBees

Grails cloud-bees Plugin

©2011 CloudBees, Inc. All Rights Reserved

Q & A