Mais conteúdo relacionado Semelhante a Continuous Delivery with Grails and CloudBees (20) Continuous Delivery with Grails and CloudBees1. Continuous Delivery in the Cloud with
®
Grails and CloudBees
09/12/11
©2011 Cloud Bees, Inc. All Rights Reserved
2. About Marco
Enterprise Java developer.
Now working primarily with Groovy & Grails.
Advocate of using G&G on Linux!
Previously: Shazam, Associated Newspapers
Currently: Burberry
Maintainer:
Groovy, Grails and Griffon PPA for Ubuntu
Grails plugins: cloud-bees, itunes-service, jmock
@marcoVermeulen
©2011 CloudBees, Inc. All Rights Reserved
3. About Nicolas
Senior Engineer Cloudbees
● customer support
● conferences & evangelism
● DEV@Cloud contributor
Jenkins contributor
Maven committer
JUG-Leader
©2011 CloudBees, Inc. All Rights Reserved
4. Overview
● 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
©2011 CloudBees, Inc. All Rights Reserved
6. All Things Continuous...
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 Fowler
http://martinfowler.com/articles/continuousIntegration.html
©2011 CloudBees, Inc. All Rights Reserved
7. All Things Continuous...
Continuous Deployment:
"...is actually deploying every change into production,
every day or more frequently."
-Martin Fowler
http://martinfowler.com/delivery.html
©2011 CloudBees, Inc. All Rights Reserved
8. All Things Continuous...
Continuous Delivery:
"...is about keeping your application in a state
where it is always able to deploy into production."
-Martin Fowler
http://martinfowler.com/delivery.html
©2011 CloudBees, Inc. All Rights Reserved
10. The Deployment Pipeline
DEV
Integ.
build, test,
analyse,...
Staging
PROD
©2011 CloudBees, Inc. All Rights Reserved
12. The Quest
● 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
©2011 CloudBees, Inc. All Rights Reserved
13. The Matrix
Side-by-side comparison of Cloud Vendors
Vendor PaaS/IaaS Deployment Availability Tooling Hosted CI Database
EC2 Iaas Deploy any Fully Available Eclipse None, may be Amazon RDS:
WAR provisioned MySQL,Oracle
Elastic PaaS Fully Available None
Beanstalk
CloudBees PaaS Deploy and Fully Available Eclipse Plugin Jenkins & MySQL,
WAR Nectar 3rd party DS
CloudFoundry PaaS Any Spring or Still in Beta Spring Source None MySQL,
Grails app. Tool Suite Mongo, Redis
+CLI
Google App PaaS Java + Servlet Fully Available Eclipse + CLI None BigTable,
Engine environment MySQL with
JPA or JDO
Gaelyk PaaS Java + Servlet Fully Available Eclipse + CLI None BigTable,
env + Groovy! MySQL with
JPA or JDO
Heroku PaaS Not JEE Fully Available CLI None Postgres,
compliant! No 3rd party SaS
WARs!
©2011 CloudBees, Inc. All Rights Reserved
14. About CloudBees
Our Mission Become the leading Java™ Platform
as a Service (PaaS)
● CloudBees services the complete
lifecycle of Cloud application
development and deployment.
Strategy ● Focus on Applications
● Transparent management of
servers, VMs and IT.
DEV@cloud: Cloud Services for
Developers
Why we're different RUN@cloud: Frictionless runtime
PaaS for Java apps
15. CloudBees PaaS
Continuous Development - Continuous Deployment
Code Build Test Stage Deploy Manage
DEV@cloud
Repositories Jenkins MySQL Java EE 6 WP
Core
Services
Scalability Availability Reliability
Monitoring Alerting Billing
Deployment Manager
©2011 CloudBees, Inc. All Rights Reserved
17. Grails cloud-bees Plugin
● 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!
©2011 CloudBees, Inc. All Rights Reserved
18. Grails cloud-bees Plugin
Applications can be Deployed and Deleted:
grails bees-app-deploy
grails bees-app-delete
Applications can be Interrogated:
grails bees-app-info
grails bees-app-list
Applications can be Controlled:
grails bees-app-start
grails bees-app-stop
grails bees-app-restart
©2011 CloudBees, Inc. All Rights Reserved
19. Grails cloud-bees Plugin
Application logs tailed in real time!
grails bees-app-tail
Dec 5, 2011 3:30:42 PM com.staxnet.appserver.utils.AppServerConfiguration readAppServerConfig
INFO: loading app config: /var/staxapps/8995/appserver.xml
Dec 5, 2011 3:30:42 PM com.staxnet.appserver.TomcatServerBase initConfiguration
INFO: Creating Tomcat server configuration at /var/staxapps/8995/staxcat/work
Dec 5, 2011 3:30:42 PM net.stax.appserver.admin.AdminEngine createAdminHttpConnector
INFO: Initializing admin-http-connector protocol: org.apache.coyote.http11.Http11Protocol
Dec 5, 2011 3:30:43 PM net.stax.appserver.webapp.WebAppEngine createWebContexts
INFO: loading app [] from /var/staxapps/8995/staxcat/install/webapp.war
Dec 5, 2011 3:30:43 PM net.stax.appserver.webapp.WebAppEngine
...
©2011 CloudBees, Inc. All Rights Reserved
20. Grails cloud-bees Plugin
Databases can be Provisioned and Deleted:
grails bees-db-create
grails bees-db-delete
Databases can be Interrogated:
grails bees-db-info
grails bees-db-list
©2011 CloudBees, Inc. All Rights Reserved
22. Deploying the Beeline
Setup
● Open your CloudBees account.
● Add config to: $HOME/.grails/settings.groovy
cloudbees.account = 'ACCOUNT'
cloudbees.api.key = 'KEY'
cloudbees.api.secret = 'SECRET'
The Project
Clone the project from GitHub:
git clone git@github.com:marcoVermeulen/beeline.git
©2011 CloudBees, Inc. All Rights Reserved
23. Deploying the Beeline
The Plugin
grails install-plugin cloud-bees
Resolving plugin cloud-bees. Please wait...
...
Plugin cloud-bees-0.5 installed
Plugin provides the following new scripts:
------------------------------------------
grails bees-app-stop
grails bees-app-list
grails bees-app-restart
grails bees-app-delete
grails bees-db-info
grails bees-app-start
grails bees-test-app
grails bees-app-checksums
grails bees-db-create
grails bees-app-tail
grails bees-db-delete
grails bees-app-deploy
grails bees-app-info
grails bees-db-list
©2011 CloudBees, Inc. All Rights Reserved
24. Deploying the Beeline
Create a Database in the Cloud!
grails bees-db-create
Database created successfully.
Database ID : beelinez
grails bees-db-info
Database 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 paste
into your DataSource.groovy file!!!
©2011 CloudBees, Inc. All Rights Reserved
25. Deploying the Beeline
To the Cloud we go!
grails bees-app-deploy
Preparing the BeesClient ...
Deploying hashcode/beeline tagged at version 0.1
........................uploaded 25%
........................uploaded 50%
........................uploaded 75%
........................upload completed
deploying application to server(s)...
Application uploaded successfully to: http://beeline.hashcode.cloudbees.net
That's all there is to it!
©2011 CloudBees, Inc. All Rights Reserved