SlideShare a Scribd company logo
Professional Deployment
About
Crowd Favorite
FTP Workflow
Issues with this workflow

No fast way to revert

No backup of the file

No way to track changes

No way to check if someone else is
working on the same file

Slow and not effective
Professional deployment
tools

Capistrano

Mercury Vagrant

WP CLI
Capistrano

Capistrano is a remote server automation
tool.

Benefits:
- Reliably deploy web application to any
number of machines simultaneously, in
sequence or as a rolling set
- To automate audits of any number of
machines (checking login logs, enumerating
uptimes, and/or applying security patches)
- To script arbitrary workflows over SSH
- To automate common tasks in software teams.
Requirements
Capistrano is written in Ruby, but
it can easily be used to deploy any
language.

Ruby >= 1.9.3 (JRuby and C-
Ruby/YARV are supported)

Capistrano support these source
code version control systems out of
the box:
– Git 1.8 or higher
– Mercurial
– SVN
Assumptions

You are using SSH to access your remote
machines. Telnet and FTP are not supported.

Your remote servers have a POSIX-compatible
shell installed. The shell must be called
“sh” and must reside in the default system
path.

If you are using passwords to access your
servers, they must all have the same
password. Because this is not generally a
good idea, the preferred way of accessing
your servers is with a public key. Make
sure you’ve got a good passphrase on your
key.
Assumptions
Installation

gem 'capistrano', '~> 3.4.0'

$ bundle install

$ bundle exec cap install
Capify: make sure there's no
"Capfile" or "capfile" present
Structure

├── Capfile

├── config

│ ├── deploy

│ │ ├── production.rb

│ │ └── staging.rb

│ └── deploy.rb

└── lib

└── capistrano

└── tasks
Crowd Favorite modification
Recipes for deploying and
maintaining remote WordPress
installations with Capistrano.
cap -T
Create a project

cap cf:setup:new_project
{
"code_repository": "",
"code_directory": "",
"type": "wordpress",
"project_name": "wordcamp-sofia",
"wp_directory": "wp/",
"wp_content_directory": "wp-
content/",
"wp_version": "branches/4.3",
"database_name": "c_wc_sofia",
"dev_domain": "wordcamp-sofia.dev"
}
cap cf:setup:wordpress

Set up WordPress install

Gets the required version of
WordPress core noted in the
capinfo.json file - "wp_version":
"branches/4.3",

Set up config files

Set up local-config.php, included
into the wp-config.php, to make
local install

Set up all needed files
Custom Capistrano recipes

Sync DB with remote server

Update on staging server

Update WordPress Core

Set up a project that already
exists on git with everything you
need for local dev
Deployment

Important files for the setup
- config/deploy.rb
- config/deploy/production.rb
- config/deploy/staging.rb
config/deploy.rb

Stages – production, staging

Server WordPress version

Git repo to pull from

Enable/disable git submodules

Number of releases to keep

Files to exclude form deploy

Files on server to exclude from
tracking
staging.rb

Staging ssh user and IP

Paths to server directories

Branch to deploy

Symlinks

After deploy actions
production.rb

Production ssh user and IP

Paths to server directories

Branch to deploy

Symlinks

After deploy actions
Executing deployment

cap staging deploy

cap production deploy

Magic!
Behind the scenes

Capistrano executes a set of commands,

Connects via ssh on the server.

Sets up the version of WordPress set in
config/deploy.rb,
- for example: set:wordpress_version,
"tags/4.3.1",

Sets new releases folder with the
current timestamp

Symlinks root content folder to the new
release folder
Behind the scenes

Creates symlinks to the shared
directories

Clears the cache

All done
Rolling back

In case something goes wrong
cap deploy:rollback
– Rolls back a previous version and
restarts
Server structure

Deploy path
- current folder – httpdocs for
example
- releases folder – keeps the number
of releases set on the deploy.rb
file
- shared folder – contains the
symlinked folders described in the
config file
Git push

Pushes to server from git repo

Can be used on most of the hosts

Easy to run and rollback
Set up

Set up local repo

ssh on the server and set up you
ssh keys used for Github

Clone the git repository folder
structure there

Add remote locally
- check remotes – git remote -v
- add remote – git remote add <your
repo ssh link>

git push <branch name needed>
Set up local environment
with Mercury
Mercury project is meant to allow
people in the WordPress community
to run a single Vagrant for
developing, debugging, and
deploying HHVM based code.
Setting Up

Install Git.

Windows users: Be sure to add the Git
executables to your path (See, e.g. this
guide, under "Prerequisites")

