CAPISTRANO

355 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
355
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

CAPISTRANO

  1. 1. CAPISTRANO Bambang Andrie Gunawan MT: @andrie Tw: @andriebamz Ansvia ES
  2. 2. What Is Capistrano?
  3. 3. What Is Capistrano? Capistrano is an open source tool for running scripts on multiple servers and it's main use is deploying web applications. ➔ ➔ Written in the Ruby language and is distributed using the RubyGems distribution channel. It is implemented primarily for use on the bash command line. The main functionality of the Capistrano is to Deploy the rails application which you have already written.
  4. 4. Why Use Capistrano?
  5. 5. Why Use Capistrano? ● Great for deploying any application, not just Rails ● Great for probing multiple servers quickly ● Automatic long task
  6. 6. How Do I Install It?
  7. 7. How Do I Install It? Capistrano is actually comprised of the Capistrano gem. For Linux Ubuntu:
  8. 8. Capistrano Deployment
  9. 9. Capistrano Deployment Capistrano reads its instructions from Capfile (for those of you familiar with the “make” or “rake” utilities, the concept is the same as a “makefile” or “rakefile”). If you create a file called Capfile, Capistrano will read that file and process the instructions in it. The Capfile is where you will tell Capistrano about the servers you want to connect to and the tasks you want to perform on those servers. It is essentially just a Ruby script.
  10. 10. Capistrano Deployment When we need to Deploy? Whenever we make any changes in any of the components or files which are part of the repository (like SVN, GIT) then we need to publish it.
  11. 11. Capistrano Deployment Example Script This defines a single task, called “search_libs”, and says that it should be executed only on the “domain” host. When executed, it will display all files and subdirectories in /usr/lib that include the text “xml” in their name. By default, “run” will display all output to the console. Assuming your capfile is in the current directory, you would execute that task like this (from the command-line):
  12. 12. Capistrano Deployment Multiple servers
  13. 13. Capistrano Deployment Multiple roles
  14. 14. Capistrano Deployment Documenting Tasks Capistrano tasks can be considered to be self-documenting, there are a couple of Rakeinspired ways to get a list of all the tasks Capistrano can run for a given installation: If you were to add a task without a description, it would not be shown in this list, except the verbose version:
  15. 15. Capistrano Deployment Reference https://github.com/capistrano/capistrano/wiki/2.x-Getting-Started Job@mindtalk.com
  16. 16. Thank You :)

×