continuous deployment

19
Continuous Deployment Ron Heft CTO, The Social Station

Upload: ron-heft

Post on 15-Jul-2015

148 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Continuous Deployment

Continuous Deployment

Ron HeftCTO, The Social Station

Page 2: Continuous Deployment

About Me

• Certified Force.com Developer and Salesforce Administrator.

• 10+ years experience in full stack web development.

• Focus on Java, PHP, Apex, and Javascript.

• ronaldheft.com / @ronaldheft

Page 3: Continuous Deployment

About The Social Station

• Social media marketing startup based out of Allentown, PA.

• We’ve built a service to manage social media for small businesses.

• Platform consists of multiple integrations with social media partners, an internal management application, and client-facing web applications / mobile apps.

• Technology is key to our operation.

Page 4: Continuous Deployment

What is Continuous Deployment?

1. Version Control Best Practices

2. Continuous Integration

3. Feature Acceptance Criteria

4. Continuous Delivery

5. Zero Downtime Deployment

6. Continous Deployment

Page 5: Continuous Deployment

Using a Continuous Deployment Strategy

• More adaptive to business needs.

• Faster than agile..

• Embraces automation; less developer time spent on deployments.

• Best for hosted internal / external applications.

• Not compatible with self-install applications.

• Implementing some layers of CD is better than no layers.

Page 6: Continuous Deployment

Version Control Best Practices

• Use it.

• Git or Mercurial.

• Adapt a workflow like GitHub Flow.

Page 7: Continuous Deployment

Continuous Integration

• Test as much as possible.

• Database, security, unit, integrations, and more.

• Offload the unit testing to a CI server.

• Each branch should be independently tested.

• For GitHub / Heroku flow, I recommend Travis CI.

• Simple setup.

Page 8: Continuous Deployment

Feature Acceptance Criteria

• The process for taking a feature branch and merging it into a release-ready branch.

• Combination of CI tests, pull request, and discussion (code review).

• Watch for changes that have not been automated or require downtime!

Page 9: Continuous Deployment

Continuous Delivery

• At this point, a branch of code is ready for production.

• Delivery vs. Deployment

• The difference: Is the button push automated?

• This may be the stopping point for most workflows.

Page 10: Continuous Deployment

Zero Downtime Deployment

• For PaaS solutions like Salesforce and Heroku, the details are purely for background knowledge.

• This is up to Salesforce to implement and handle.

• Details on enabling zero downtime deployments in Heroku to follow.

Page 11: Continuous Deployment

Green - Blue Deployment

Load Balancer

User

Green Blue

Page 12: Continuous Deployment

Green - Blue Deployment

1. Load Balancer

• Green Environment (Existing)

• Blue Environment (New)

• Existing or On-demand

Load Balancer

User

Green Blue

Page 13: Continuous Deployment

Green - Blue Deployment

1. Load Balancer

• Green Environment (Existing)

• Blue Environment (New)

• Existing or On-demand

2. Deployment to Blue

• Automated Tests (Abort #1) Load Balancer

User

Green Blue

Page 14: Continuous Deployment

Green - Blue Deployment

1. Load Balancer

• Green Environment (Existing)

• Blue Environment (New)

• Existing or On-demand

2. Deployment to Blue

• Automated Tests (Abort #1)

3. Some Traffic to Blue

• Monitor Error Rate (Abort #2)

Load Balancer

User

Green Blue

Page 15: Continuous Deployment

Green - Blue Deployment

1. Load Balancer

• Green Environment (Existing)

• Blue Environment (New)

• Existing or On-demand

2. Deployment to Blue

• Automated Tests (Abort #1)

3. Some Traffic to Blue

• Monitor Error Rate (Abort #2)

4. All Traffic to Blue

• Spin Down Green (Abort #3)

• Blue is now green.

Load Balancer

User

Green Blue

Page 16: Continuous Deployment

Blue - Green Deployment Considerations

• Sessions (Not an issue with Heroku)

• Simultaneous Environments

• Database Changes

• No destructive changes without downtime.

• Message Queues

• Version messages.

• Front-end Applications

• No destructive changes / alert users to refresh app.

Page 17: Continuous Deployment

Zero Downtime Deployments in Heroku

• Pre-boot: Generally available since October 2014.

• heroku features:enable preboot

• Requires at least two web dynos.

• Does not apply to worker dynos.

• Deploys over ~5 minutes.

Page 18: Continuous Deployment

Continuous Deployment in Salesforce

• Implementing is difficult, if not impossible.

• Some enhancements coming to the process to make deployments faster.

• “Quick Deployment” is in pilot now (Winter ’15).

• Run production unit tests prior to deployment, then deploy up to 72 hours later.

Page 19: Continuous Deployment

Demo and Question Time