Install virtual machine software (VMware or
VirtualBox are recommended).

Install Vagrant

Install Node

Optional, but highly recommended: Install
the Vagrant Ghost plugin
- Short version: vagrant plugin install
vagrant-ghost
Installation

git clone --recursive
https://github.com/wpengine/hgv.git
.
- to clone the latest version of the
tool.

Change into the directory hgv.

Run npm install to install build
and deploy script dependencies.

Run vagrant up.
Default sites

hgv.test -- General documentation
and links for all of the tools

hhvm.hgv.test -- A new WordPress
installation running on HHVM

php.hgv.test -- A new WordPress
installation running on PHP-FPM
(PHP 5.5)

admin.hgv.test -- Useful
administrative tools (phpMyAdmin,
etc.) - admin.hgv.test/phpmyadmin
Workflow

New project folder in hgv/sites
provisioning/default-install.yml ->
hgv_data/config/sites/default.yml

Config the yml file

Run vagrant provision.
What you get

New WordPress with some useful
plugins

All config files set up

DB set up

Debug tools

ssh access to the vagrant files

caching if needed – Memcache /
Varnish
Vagrant Push
config.push.define "staging",
strategy: "ftp" do |push|
# ...
end
config.push.define "qa", strategy:
"ftp" do |push|
# ...
end
WP CLI
WP-CLI is a set of command-line
tools for managing WordPress
installations. You can update
plugins, set up multisite installs
and much more, without using a web
browser.
Requirements

UNIX-like environment (OS X, Linux,
FreeBSD, Cygwin); limited support
in Windows environment

PHP 5.3.2 or later

WordPress 3.5.2 or later
Usage
Navigate to WordPress root:

cd /var/www/wp/
Commands list:

wp

Test a plugin install:

wp plugin install hello-dolly
Deployment

wp-cli-deploy

Requires defining a set of
constants in your wp-config.php
file

