SlideShare a Scribd company logo
Evolution of deploy.sh
Leonid Mamchenkov
About
Leonid Mamchenkov
● System administrator, web developer
● 20+ years of experience
■ Primetel
■ FxPro
■ Easy Forex
■ Qobo
● Open Source fan and advocate
■ Linux (Fedora, CentOS, Red Hat)
■ PHP (bash, perl)
■ MySQL
■ Nginx
■ Git
■ Vim
Qobo Ltd
● Established in February 2013
● Offices in Nicosia, Limassol, London
● Web design, development, hosting
■ WordPress
■ WooCommerce
■ Amazon AWS
● Software development
■ CakePHP
■ Qobrix Platform
■ CRM Systems
■ Intranets
■ Portals
■ Integrations
What is deployment?
Application
● Code (HTML, CSS, JavaScript, PHP)
● Assets (images, fonts)
● Configuration (credentials, defaults, runtime)
● Database (schema, content)
Infrastructure
● Hardware
● Operating system
● Filesystem, networking
● Services
Deployment: installing, updating or removing the application to or from a particular infrastructure.
Software deployment is all of the activities that make a software system available for use.
https://en.wikipedia.org/wiki/Software_deployment
Why is deployment automation important?
Speed
● Faster deployment
● Frequency
● Feedback loop
Release early, release often!
https://en.wikipedia.org/wiki/Release_early,_release_often
Quality
● Fewer human error
● Consistency
● Predictability
Cost
● Machine vs. human
● Reuse
● Troubleshooting
Evolution of the Web (last 20 years)
Overall:
● More users
● More data
● More devices
● More features
● More expectations
Technologies:
Static HTML, Cookies, SSI, CGI, SSL, XML,
RPC, API, AJAX, RSS, Web 2.0, Mobile Web,
WebSockets, IoT, Big Data, cloud computing,
and more ...
As the web evolved, so did the deployment of the web applications.
Prehistoric days : before deploy.sh
Application
● Very small and basic.
● Often, just a few static HTML and image files.
● Sometimes, an occasional CGI script.
Infrastructure
● Shared hosting with limited access.
● Single server.
● No version control.
● No SSH access.
Deployment: manual upload via FTP or some sort of web-based control panel.
If you are still here, at least look at some FTP deployment / smart upload tools, like SmartFTP.
The birth of deploy.sh
#!/bin/bash
rsync -re ssh . leonid@example.com:~/public_html/
ssh leonid@example.com << EOF
cd ~/public_html/
chown -R leonid.nobody {logs,tmp,uploads}
mysql -u leonid example_com < db/mysql.sql
EOF
echo “All Done”
Basic automation
● Simple, step-by-step
● Mostly shell
● No specialized tools
● Basic remote access
● No error handling
● Very specific
● Not portable
● No concurrency control
● No trail
● No changesets
● No documentation
● Often insecure
Version control / The birth of build.sh
#!/bin/bash
ssh leonid@example.com << EOF
cd ~/public_html/
git pull origin master
./bin/build.sh
EOF
echo “All Done”
Improvements
● More reliable file synchronization
● Much faster on larger projects
● Basic permissions management
● Changesets
● Git/Subversion hooks
● Basic concurrency control
● More portability
● Often better security
● Submodules, exports, etc.
Separation of concerns between deployment
and build processes. Deployment seems
simple and easy. Build process - not so
much.
The explosion of build tools
<?php
class DbCreate extends AbstractCommand {
public function mysqlDbCreate($host, $port, $name, $user, $pass) {
$this->taskMysqlDbCreate()
->host($host)->port($port)
->user($user)->pass($pass)
->db($name)->run();
}
}
Improvements
● Specialized syntax
● Dependency management
● Improved error handling
● Improved output / verbosity
● Improved portability
● Reusable tasks and modules
● Documentation
Tools
GNU make, CMake, Apache Ant,
Phing, Rake, Phake, Capistrano,
Robo, Deployer, many others.
More specialized tools : build parts
<?php
use SymfonyComponentFinderFinder;
$iterator = Finder::create()->files()->name(‘*.php’)->in(‘./src’);
$sami = new SamiSami($iterator, [
‘title’ => ‘My Project’,
‘build_dir’ => ‘build/docs/source’,
‘cache_dir’ => ‘build/docs/source/cache’,
]);
return $sami;
Build specialization
● Testing frameworks
● Asset management
● Documentation
● Dependency management
Tools
phpUnit, JUnit, Nightwatch JS, Sass,
LESS, minify, phpDocumentor,
Doxygen, Sami, composer, npm,
bower, gulp, grant, yarn, and many
more.
More specialized tools : database management
<?php
use MigrationsAbstractMigration;
class AddEmailFieldToUsers extends AbstractMigration {
public function change() {
$table = $this->table(‘users’);
$table->addColumn(‘email’, ‘string’, [‘limit’ => 255]);
$table->update();
}
}
Database management
● Versioned schema
● SQL abstraction
● Cross-platform / cross-engine
● Testable changes
● Upgrade and rollback
● Initial data import / seeders
● Data manipulation
● Documentation improvements
● Conflict resolution
Tools
Doctrine, Phinx, DBDeploy, etc.
configure.sh? Infrastructure as Code
---
- name: Nginx and PHP setup
hosts: web-servers
roles:
- geerlingguy.nginx
- geerlingguy.php
- geerlingguy.php-mysql
- geerlingguy.composer
- geerlingguy.letsencrypt
Server provisioning, virtualization,
orchestration, configuration
management
● Automation
● Documentation
● Testable installations
● Concurrency
● Reusable configurations
● Consistency
Tools
Ansible, Puppet, Chef, Salt, Docker,
Kubernetes, Amazon AWS, Heroku,
and many more.
What’s going on?
Application
Infrastructure
Build
System Administrator
Developer
Deploy
Configure
DevOps : ChatOps
Application Infrastructure
Build
Developers, SysAdmins, QA, PMs
Deploy Configure
/deploy install example.com live v2.0
Remote Triggers : Use existing or build your own
Chat
● HipChat, Slack, Rocket.Chat, IRC
● Bots, /commands, @mentions
Bug Trackers / PM Tools
● Redmine, Request Tracker, JIRA
● Custom ticket types, statuses, workflows
Continuous Integration / Delivery
● TravisCI, BitBucket Pipelines, Jenkins
● Workflows, pipelines, stages
Source Code Repositories
● GitHub, BitBucket, GitLab
● Hooks, events
Remote Triggers : Webhooks
HipChat
Redmine
Jenkins
GitHub
JSON Your
API
/usr/bin/sudo
● Configure
● Deploy
● Build
HipChat Example : Slash Command
HipChat Example : API
<?php
$payload = $this->app->request->getBody();
$payload = json_decode($payload, true);
$user = $payload[‘item’][‘message’][‘from’][‘id’];
$user = hipchatToUnix($user);
$command = $payload[‘item’][‘message’][‘message’];
$command = preg_replace(‘#^/deploy #’, ‘’, $command);
# $command = “update example.com live v2.0”
exec(“/usr/bin/sudo -u $user /usr/local/bin/deploy.sh $command”);
Keep in mind
● Security! Security! Security!
● JSON contains context
● Handle failure
● Handle timeouts
● Log excessively!
● Check existing implementations
There is more than one way to do it.
Things can get rather complex
Deployment Stages
● Install
● Update
● Rollback
● Remove
Different Environments
● Development
● Test
● Staging / Pre-production
● Live / Production
Layered Infrastructure
● Web servers
● Database servers
● Load balancers
● Caching / proxy servers
Atomic Deployments
● Multiple deployed versions
● Common assets, user uploads
● Database migrations
● Caching
KISS : Keep it simple, stupid
● Communicate! Deployment is part of the culture, not just technology.
● Opt for existing solutions and best practices. Do not reinvent the wheel.
● Opt for gradual changes. One step at a time. And baby steps too!
● Smaller, independent units are easier to handle. But don’t overdo it.
● Confidence is the key.
● Keep up! After all, technology constantly evolves.
The End.
Thank You
Questions?
Leonid Mamchenkov
http://mamchenkov.net
leonid@mamchenkov.net
https://twitter.com/mamchenkov
Qobo Ltd
https://qobo.biz/ and https://qobrix.com
info@qobo.biz and careers@qobo.biz
https://github.com/QoboLtd

More Related Content

What's hot

Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With SubversionSamnang Chhun
 
Docker Best Practices Workshop
Docker Best Practices WorkshopDocker Best Practices Workshop
Docker Best Practices Workshop
Ahmed AbouZaid
 
Save Time and Money with Automation
Save Time and Money with AutomationSave Time and Money with Automation
Save Time and Money with AutomationChris Jean
 
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Per Henrik Lausten
 
Travis CI
Travis CITravis CI
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
Docker, Inc.
 
Managing changes to eZPublish Database
Managing changes to eZPublish DatabaseManaging changes to eZPublish Database
Managing changes to eZPublish Database
Gaetano Giunta
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
Tuenti
 
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Oleg Nenashev
 
Continuous integration ( jen kins travis ci)
Continuous integration ( jen kins  travis ci)Continuous integration ( jen kins  travis ci)
Continuous integration ( jen kins travis ci)
Sadani Rodrigo
 
Using Git with Drupal
Using Git with DrupalUsing Git with Drupal
Using Git with DrupalRyan Cross
 
DevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentDevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal Deployment
Gerald Villorente
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
Krish
 
Jenkins 101: Getting Started
Jenkins 101: Getting StartedJenkins 101: Getting Started
Jenkins 101: Getting Started
R Geoffrey Avery
 
Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
JBUG London
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes Designer
Slobodan Lohja
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Andrew Bayer
 
Jenkins Shared Libraries Workshop
Jenkins Shared Libraries WorkshopJenkins Shared Libraries Workshop
Jenkins Shared Libraries Workshop
Julien Pivotto
 
Version Control System
Version Control SystemVersion Control System
Version Control System
guptaanil
 
The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014
The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014
The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014
Puppet
 

What's hot (20)

Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With Subversion
 
Docker Best Practices Workshop
Docker Best Practices WorkshopDocker Best Practices Workshop
Docker Best Practices Workshop
 
Save Time and Money with Automation
Save Time and Money with AutomationSave Time and Money with Automation
Save Time and Money with Automation
 
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
 
Travis CI
Travis CITravis CI
Travis CI
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
 
Managing changes to eZPublish Database
Managing changes to eZPublish DatabaseManaging changes to eZPublish Database
Managing changes to eZPublish Database
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
 
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
 
Continuous integration ( jen kins travis ci)
Continuous integration ( jen kins  travis ci)Continuous integration ( jen kins  travis ci)
Continuous integration ( jen kins travis ci)
 
Using Git with Drupal
Using Git with DrupalUsing Git with Drupal
Using Git with Drupal
 
DevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentDevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal Deployment
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
 
Jenkins 101: Getting Started
Jenkins 101: Getting StartedJenkins 101: Getting Started
Jenkins 101: Getting Started
 
Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes Designer
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
 
Jenkins Shared Libraries Workshop
Jenkins Shared Libraries WorkshopJenkins Shared Libraries Workshop
Jenkins Shared Libraries Workshop
 
Version Control System
Version Control SystemVersion Control System
Version Control System
 
The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014
The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014
The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014
 

Similar to Evolution of deploy.sh

[Mas 500] Software Development Strategies
[Mas 500] Software Development Strategies[Mas 500] Software Development Strategies
[Mas 500] Software Development Strategiesrahulbot
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
Kris Buytaert
 
NLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift PrimerNLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift Primer
Eric D. Schabell
 
Introduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital WorkplaceIntroduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital Workplace
Jen Wei Lee
 
Continuous testing
Continuous testingContinuous testing
Continuous testing
Oleksandr Metelytsia
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios
 
Tech talk: PHP
Tech talk: PHPTech talk: PHP
Tech talk: PHP
Jen Wei Lee
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Michael Lihs
 
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...AgileNCR2013
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
Pablo Godel
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011Bachkoutou Toutou
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
Ryan Street
 
Cloud Native Development
Cloud Native DevelopmentCloud Native Development
Cloud Native Development
Manuel Garcia
 
Dokku your own heroku 21
Dokku   your own heroku 21Dokku   your own heroku 21
Dokku your own heroku 21
Amoniac OÜ
 
Dokku - your own heroku
Dokku  - your own herokuDokku  - your own heroku
Dokku - your own heroku
Aleksandr Simonov
 
DevSecOps - Security in DevOps
DevSecOps - Security in DevOpsDevSecOps - Security in DevOps
DevSecOps - Security in DevOps
Aarno Aukia
 
Codemotion 2012 Rome - An OpenShift Primer
Codemotion 2012 Rome - An OpenShift PrimerCodemotion 2012 Rome - An OpenShift Primer
Codemotion 2012 Rome - An OpenShift Primer
Eric D. Schabell
 
A Byte of Software Deployment
A Byte of Software DeploymentA Byte of Software Deployment
A Byte of Software Deployment
Gong Haibing
 
OpenShift Primer - get your business into the Cloud today!
OpenShift Primer - get your business into the Cloud today!OpenShift Primer - get your business into the Cloud today!
OpenShift Primer - get your business into the Cloud today!
Eric D. Schabell
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
Pablo Godel
 

Similar to Evolution of deploy.sh (20)

[Mas 500] Software Development Strategies
[Mas 500] Software Development Strategies[Mas 500] Software Development Strategies
[Mas 500] Software Development Strategies
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
NLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift PrimerNLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift Primer
 
Introduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital WorkplaceIntroduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital Workplace
 
Continuous testing
Continuous testingContinuous testing
Continuous testing
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
 
Tech talk: PHP
Tech talk: PHPTech talk: PHP
Tech talk: PHP
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
 
Cloud Native Development
Cloud Native DevelopmentCloud Native Development
Cloud Native Development
 
Dokku your own heroku 21
Dokku   your own heroku 21Dokku   your own heroku 21
Dokku your own heroku 21
 
Dokku - your own heroku
Dokku  - your own herokuDokku  - your own heroku
Dokku - your own heroku
 
DevSecOps - Security in DevOps
DevSecOps - Security in DevOpsDevSecOps - Security in DevOps
DevSecOps - Security in DevOps
 
Codemotion 2012 Rome - An OpenShift Primer
Codemotion 2012 Rome - An OpenShift PrimerCodemotion 2012 Rome - An OpenShift Primer
Codemotion 2012 Rome - An OpenShift Primer
 
A Byte of Software Deployment
A Byte of Software DeploymentA Byte of Software Deployment
A Byte of Software Deployment
 
OpenShift Primer - get your business into the Cloud today!
OpenShift Primer - get your business into the Cloud today!OpenShift Primer - get your business into the Cloud today!
OpenShift Primer - get your business into the Cloud today!
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
 

Recently uploaded

Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 

Recently uploaded (20)

Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 

Evolution of deploy.sh

  • 2. About Leonid Mamchenkov ● System administrator, web developer ● 20+ years of experience ■ Primetel ■ FxPro ■ Easy Forex ■ Qobo ● Open Source fan and advocate ■ Linux (Fedora, CentOS, Red Hat) ■ PHP (bash, perl) ■ MySQL ■ Nginx ■ Git ■ Vim Qobo Ltd ● Established in February 2013 ● Offices in Nicosia, Limassol, London ● Web design, development, hosting ■ WordPress ■ WooCommerce ■ Amazon AWS ● Software development ■ CakePHP ■ Qobrix Platform ■ CRM Systems ■ Intranets ■ Portals ■ Integrations
  • 3. What is deployment? Application ● Code (HTML, CSS, JavaScript, PHP) ● Assets (images, fonts) ● Configuration (credentials, defaults, runtime) ● Database (schema, content) Infrastructure ● Hardware ● Operating system ● Filesystem, networking ● Services Deployment: installing, updating or removing the application to or from a particular infrastructure. Software deployment is all of the activities that make a software system available for use. https://en.wikipedia.org/wiki/Software_deployment
  • 4. Why is deployment automation important? Speed ● Faster deployment ● Frequency ● Feedback loop Release early, release often! https://en.wikipedia.org/wiki/Release_early,_release_often Quality ● Fewer human error ● Consistency ● Predictability Cost ● Machine vs. human ● Reuse ● Troubleshooting
  • 5. Evolution of the Web (last 20 years) Overall: ● More users ● More data ● More devices ● More features ● More expectations Technologies: Static HTML, Cookies, SSI, CGI, SSL, XML, RPC, API, AJAX, RSS, Web 2.0, Mobile Web, WebSockets, IoT, Big Data, cloud computing, and more ... As the web evolved, so did the deployment of the web applications.
  • 6. Prehistoric days : before deploy.sh Application ● Very small and basic. ● Often, just a few static HTML and image files. ● Sometimes, an occasional CGI script. Infrastructure ● Shared hosting with limited access. ● Single server. ● No version control. ● No SSH access. Deployment: manual upload via FTP or some sort of web-based control panel. If you are still here, at least look at some FTP deployment / smart upload tools, like SmartFTP.
  • 7. The birth of deploy.sh #!/bin/bash rsync -re ssh . leonid@example.com:~/public_html/ ssh leonid@example.com << EOF cd ~/public_html/ chown -R leonid.nobody {logs,tmp,uploads} mysql -u leonid example_com < db/mysql.sql EOF echo “All Done” Basic automation ● Simple, step-by-step ● Mostly shell ● No specialized tools ● Basic remote access ● No error handling ● Very specific ● Not portable ● No concurrency control ● No trail ● No changesets ● No documentation ● Often insecure
  • 8. Version control / The birth of build.sh #!/bin/bash ssh leonid@example.com << EOF cd ~/public_html/ git pull origin master ./bin/build.sh EOF echo “All Done” Improvements ● More reliable file synchronization ● Much faster on larger projects ● Basic permissions management ● Changesets ● Git/Subversion hooks ● Basic concurrency control ● More portability ● Often better security ● Submodules, exports, etc. Separation of concerns between deployment and build processes. Deployment seems simple and easy. Build process - not so much.
  • 9. The explosion of build tools <?php class DbCreate extends AbstractCommand { public function mysqlDbCreate($host, $port, $name, $user, $pass) { $this->taskMysqlDbCreate() ->host($host)->port($port) ->user($user)->pass($pass) ->db($name)->run(); } } Improvements ● Specialized syntax ● Dependency management ● Improved error handling ● Improved output / verbosity ● Improved portability ● Reusable tasks and modules ● Documentation Tools GNU make, CMake, Apache Ant, Phing, Rake, Phake, Capistrano, Robo, Deployer, many others.
  • 10. More specialized tools : build parts <?php use SymfonyComponentFinderFinder; $iterator = Finder::create()->files()->name(‘*.php’)->in(‘./src’); $sami = new SamiSami($iterator, [ ‘title’ => ‘My Project’, ‘build_dir’ => ‘build/docs/source’, ‘cache_dir’ => ‘build/docs/source/cache’, ]); return $sami; Build specialization ● Testing frameworks ● Asset management ● Documentation ● Dependency management Tools phpUnit, JUnit, Nightwatch JS, Sass, LESS, minify, phpDocumentor, Doxygen, Sami, composer, npm, bower, gulp, grant, yarn, and many more.
  • 11. More specialized tools : database management <?php use MigrationsAbstractMigration; class AddEmailFieldToUsers extends AbstractMigration { public function change() { $table = $this->table(‘users’); $table->addColumn(‘email’, ‘string’, [‘limit’ => 255]); $table->update(); } } Database management ● Versioned schema ● SQL abstraction ● Cross-platform / cross-engine ● Testable changes ● Upgrade and rollback ● Initial data import / seeders ● Data manipulation ● Documentation improvements ● Conflict resolution Tools Doctrine, Phinx, DBDeploy, etc.
  • 12. configure.sh? Infrastructure as Code --- - name: Nginx and PHP setup hosts: web-servers roles: - geerlingguy.nginx - geerlingguy.php - geerlingguy.php-mysql - geerlingguy.composer - geerlingguy.letsencrypt Server provisioning, virtualization, orchestration, configuration management ● Automation ● Documentation ● Testable installations ● Concurrency ● Reusable configurations ● Consistency Tools Ansible, Puppet, Chef, Salt, Docker, Kubernetes, Amazon AWS, Heroku, and many more.
  • 13. What’s going on? Application Infrastructure Build System Administrator Developer Deploy Configure
  • 14. DevOps : ChatOps Application Infrastructure Build Developers, SysAdmins, QA, PMs Deploy Configure /deploy install example.com live v2.0
  • 15. Remote Triggers : Use existing or build your own Chat ● HipChat, Slack, Rocket.Chat, IRC ● Bots, /commands, @mentions Bug Trackers / PM Tools ● Redmine, Request Tracker, JIRA ● Custom ticket types, statuses, workflows Continuous Integration / Delivery ● TravisCI, BitBucket Pipelines, Jenkins ● Workflows, pipelines, stages Source Code Repositories ● GitHub, BitBucket, GitLab ● Hooks, events
  • 16. Remote Triggers : Webhooks HipChat Redmine Jenkins GitHub JSON Your API /usr/bin/sudo ● Configure ● Deploy ● Build
  • 17. HipChat Example : Slash Command
  • 18. HipChat Example : API <?php $payload = $this->app->request->getBody(); $payload = json_decode($payload, true); $user = $payload[‘item’][‘message’][‘from’][‘id’]; $user = hipchatToUnix($user); $command = $payload[‘item’][‘message’][‘message’]; $command = preg_replace(‘#^/deploy #’, ‘’, $command); # $command = “update example.com live v2.0” exec(“/usr/bin/sudo -u $user /usr/local/bin/deploy.sh $command”); Keep in mind ● Security! Security! Security! ● JSON contains context ● Handle failure ● Handle timeouts ● Log excessively! ● Check existing implementations There is more than one way to do it.
  • 19. Things can get rather complex Deployment Stages ● Install ● Update ● Rollback ● Remove Different Environments ● Development ● Test ● Staging / Pre-production ● Live / Production Layered Infrastructure ● Web servers ● Database servers ● Load balancers ● Caching / proxy servers Atomic Deployments ● Multiple deployed versions ● Common assets, user uploads ● Database migrations ● Caching
  • 20. KISS : Keep it simple, stupid ● Communicate! Deployment is part of the culture, not just technology. ● Opt for existing solutions and best practices. Do not reinvent the wheel. ● Opt for gradual changes. One step at a time. And baby steps too! ● Smaller, independent units are easier to handle. But don’t overdo it. ● Confidence is the key. ● Keep up! After all, technology constantly evolves.
  • 22. Questions? Leonid Mamchenkov http://mamchenkov.net leonid@mamchenkov.net https://twitter.com/mamchenkov Qobo Ltd https://qobo.biz/ and https://qobrix.com info@qobo.biz and careers@qobo.biz https://github.com/QoboLtd