continuous deploy

17
Continuous Deploy Using the cloud with Play! 2, Bitbucket, Cloudbees and Heroku for FREE*

Upload: magnus-andersson

Post on 13-Jan-2015

1.999 views

Category:

Technology


3 download

DESCRIPTION

Presentation for Göteborgs Scalaentusiaster Meetup group.http://www.meetup.com/Scala-Geats/events/58194182/

TRANSCRIPT

Page 1: Continuous Deploy

Continuous Deploy

Using the cloud with Play! 2, Bitbucket, Cloudbees and Heroku for FREE*

Page 2: Continuous Deploy

Magnus AnderssonCo-founder Solvies ABBlog: magnusart.comTwitter: @magnusart

Introduction

Page 3: Continuous Deploy

Overview

● What is Continuous Deploy?● This is what we are doing today● Meet the tools

○ Play! 2 Framework○ Atlassian Bitbucket○ CloudBees○ Heroku

● DEMO!● Is all this really for FREE*?● Appendix A - Continuous Deploy recipe● Appendix B - Links and resources

Page 4: Continuous Deploy

To continuously deploy software into target environment upon push/check in to blessed VCS Continious Integration, Continuous Delivery and DevOps are are subset or supersets of the same idéas, tools and methodologies

What is Continuous Deploy?

Page 5: Continuous Deploy

This is what we are doing today

Page 6: Continuous Deploy

Ruby on Rails inspired web framework. Builds with Scala Build Tool. Both Scala and Java, foundation rewritten in Play2.

Meet the tools

Page 7: Continuous Deploy

Git hosting that allows for free private repositories. Free private git and mercurial repos. The competitor, Github, can be used as well but only public repos are free

Meet the tools

Page 8: Continuous Deploy

Online Jenkins Continuous Integration server hosting. Travis CI is an interesting alternative, but would not work well for this scenario as there is no private way to store private SSL keys.

Meet the tools

Page 9: Continuous Deploy

Polyglot cloud PAAS hosting. Supports Ruby, Java, Scala, Cloujure and Python in the Celadon Cedar stack Solves package archiving (Git), deploy automation, rollback and provides a third party add-on community (DB, Logging, Messaging) Heroku runs in the Amazon cloud. Slug size for your app is 100mb, inc. resources/artifacts

Meet the tools

Page 10: Continuous Deploy

DEMO!

Page 11: Continuous Deploy

Yes it is, but only for a give value for FREE...You may want to pay for the following1. Play! 2 Framework support

a. Typesafe supscription. Price: [email protected]. Atlassian Bitbucket

a. 5 collaborators freeb. Paid plans ranging from $10 - $80/month

3. CloudBeesa. 300 minutes of build time, 10 developers free/monthb. Plans ranging from $15 - $100/monthc. Paid plans are fixed base price + pay as you go

Is all this really for FREE*?

Page 12: Continuous Deploy

4. Heroku Dynosa. 750 dyno hours/month freeb. Dynos cost $0.05/hour (~35$/month per dyno)c. Dynos are charged per secondd. If you spin up a Dyno Heroku will charge for it until

you manually spin it down again.e. If you have less than two web Dynos, Heroku will

spin down your Dyno after a period of inactivity. Starts up upon first subsequent request (5-10 sec).

f. HireFireApp is a 3rd party Ruby application that can scale your Dynos based on response time and job queue. It will poll your app with HTTP requests, so Dyno spin down should not be an issue. Costs amounts to HireFireApp $10/month + Heroku $0.05/h. Only supports Ruby stack natively, but uses a simple JSON api your app can implement.

Page 13: Continuous Deploy

4. Heroku Third Party addonsa. Convenient way to install third party addonsb. Heroku PgSQL database 5MB is included

i. $200/month for 1TB and 1.7GB Cachec. MongoLab 250MB free DB

i. $10/month for 0.5GB and upwardsd. IronMQ 250 000 request/month free

i. $9.99/month for 10 000 000 requests/monthii. Both RabbitMQ and CloudAMQP are in private

betase. For file storage Heroku recommends Amazon S3f. In general the add-ons can be pricy, but there is no

lockin, you can get started in Heroku and move to those things that turns out to be too expensive

More addons: https://addons.heroku.com/

Page 14: Continuous Deploy

1. Create Heroku Appa. Configure custom buildpack to keep Slug size downb. Is it deployed?

2. Create Git reposa. Create remote repob. Clone repoc. Add Heroku remoted. Create Play Application in subfoldere. Move files to parent dirf. Add Procfile config for Play!g. Add gitignoreh. git push heroku master

Appendix A Continuous Deploy recipe

Page 15: Continuous Deploy

4. Create CloudBees joba. Create jobb. Configure CloudBees access to Git repos (Heroku

and Atlassian/Github)c. Install Jenkins SBT plugin to CloudBeesd. Add Git Plugine. Configure job Git remotesf. Add taggingg. Fire up build!

5. Commit, push to trigger a build followed by deploy into Heroku

Page 16: Continuous Deploy

HireFireApp support ticket describing API:https://hirefireapp.tenderapp.com/discussions/questions/66-support-for-auto-scaling-web-dyno-for-java-play-app-running-on-cedar-stack

Heroku Scala Build Packhttps://github.com/heroku/heroku-buildpack-scala

OpenShift, Heroku competitorhttps://openshift.redhat.com

OpenShift DIY Cartridge Play2 Quickstarthttps://github.com/opensas/play2-openshift-quickstart

This presentation is available on SlideSharehttp://www.slideshare.net/magnusart/continuous-deploy

Appendix BLinks and resources

Page 17: Continuous Deploy

Magnus AnderssonCo-founder Solvies [email protected]: @magnusartwww.solvies.sewww.magnusart.com

Contact information