Example # Pull both the production
themes and plugins
wp deploy pull production
--what=themes && wp deploy pull
production --what=plugins
Example
define( 'DEV_URL', 'the-remote-website-url.com' );
define( 'DEV_WP_PATH',
'/path/to/the/wp/dir/on/the/server' );
define( 'DEV_HOST', 'ssh_host' );
define( 'DEV_USER', 'ssh_user' );
define( 'DEV_PORT', '22' );
define( 'DEV_PATH',
'/path/to/a/writable/dir/on/the/server' );
define( 'DEV_UPLOADS_PATH',
'/path/to/the/remote/uploads/directory' );
define( 'DEV_THEMES_PATH',
'/path/to/the/remote/themes/directory' );
define( 'DEV_PLUGINS_PATH',
'/path/to/the/remote/plugins/directory' );
define( 'DEV_DB_HOST', 'the_remote_db_host' );
define( 'DEV_DB_NAME', 'the_remote_db_name' );
define( 'DEV_DB_USER', 'the_remote_db_user' );
define( 'DEV_DB_PASSWORD', 'the_remote_db_password' );
define( 'DEV_POST_HOOK', 'echo "something to be executed
when the command finishes"' )
Final notes

Open source products

Easy to use and configure

A lot of contributors, examples,
docs

Adding of custom commands/recipes
for custom cases/projects
Resources
http://capistranorb.com/
https://github.com/capistrano/capistrano/wiki
https://git-scm.com/docs/git-push
http://wpengine.com/mercury/how-to-start/
https://github.com/wpengine/hgv/wiki
http://wp-cli.org/
https://github.com/wp-cli/wp-cli/wiki
Contacts
E-mail: iv.dimova@gmail.com
Twitter: @iv_wp
Professional deployment

More Related Content

What's hot

SaltConf14 - Forrest Alvarez, Choice Hotels - Salt Formulas and States
SaltConf14 - Forrest Alvarez, Choice Hotels - Salt Formulas and StatesSaltConf14 - Forrest Alvarez, Choice Hotels - Salt Formulas and States
SaltConf14 - Forrest Alvarez, Choice Hotels - Salt Formulas and States
SaltStack
 
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackIQ
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Ontico
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
Ohad Raz
 
A Better WordPress Workflow with WP-CLI
A Better WordPress Workflow with WP-CLIA Better WordPress Workflow with WP-CLI
A Better WordPress Workflow with WP-CLI
Rikesh Ramlochund
 
[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure[MathWorks] Versioning Infrastructure
[MathWorks] Versioning InfrastructurePerforce
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
Geeta Vinnakota
 
WE18_Performance_Up.ppt
WE18_Performance_Up.pptWE18_Performance_Up.ppt
WE18_Performance_Up.pptwebhostingguy
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
Mantas Klasavicius
 
Improving WordPress Theme Development Workflow - Naveen Kharwar.
Improving WordPress Theme Development Workflow - Naveen Kharwar.Improving WordPress Theme Development Workflow - Naveen Kharwar.
Improving WordPress Theme Development Workflow - Naveen Kharwar.
Naveen Kharwar
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with DockerPatrick Mizer
 
How lve stats2 works for you and your customers
How lve stats2 works for you and your customersHow lve stats2 works for you and your customers
How lve stats2 works for you and your customers
CloudLinux
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
Larry Cai
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with Puppet
Michael Lessard
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
Pablo Godel
 
StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz
StackIQ
 
Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
StephaneFlotat1
 
Drupal in Libraries
Drupal in LibrariesDrupal in Libraries
Drupal in Libraries
Cary Gordon
 

What's hot (20)

SaltConf14 - Forrest Alvarez, Choice Hotels - Salt Formulas and States
SaltConf14 - Forrest Alvarez, Choice Hotels - Salt Formulas and StatesSaltConf14 - Forrest Alvarez, Choice Hotels - Salt Formulas and States
SaltConf14 - Forrest Alvarez, Choice Hotels - Salt Formulas and States
 
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
A Better WordPress Workflow with WP-CLI
A Better WordPress Workflow with WP-CLIA Better WordPress Workflow with WP-CLI
A Better WordPress Workflow with WP-CLI
 
[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure
 
are available here
are available hereare available here
are available here
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
WE18_Performance_Up.ppt
WE18_Performance_Up.pptWE18_Performance_Up.ppt
WE18_Performance_Up.ppt
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
 
Improving WordPress Theme Development Workflow - Naveen Kharwar.
Improving WordPress Theme Development Workflow - Naveen Kharwar.Improving WordPress Theme Development Workflow - Naveen Kharwar.
Improving WordPress Theme Development Workflow - Naveen Kharwar.
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
 
How lve stats2 works for you and your customers
How lve stats2 works for you and your customersHow lve stats2 works for you and your customers
How lve stats2 works for you and your customers
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with Puppet
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz
 
Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
 
Drupal in Libraries
Drupal in LibrariesDrupal in Libraries
Drupal in Libraries
 
OTRS
OTRSOTRS
OTRS
 

Similar to Professional deployment

02 Hadoop deployment and configuration
02 Hadoop deployment and configuration02 Hadoop deployment and configuration
02 Hadoop deployment and configuration
Subhas Kumar Ghosh
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
Introduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineIntroduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command line
Behzod Saidov
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
kuldeepakgautam
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with Ansible
Stein Inge Morisbak
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationPASCAL Jean Marie
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
RootGate
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
Vicent Selfa
 
Baylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStackBaylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStack
Jesse Andrews
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
Ramazan K
 
Prizm Installation Guide
Prizm Installation GuidePrizm Installation Guide
Prizm Installation Guide
vjvarenya
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
Antons Kranga
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
Sylvain Rayé
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
Adam Englander
 
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-NapocaWP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
4nd4p0p
 
One click deployment
One click deploymentOne click deployment
One click deploymentAlex Su
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
Fabio Fumarola
 
Travis CI - PHP
Travis CI - PHPTravis CI - PHP
Travis CI - PHP
Adam Englander
 

Similar to Professional deployment (20)

02 Hadoop deployment and configuration
02 Hadoop deployment and configuration02 Hadoop deployment and configuration
02 Hadoop deployment and configuration
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Introduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineIntroduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command line
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with Ansible
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous Integration
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
 
Baylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStackBaylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStack
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
Prizm Installation Guide
Prizm Installation GuidePrizm Installation Guide
Prizm Installation Guide
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Apache - Quick reference guide
Apache - Quick reference guideApache - Quick reference guide
Apache - Quick reference guide
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-NapocaWP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
 
One click deployment
One click deploymentOne click deployment
One click deployment
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
 
Travis CI - PHP
Travis CI - PHPTravis CI - PHP
Travis CI - PHP
 

More from Ivelina Dimova

The Magic of Advanced Debugging
The Magic of Advanced DebuggingThe Magic of Advanced Debugging
The Magic of Advanced Debugging
Ivelina Dimova
 
Make your own wp cli command in 10min
Make your own wp cli command in 10minMake your own wp cli command in 10min
Make your own wp cli command in 10min
Ivelina Dimova
 
The swiss knife of a word press developer
The swiss knife of a word press developerThe swiss knife of a word press developer
The swiss knife of a word press developer
Ivelina Dimova
 
The WordPress developer's toolkit
The WordPress developer's toolkit The WordPress developer's toolkit
The WordPress developer's toolkit
Ivelina Dimova
 
Git Tricks
Git TricksGit Tricks
Git Tricks
Ivelina Dimova
 
WordCamp Sofia 2012
WordCamp Sofia 2012WordCamp Sofia 2012
WordCamp Sofia 2012
Ivelina Dimova
 

More from Ivelina Dimova (8)

The Magic of Advanced Debugging
The Magic of Advanced DebuggingThe Magic of Advanced Debugging
The Magic of Advanced Debugging
 
Make your own wp cli command in 10min
Make your own wp cli command in 10minMake your own wp cli command in 10min
Make your own wp cli command in 10min
 
The swiss knife of a word press developer
The swiss knife of a word press developerThe swiss knife of a word press developer
The swiss knife of a word press developer
 
The WordPress developer's toolkit
The WordPress developer's toolkit The WordPress developer's toolkit
The WordPress developer's toolkit
 
Git Tricks
Git TricksGit Tricks
Git Tricks
 
WordCamp London 2013
WordCamp London 2013WordCamp London 2013
WordCamp London 2013
 
Wc no
Wc noWc no
Wc no
 
WordCamp Sofia 2012
WordCamp Sofia 2012WordCamp Sofia 2012
WordCamp Sofia 2012
 

Recently uploaded

Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 

Recently uploaded (20)

Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 

Professional deployment

  • 5.
  • 6. Issues with this workflow  No fast way to revert  No backup of the file  No way to track changes  No way to check if someone else is working on the same file  Slow and not effective
  • 8. Capistrano  Capistrano is a remote server automation tool.  Benefits: - Reliably deploy web application to any number of machines simultaneously, in sequence or as a rolling set - To automate audits of any number of machines (checking login logs, enumerating uptimes, and/or applying security patches) - To script arbitrary workflows over SSH - To automate common tasks in software teams.
  • 9. Requirements Capistrano is written in Ruby, but it can easily be used to deploy any language.  Ruby >= 1.9.3 (JRuby and C- Ruby/YARV are supported)  Capistrano support these source code version control systems out of the box: – Git 1.8 or higher – Mercurial – SVN
  • 10. Assumptions  You are using SSH to access your remote machines. Telnet and FTP are not supported.  Your remote servers have a POSIX-compatible shell installed. The shell must be called “sh” and must reside in the default system path.  If you are using passwords to access your servers, they must all have the same password. Because this is not generally a good idea, the preferred way of accessing your servers is with a public key. Make sure you’ve got a good passphrase on your key.
  • 12. Installation  gem 'capistrano', '~> 3.4.0'  $ bundle install  $ bundle exec cap install Capify: make sure there's no "Capfile" or "capfile" present
  • 13. Structure  ├── Capfile  ├── config  │ ├── deploy  │ │ ├── production.rb  │ │ └── staging.rb  │ └── deploy.rb  └── lib  └── capistrano  └── tasks
  • 14. Crowd Favorite modification Recipes for deploying and maintaining remote WordPress installations with Capistrano.
  • 16. Create a project  cap cf:setup:new_project
  • 17.
  • 18. { "code_repository": "", "code_directory": "", "type": "wordpress", "project_name": "wordcamp-sofia", "wp_directory": "wp/", "wp_content_directory": "wp- content/", "wp_version": "branches/4.3", "database_name": "c_wc_sofia", "dev_domain": "wordcamp-sofia.dev" }
  • 19. cap cf:setup:wordpress  Set up WordPress install  Gets the required version of WordPress core noted in the capinfo.json file - "wp_version": "branches/4.3",  Set up config files  Set up local-config.php, included into the wp-config.php, to make local install  Set up all needed files
  • 20.
  • 21. Custom Capistrano recipes  Sync DB with remote server  Update on staging server  Update WordPress Core  Set up a project that already exists on git with everything you need for local dev
  • 22. Deployment  Important files for the setup - config/deploy.rb - config/deploy/production.rb - config/deploy/staging.rb
  • 23. config/deploy.rb  Stages – production, staging  Server WordPress version  Git repo to pull from  Enable/disable git submodules  Number of releases to keep  Files to exclude form deploy  Files on server to exclude from tracking
  • 24. staging.rb  Staging ssh user and IP  Paths to server directories  Branch to deploy  Symlinks  After deploy actions
  • 25. production.rb  Production ssh user and IP  Paths to server directories  Branch to deploy  Symlinks  After deploy actions
  • 26. Executing deployment  cap staging deploy  cap production deploy  Magic!
  • 27. Behind the scenes  Capistrano executes a set of commands,  Connects via ssh on the server.  Sets up the version of WordPress set in config/deploy.rb, - for example: set:wordpress_version, "tags/4.3.1",  Sets new releases folder with the current timestamp  Symlinks root content folder to the new release folder
  • 28. Behind the scenes  Creates symlinks to the shared directories  Clears the cache  All done
  • 29. Rolling back  In case something goes wrong cap deploy:rollback – Rolls back a previous version and restarts
  • 30. Server structure  Deploy path - current folder – httpdocs for example - releases folder – keeps the number of releases set on the deploy.rb file - shared folder – contains the symlinked folders described in the config file
  • 31. Git push  Pushes to server from git repo  Can be used on most of the hosts  Easy to run and rollback
  • 32. Set up  Set up local repo  ssh on the server and set up you ssh keys used for Github  Clone the git repository folder structure there  Add remote locally - check remotes – git remote -v - add remote – git remote add <your repo ssh link>  git push <branch name needed>
  • 33. Set up local environment with Mercury Mercury project is meant to allow people in the WordPress community to run a single Vagrant for developing, debugging, and deploying HHVM based code.
  • 34. Setting Up  Install Git.  Windows users: Be sure to add the Git executables to your path (See, e.g. this guide, under "Prerequisites")  Install virtual machine software (VMware or VirtualBox are recommended).  Install Vagrant  Install Node  Optional, but highly recommended: Install the Vagrant Ghost plugin - Short version: vagrant plugin install vagrant-ghost
  • 35. Installation  git clone --recursive https://github.com/wpengine/hgv.git . - to clone the latest version of the tool.  Change into the directory hgv.  Run npm install to install build and deploy script dependencies.  Run vagrant up.
  • 36. Default sites  hgv.test -- General documentation and links for all of the tools  hhvm.hgv.test -- A new WordPress installation running on HHVM  php.hgv.test -- A new WordPress installation running on PHP-FPM (PHP 5.5)  admin.hgv.test -- Useful administrative tools (phpMyAdmin, etc.) - admin.hgv.test/phpmyadmin
  • 37. Workflow  New project folder in hgv/sites provisioning/default-install.yml -> hgv_data/config/sites/default.yml  Config the yml file  Run vagrant provision.
  • 38. What you get  New WordPress with some useful plugins  All config files set up  DB set up  Debug tools  ssh access to the vagrant files  caching if needed – Memcache / Varnish
  • 39. Vagrant Push config.push.define "staging", strategy: "ftp" do |push| # ... end config.push.define "qa", strategy: "ftp" do |push| # ... end
  • 40. WP CLI WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, set up multisite installs and much more, without using a web browser.
  • 41. Requirements  UNIX-like environment (OS X, Linux, FreeBSD, Cygwin); limited support in Windows environment  PHP 5.3.2 or later  WordPress 3.5.2 or later
  • 42. Usage Navigate to WordPress root:  cd /var/www/wp/ Commands list:  wp  Test a plugin install:  wp plugin install hello-dolly
  • 43. Deployment  wp-cli-deploy  Requires defining a set of constants in your wp-config.php file  Example # Pull both the production themes and plugins wp deploy pull production --what=themes && wp deploy pull production --what=plugins
  • 44. Example define( 'DEV_URL', 'the-remote-website-url.com' ); define( 'DEV_WP_PATH', '/path/to/the/wp/dir/on/the/server' ); define( 'DEV_HOST', 'ssh_host' ); define( 'DEV_USER', 'ssh_user' ); define( 'DEV_PORT', '22' ); define( 'DEV_PATH', '/path/to/a/writable/dir/on/the/server' ); define( 'DEV_UPLOADS_PATH', '/path/to/the/remote/uploads/directory' ); define( 'DEV_THEMES_PATH', '/path/to/the/remote/themes/directory' ); define( 'DEV_PLUGINS_PATH', '/path/to/the/remote/plugins/directory' ); define( 'DEV_DB_HOST', 'the_remote_db_host' ); define( 'DEV_DB_NAME', 'the_remote_db_name' ); define( 'DEV_DB_USER', 'the_remote_db_user' ); define( 'DEV_DB_PASSWORD', 'the_remote_db_password' ); define( 'DEV_POST_HOOK', 'echo "something to be executed when the command finishes"' )
  • 45. Final notes  Open source products  Easy to use and configure  A lot of contributors, examples, docs  Adding of custom commands/recipes for custom cases/projects