Learn how to use Capistrano to automate the deployment of your Ruby on Rails applications. Apply best practices and add-ons for customizing Capistrano.
For many years Capistrano has been the defacto deployment tool, but many organisations have yet to realise the benefits of automating their deployment process. Automated Deployments are fast, less error prone, easier to rollback and you can dish out the keys to other team members so anyone can deploy.
During this talk we’ll look at how to “capify” a simple PHP project and deploy it in a few minutes. And, as Capistrano is a “remote server automation and deployment tool”, we’ll also look at some of the other things Capistrano can do for you such as restarting apache or grepping server log (and more). We’ll also take a look at the various plug-ins available and see how easy it can be to write your own.
If you are deploying using ssh / git pull / apache restart? Then it’s time to make a change: automate all the things and live in a world of “repeatable success”.
Learn how to use Capistrano to automate the deployment of your Ruby on Rails applications. Apply best practices and add-ons for customizing Capistrano.
For many years Capistrano has been the defacto deployment tool, but many organisations have yet to realise the benefits of automating their deployment process. Automated Deployments are fast, less error prone, easier to rollback and you can dish out the keys to other team members so anyone can deploy.
During this talk we’ll look at how to “capify” a simple PHP project and deploy it in a few minutes. And, as Capistrano is a “remote server automation and deployment tool”, we’ll also look at some of the other things Capistrano can do for you such as restarting apache or grepping server log (and more). We’ll also take a look at the various plug-ins available and see how easy it can be to write your own.
If you are deploying using ssh / git pull / apache restart? Then it’s time to make a change: automate all the things and live in a world of “repeatable success”.
SaltConf14 - Forrest Alvarez, Choice Hotels - Salt Formulas and StatesSaltStack
This session will expand your knowledge of cutting-edge techniques for creating Salt states and formulas. Users will obtain a thorough understanding of how states interact with pillars, as well as map.jinja files. We'll discuss how to make formulas OS agnostic and show how the usage of external pillars combined with a map file can result in formulas that are easy to explain, easy to learn, and easy to update.
Chef Provisioning a Chef Server Cluster - ChefConf 2015Chef
This talk is an exploration of how to build Chef Server 12 clusters with Chef Provisioning, including premium features like Chef Reporting and Chef Analytics. I will cover several new capabilities and tools in the Chef ecosystem that makes it easier than ever before to build and manage scalable Chef Server clusters.
https://youtu.be/HUQA1Ikm5Iw
Building a Production Grade PostgreSQL Cloud Foundry Service | anyninesanynines GmbH
Slides to the talk held at the Cloud Foundry Summit in Santa Clara 2016 about building a on-demand provisioning PostgreSQL Cloud Foundry Services being able to deploy dedicated PostgreSQL servers and 3-node-async-replicating clusters using Bosh.
The slides cover important design decisions such as single PostgreSQL server vs. PostgreSQL clusters, shared vs. dedicated PostgreSQL servers, pre-provisioning vs. on-demand provisioning of vms, the right choice of the automation technology as well as a draft of a resulting architecture.
Capistrano is an open source tool for running scripts on
multiple servers. Its main use is deploying web
applications including supporting tasks such as
changing databases.
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...SaltStack
Arnold gave this presentation at the Secure Linux Admin Conference in Berlin Germany. He provides an overview of what configuration management systems do, explains the fundamentals of SaltStack and provides a look inside.
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...SaltStack
Deployment is often omitted from configuration management and orchestration, which typically focuses on the infrastructure and not the core application that the infrastructure supports. This presentation will give an overview of a deployment system I wrote using SaltStack to provide immediately consistent deployment for software. The deployment system has the ability for manual deploys or for continuous deployments using a Heroku-like workflow. It has support for multiple deployment schemes, with a default of Git deployment. The deployment system uses a combination of Salt peer runner calls, runners, modules, returners, pillars and grains as well as a deployment host running Apache, Sartoris (a git-deploy frontend), and Redis (for reporting).
A revamped version of the Ansible intro talk from February 2015, brought up-to-date for the January Ansible meetup in Berlin.
Join our group: https://www.meetup.com/Ansible-Berlin
Ansible is tool for Configuration Management. The big difference to Chef and Puppet is, that Ansible doesn't need a Master and doesn't need a special client on the servers. It works completely via SSH and the configuration is done in Yaml.
These slides give a short introduction & motivation for Ansible.
A talk I gave at the recent Advanced AWS Meeup - this is a detailed guide to how I installed and set up Spinnaker to work with our infrastructure at Stitch Fix. I go over the various problems I ran into and how I solved them. I hope this can be useful for others setting up, or interested in setting up Spinnaker for their purposes.
**Big thanks to Armory for recording the talks! Video for this talk can be found here: https://youtu.be/ywzPblFpIE0 (I'm the second speaker)**
SaltConf 2014 keynote - Thomas Jackson, LinkedIn
Safety with Power tools
As infrastructure scales, simple tasks become increasingly difficult. For large infrastructures to be manageable, we use automation. But automation, like any power tool, comes with its own set of risks and challenges. Automation should be handled like production code, and great care should be exercised with power tools. This talk will cover how SaltStack is used at LinkedIn and offer tips and tricks for automating management with SaltStack at massive scale including a look at LinkedIn-inspired Salt features such as blacklist and pre-req states. It will also cover Salt master and minion instrumentation and a compilation of how not to use Salt.
Current session guides through Vagrant. Shows some tips and tricks and targeted to software developers.
Practical activities can be found here: https://github.com/akranga/devops-hackathon-1
A team's learnings from adopting devops and automating an otherwise labor-intensive server fleet. The bottom line: As with code, automated tests and CI are king.
This talk was held at Barcamp Salzburg in October 2016.
This slidedeck shows you how Opsview can be used to monitor server temperature and also the temperature of individual components within a server (Memory, CPU and Hard drives).
SaltConf14 - Forrest Alvarez, Choice Hotels - Salt Formulas and StatesSaltStack
This session will expand your knowledge of cutting-edge techniques for creating Salt states and formulas. Users will obtain a thorough understanding of how states interact with pillars, as well as map.jinja files. We'll discuss how to make formulas OS agnostic and show how the usage of external pillars combined with a map file can result in formulas that are easy to explain, easy to learn, and easy to update.
Chef Provisioning a Chef Server Cluster - ChefConf 2015Chef
This talk is an exploration of how to build Chef Server 12 clusters with Chef Provisioning, including premium features like Chef Reporting and Chef Analytics. I will cover several new capabilities and tools in the Chef ecosystem that makes it easier than ever before to build and manage scalable Chef Server clusters.
https://youtu.be/HUQA1Ikm5Iw
Building a Production Grade PostgreSQL Cloud Foundry Service | anyninesanynines GmbH
Slides to the talk held at the Cloud Foundry Summit in Santa Clara 2016 about building a on-demand provisioning PostgreSQL Cloud Foundry Services being able to deploy dedicated PostgreSQL servers and 3-node-async-replicating clusters using Bosh.
The slides cover important design decisions such as single PostgreSQL server vs. PostgreSQL clusters, shared vs. dedicated PostgreSQL servers, pre-provisioning vs. on-demand provisioning of vms, the right choice of the automation technology as well as a draft of a resulting architecture.
Capistrano is an open source tool for running scripts on
multiple servers. Its main use is deploying web
applications including supporting tasks such as
changing databases.
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...SaltStack
Arnold gave this presentation at the Secure Linux Admin Conference in Berlin Germany. He provides an overview of what configuration management systems do, explains the fundamentals of SaltStack and provides a look inside.
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...SaltStack
Deployment is often omitted from configuration management and orchestration, which typically focuses on the infrastructure and not the core application that the infrastructure supports. This presentation will give an overview of a deployment system I wrote using SaltStack to provide immediately consistent deployment for software. The deployment system has the ability for manual deploys or for continuous deployments using a Heroku-like workflow. It has support for multiple deployment schemes, with a default of Git deployment. The deployment system uses a combination of Salt peer runner calls, runners, modules, returners, pillars and grains as well as a deployment host running Apache, Sartoris (a git-deploy frontend), and Redis (for reporting).
A revamped version of the Ansible intro talk from February 2015, brought up-to-date for the January Ansible meetup in Berlin.
Join our group: https://www.meetup.com/Ansible-Berlin
Ansible is tool for Configuration Management. The big difference to Chef and Puppet is, that Ansible doesn't need a Master and doesn't need a special client on the servers. It works completely via SSH and the configuration is done in Yaml.
These slides give a short introduction & motivation for Ansible.
A talk I gave at the recent Advanced AWS Meeup - this is a detailed guide to how I installed and set up Spinnaker to work with our infrastructure at Stitch Fix. I go over the various problems I ran into and how I solved them. I hope this can be useful for others setting up, or interested in setting up Spinnaker for their purposes.
**Big thanks to Armory for recording the talks! Video for this talk can be found here: https://youtu.be/ywzPblFpIE0 (I'm the second speaker)**
SaltConf 2014 keynote - Thomas Jackson, LinkedIn
Safety with Power tools
As infrastructure scales, simple tasks become increasingly difficult. For large infrastructures to be manageable, we use automation. But automation, like any power tool, comes with its own set of risks and challenges. Automation should be handled like production code, and great care should be exercised with power tools. This talk will cover how SaltStack is used at LinkedIn and offer tips and tricks for automating management with SaltStack at massive scale including a look at LinkedIn-inspired Salt features such as blacklist and pre-req states. It will also cover Salt master and minion instrumentation and a compilation of how not to use Salt.
Current session guides through Vagrant. Shows some tips and tricks and targeted to software developers.
Practical activities can be found here: https://github.com/akranga/devops-hackathon-1
A team's learnings from adopting devops and automating an otherwise labor-intensive server fleet. The bottom line: As with code, automated tests and CI are king.
This talk was held at Barcamp Salzburg in October 2016.
This slidedeck shows you how Opsview can be used to monitor server temperature and also the temperature of individual components within a server (Memory, CPU and Hard drives).
Connecting Field Operations and the Corporate Office - FME Server as a Near R...Safe Software
This presentation shows how Devon uses FME Server to pull, process, and write FLA (Field Logistics Application) trucking Logistics data to our Enterprise SDE Geodatabase in Near Real-Time using RESTful web services and how the data is being consumed by different groups of people throughout our business. The presentation will also focus on some of the challenges, benefits, and next steps that Devon has seen throughout the process.
The second part of the presentation illustrates how Devon uses FME to consolidate various data sources (both government and public) to help our emergency response and executive teams to make better and more informed decisions to minimize the destructive effects annual wildfires have on our community.
SeeTestAutomation - Mobile Test Automation Tool by ExperitestExperitest
Run the same test on different mobile devices and operating systems with a mobile test automation tool that allows test portability
• Perform mobile test automation using real devices and emulators
• Create a test on one device and run it on any other device model or operating system
• Increase coverage with full peripheral testing capabilities - GPS, Touch ID, camera and audio
• Start your mobile test automation quickly with a simple plug, record and play tool
• Enhance your mobile test automation by Integrating into all your major ALM environments
• Integrate with WebDriver (Selenium), HP UFT/QTP, JUnit, Microsoft Visual Studio and more
• Integrate with any continuous integration environment - HP Quality Center (ALM), Jenkins and more
Training Webinar: Detect Performance Bottlenecks of ApplicationsOutSystems
In this webinar we look at how to detect and troubleshoot server-side performance bottlenecks.
Free Online training: https://www.outsystems.com/learn/courses/
Follow us on Twitter http://www.twitter.com/OutSystemsDev
Like us on Facebook http://www.Facebook.com/OutSystemsDev
Training Webinar: Effective Platform Server MonitoringOutSystems
In this webinar we look at how to effectively implement good monitoring practices or your servers and applications.
Recorded webinar: https://www.outsystems.com/learn/courses/29/webinar-effective-platform-server-monitoring/
Free Online training: https://www.outsystems.com/learn/courses/
Follow us on Twitter http://www.twitter.com/OutSystemsDev
Like us on Facebook http://www.Facebook.com/OutSystemsDev
Oracle WebLogic Server 12c introduces RESTful Management Services, allowing anyone to query and monitor numerous Oracle WebLogic Server metrics from a multitude of programming languages, including mobiles devices. We also introduce a tool we've developed that supports mobile monitoring, management, and alerting of Oracle WebLogic Server and would like to share our architecture and design.
Cloudstack and Openstack are two of the most popular and successful cloud management platforms (CMP) . In the cloudstack meetup #15, the comparison of these platforms were shared.
Contents:
About the Program
Ekran Server & Management Tool
Database Management
Licensing
Client Installation
Monitoring Parameters
Client Protection
Advanced User Authentication
Notifying Users about Being Monitored
User Blocking
Viewing Sessions
Alerts
USB Monitoring
Dashboards
Interactive Monitoring
Reports
Capistrano deploy Magento project in an efficient waySylvain Rayé
Deploying a Magento project can be very a long and laborious task with some risks of errors. Having the good tool to prevent such a pain like Capistrano will help you to automatize such a process. Thanks such a tool you may deploy a release of your Magento project in less than 5 minutes.
Code testing and Continuous Integration are just the first step in a source code to production process. Combined with infrastructure-as-code tools such as Puppet the whole process can be automated, and tested!
My talk at QCon São Paulo 2010.
In that opportunity, I talked about possible uses of the "automatable" infrastructure provided by most cloud vendors (like Locaweb, Amazon and Rackspace).
Presentation at March 2019 Dutch Postgres User Group Meetup on lessons learnt while migrating from Oracle to Postgres, demo'ed via vagrant test environments and using generic pgbench datasets.
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPDana Luther
In this tutorial we will go over setting up a standard LEMP stack for development use and learn how to modify it to mimic your production/pre-production environments as closely as possible. We will go over how to switch from Nginx to Apache, upgrade PHP versions and introduce additional storage engines such as Redis to the equation. We'll also step through how to run both unit and acceptance suites using headless Selenium images in the stack. Leave here fully confident in knowing that whatever environment you get thrown into, you can replicate it and work in it comfortably.
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
Continuous Integration, with Apache Continuum or Jenkins, can be extended to fully manage deployments and production environments, running in Tomcat for instance, in a full Continuous Delivery cycle using infrastructure-as-code tools like Puppet, allowing to manage multiple servers and their configurations.
Puppet is an infrastructure-as-code tool that allows easy and automated provisioning of servers, defining the packages, configuration, services,... in code. Enabling DevOps culture, tools like Puppet help drive Agile development all the way to operations and systems administration, and along with continuous integration tools like Apache Continuum or Jenkins, it is a key piece to accomplish repeatability and continuous delivery, automating the operations side during development, QA or production, and enabling testing of systems configuration.
Traditionally a field for system administrators, Puppet can empower developers, allowing both to collaborate coding the infrastructure needed for their developments, whether it runs in hardware, virtual machines or cloud. Developers and sysadmins can define what JDK version must be installed, application server, version, configuration files, war and jar files,... and easily make changes that propagate across all nodes.
Using Vagrant, a command line automation layer for VirtualBox, they can also spin off virtual machines in their local box, easily from scratch with the same configuration as production servers, do development or testing and tear them down afterwards.
We will show how to install and manage Puppet nodes with JDK, multiple Tomcat instances with installed web applications, database, configuration files and all the supporting services. Including getting up and running with Vagrant and VirtualBox for quickstart and Puppet experiments, as well as setting up automated testing of the Puppet code.
The slides from my Deployment Tactics talk at the ThinkVitamin Code Management online conference (http://thinkvitamin.com/online-conferences/code-manage-deploy/).
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
This is the presentation given at the Symfony Live 2011 conference. It is an introduction to the new agile movement spreading in the technical operations community called DevOps and how to adopt it on web development projects, in particular Symfony projects.
Plan of the slides :
- Configuration Management
- Development VM
- Scripted deployment
- Continuous deployment
Tools presented in the slides:
- Puppet
- Vagrant
- Fabric
- Jenkins / Hudson
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...Amazon Web Services
Some of the best businesses today are deploying their code dozens of times a day. How? By making heavy use of automation, smart tools, and repeatable patterns to get process out of the way and keep the workflow moving. Come to this session to learn how you can do this too, using services such as AWS OpsWorks, AWS CloudFormation, Amazon Simple Workflow Service, and other tools. We'll discuss a number of different deployment patterns, and what aspects you need to focus on when working toward deployment automation yourself.
Similar to Control your deployments with Capistrano (20)
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
9. @rakodev
Why?
- Reliable deployment for a web application to
any number of machines simultaneously
- Rollback to previous deployment
- Add tasks (Flush caches, DB Update...)
- Automate common tasks
- ...
14. @rakodev
Create several stages
cap install STAGES=qa,production
mkdir -p config/deploy
create config/deploy.rb
create config/deploy/qa.rb
create config/deploy/production.rb
mkdir -p lib/capistrano/tasks
15. @rakodev
How does it work?
- Creates a new folder for each deployment
- Root directory of your web site will be linked
to the folder
- Also you will be able to create shared folders
or files as you wish, they will not be overwritten
/ no data loss
18. @rakodev
How Capistrano handles?
- No need to install Capistrano on the server
side
- Capistrano prepares the necessary
commands
- Capistrano runs the commands on the server
via ssh
19. @rakodev
config/deploy.rb (initial parameters)
set :application, 'phpist2014'
set :repo_url, 'git@github.com:rakodev/phpist2014.git'
set :deploy_to, '/var/www/phpist2014'
set :scm, :git
set :log_level, :info
set :keep_releases, 5
20. @rakodev
config/deploy/staging.rb (parameters)
role :app, %w{deployer@localhost}
role :web, %w{deployer@localhost}
role :db, %w{deployer@localhost}
server 'localhost', user: 'deployer', roles: %w{web app}
ask :branch, 'cap'
OR
set :branch, 'cap'
21. @rakodev
Which branch?
set :branch, 'master_dev'
OR
ask :branch, ‘my_default_branch’
During deploy, Capistrano will ask you which
branch you want to deploy:
Please enter branch (my_default_branch):
22. @rakodev
Only supports Git
At present Capistrano v3.0.x only supports Git.
It's just a matter of time until we support
Subversion, Mecurial, Darcs and friends again.
23. @rakodev
Task example
desc "Check that we can access everything"
task :check_write_permissions do
on roles(:all) do |host|
if test("[ -w #{fetch(:deploy_to)} ]")
info "#{fetch(:deploy_to)} is writable on #{host}"
else
error "#{fetch(:deploy_to)} is not writable on #{host}"
end
end
end
24. @rakodev
Another task
SSH agent forwarding is a technique you can use to make deploying to a remote server simpler for
you and your developers. It allows you to use you local SSH keys instead of leaving passphrase-less
keys sitting on your server.
# lib/capistrano/tasks/agent_forwarding.cap
desc "Check if agent forwarding is working"
task :forwarding do
on roles(:all) do |h|
if test("env | grep SSH_AUTH_SOCK")
info "Agent forwarding is up to #{h}"
else
error "Agent forwarding is NOT up to #{h}"
end
end
end
25. @rakodev
Output
cap staging forwarding
DEBUG [a9546519] Running /usr/bin/env env | grep SSH_AUTH_SOCK on
localhost
DEBUG [a9546519] Command: env | grep SSH_AUTH_SOCK
DEBUG [a9546519] SSH_AUTH_SOCK=/tmp/ssh-
S2osQUNMvN/agent.3067
DEBUG [a9546519] Finished in 0.108 seconds with exit status 0 (successful).
INFO Agent forwarding is up to localhost
26. @rakodev
Call a task
cap staging git:check
INFO [121f3c5c] Running /usr/bin/env mkdir -p /tmp/phpist2014/ on localhost
INFO [121f3c5c] Finished in 0.107 seconds with exit status 0 (successful).
INFO [cfdf0435] Running /usr/bin/env chmod +x /tmp/phpist2014/git-ssh.sh on localhost
INFO [cfdf0435] Finished in 0.003 seconds with exit status 0 (successful).
DEBUG [ac1cd356] Running /usr/bin/env git ls-remote -h git@github.com:rakodev/phpist2014.git on
localhost
DEBUG [ac1cd356] Finished in 7.553 seconds with exit status 0 (successful).
27. @rakodev
Deploy Workflow
When you run cap production deploy, it invokes the following tasks in
sequence:
deploy:starting - start a deployment, make sure everything is ready
deploy:started - started hook (for custom tasks)
deploy:updating - update server(s) with a new release
deploy:updated - updated hook
deploy:publishing - publish the new release
deploy:published - published hook
deploy:finishing - finish the deployment, clean up everything
deploy:finished - finished hook
28. @rakodev
Before / After
# call an existing task
before :starting, :ensure_user
after :finishing, :notify
# or define in block
before :starting, :ensure_user do
#
end
after :finishing, :notify do
#
end
29. @rakodev
Rollback Workflow
When you run cap production deploy:rollback, it invokes the following tasks in
sequence:
deploy:starting
deploy:started
deploy:reverting - revert server(s) to previous release
deploy:reverted - reverted hook
deploy:publishing
deploy:published
deploy:finishing_rollback - finish the rollback, clean up everything
deploy:finished
30. @rakodev
Specifying a role filter
You can set the role filter inside your deploy configuration.
For example, you can set the following inside
config/deploy.rb
set :filter, :roles => %w{app web}
On the command line
cap --roles=app,web production deploy
31. @rakodev
Specifying a host filter
You can set the host filter inside your deploy configuration.
For example, you can set the following inside
config/deploy.rb:
set :filter, :hosts => %w{server1 server2}
On the command line
cap --hosts=server1,server2 production deploy