Upload
yonni-mendes
View
1.529
Download
2
Tags:
Embed Size (px)
DESCRIPTION
Demystifying the Zend Server Deployment Package creation process, webinar: http://www.zend.com/en/webinar/Server/70170000000cLi5-ZendServerPackages.flv
Citation preview
Zend Server Deployment
Good things come in packagesPresented by Yonni Guido [email protected] @zendsui
linkedin.com/in/yonman
What is Zend Server?
Deployment: what could possibly go wrong?
• Preparation: untested scripts, shoddy docs
Devs gotta dev!Symbolic deployment
from dailywtf
Deployment: what could possibly go wrong?
• Technical failure
• Human error:wrong server, wrong package,...
• Human reaction
Deployment: what could possibly go wrong?
• Psychological projectiono Dev: If it works in dev, surely it works on
productiono Ops: If it fails on production, surely it fails in
dev
Result: Downtime. Money lost. Lose process.
Deployment in Zend Server
• Mechanise
• Automate
• Control
• Fallback
Zpk to deploy
deployzpk
Rollback
Health check?
This is all great…
What is a ZPK?
“A wondrous package of code, fun and migration bundled together to make your wish of a long night of sleep come true.”
-- unknown
Popular workflows: Zend Studio
Requires: Zend Studio, Zend Server, Mouse
• Create a project
• Package the project
• Deploy the projectDemo!
Zend Studio end-to-end integration demo, questions?
Popular workflows: Zend Studio
Popular workflows: Zend Server Wiz
Requires: Zend Server, Zpk file
• Produce Zpk file
• Deploy Zpk file
• Rejoice!Demo!
Zend Server Wizard Deployment, questions?
Popular workflows: Zend Server
• Same ZPK, simpler
• Automated updates
• No outwards facing files
• Onboard libraries
A word about Libraries
ZPK: Not what you thought
• Zip
• data directory
• scripts directory
• deployment.xml
Demo: ZPK from the inside
Advanced stuffPrerequisites, User params, Hook scripts,
Persistent resources
Advanced stuff: Prerequisites
Adding a new prerequisiteFailing prerequisitesLibrary prerequisites
Demo: playing around with prerequisites
Using prerequisites in our package, questions?
Prerequisites
Advanced stuff: Staging & Activation
Deployment order of business
• Unpacking
• Staging
• ActivationHook/trigger scripts: Execution, Handling errors
Demo (and another one in a sec)!
Advanced Stuff: User Parameters
Specifying user parametersCollecting user parameters’ values
• Zend Studio
• Zend Deployment Wizard
• (Zend Server Web API)Demo: Using user params in hook scripts
Using User Params inside our hook scripts, questions?
Hook scripts and user params
Support hook scripts and user paramsOnly a “stage” step, no activation
User params and libraries
• Removes the applicationo Deactivateo Unstage
• Redeploy stages and activates
• Rollback only activates the previous application version
Hook scripts should be designed accordingly
A word about rollback and redeploy
• Eula fileo XML locationo Text
• Readme fileo Special Locationo Markdown
Zpk: Extra stuff
Package creation, a 3rd workflow
`zdpack create <skeleton-name>`You get:
• deployment.xml
• data dir
• scripts dir
• README file`zdpack pack <skeleton-name>`
But wait! there’s more!
Packaging Monitor rules, Pagecache rules
Application health checkLibraries auto update
Extra stuff: apps <healthcheck>
Provide a URLResponse: 200 OKorResponse: not 200* and a body with error message
Extra stuff: libraries <updateurl>
https://packages…/up.json
output:{
"version": "2.3.0",
"downloadUrl": "https://packag...zpk",
"releaseNotes": "http://fra../change/2.3.0/"
}