Upgrade to Pro — share decks privately, control downloads, hide ads and more …

capistrano.pdf

Thiện
February 22, 2016

 capistrano.pdf

Thiện

February 22, 2016
Tweet

More Decks by Thiện

Other Decks in Education

Transcript

  1. Deploying PHP with Capistrano About me Thien Tran Duy PHP

    developer since 2012 User 571 on phalconphp.com Loves open source development Open Company [email protected] November 9, 2015 (Meetup PHP) Capistrano November 9, 2015 1 / 7
  2. PHP Summary There are many tool auto deploy applications. And

    each tools have special features, which could easy install, documentations, easy custom or anything else. In this topic we will discussion the tool Capistrano. 1 What is a Capistrano 2 How to Install Capistrano 3 Why using Capistrano 4 Conclusions (Meetup PHP) Capistrano November 9, 2015 2 / 7
  3. The two Section Information What is Capistrano? Capistrano is a

    remote server automation tool. 1 Reliably deploy web application to any number of machines simultaneously, in sequence or as a rolling set (Meetup PHP) Capistrano November 9, 2015 3 / 7
  4. The two Section Information What is Capistrano? Capistrano is a

    remote server automation tool. 1 Reliably deploy web application to any number of machines simultaneously, in sequence or as a rolling set 2 To automate audits of any number of machines (checking login logs, enumerating uptimes, and/or applying security patches) (Meetup PHP) Capistrano November 9, 2015 3 / 7
  5. The two Section Information What is Capistrano? Capistrano is a

    remote server automation tool. 1 Reliably deploy web application to any number of machines simultaneously, in sequence or as a rolling set 2 To automate audits of any number of machines (checking login logs, enumerating uptimes, and/or applying security patches) 3 To script arbitrary workflows over SSH (Meetup PHP) Capistrano November 9, 2015 3 / 7
  6. The two Section Information What is Capistrano? Capistrano is a

    remote server automation tool. 1 Reliably deploy web application to any number of machines simultaneously, in sequence or as a rolling set 2 To automate audits of any number of machines (checking login logs, enumerating uptimes, and/or applying security patches) 3 To script arbitrary workflows over SSH 4 To drive infrastructure provisioning tools such as chef-solo, Ansible or similar. (Meetup PHP) Capistrano November 9, 2015 3 / 7
  7. Install Install and prepare In order to install Capistrano you

    will need Ruby and RubyGems installed on your computer. gem install capistrano Prepare your Project for Capistrano cd you-app && cap install (Meetup PHP) Capistrano November 9, 2015 4 / 7
  8. Usage To take look structure: # l s −l a

    lrwxrwxrwx 1 root root 60 Nov 6 23:32 c u r r e n t −> / usr / share / nginx / html /phanbook . d e v e l / r e l e a s e s /20151107043154 drwxr−xr−x 5 root root 4096 Nov 6 23:32 r e l e a s e s drwxr−xr−x 7 root root 4096 Nov 6 22:11 repo −rw−r−−r−− 1 root root 222 Nov 6 23:32 r e v i s i o n s . log drwxr−xr−x 3 root root 4096 Nov 6 22:32 shared 1 current: is a symlink pointing to the latest release. 2 releases: holds all deployments in a timestamped folder. 3 repo: holds the version control system configured. 4 revisions.log: is used to log every deploy or rollback 5 share: contains the linked files and linked dirs which are symlinked into each release. (Meetup PHP) Capistrano November 9, 2015 4 / 7
  9. Usage Install and prepare In your a deploy.rb file, let

    is enter the name of your app in the first line. If your apps name is phanbook and repo on github, it look like: s e t : a p p l i c a t i o n , ’ phanbook ’ s e t : repo url , ’ git@github . com : phanbook/phanbook . g i t ’ s e t : a p p l i c a t i o n , ’ phanbook ’ s e t : repo url , ’ git@github . com : phanbook/phanbook . g i t ’ s e t : deploy to , ’ / usr / share / nginx / html /phanbook . d e v e l ’ # how many old r e l e a s e s do we want to keep s e t : keep r e l e a s e s , 5 # Default value f o r : scm i s : g i t s e t : scm , : g i t s e t : branch , ’ master ’ To verify configuration capistrano, just running command below cap development deploy : check (Meetup PHP) Capistrano November 9, 2015 5 / 7
  10. Conclusion In conclusion In the content above I have for

    give you some information about Capistrano, I would suggest you to read the documents at Capistrano. Are you using Capistrano or planning to use them? I would love to hear your opinion on the subject. (Meetup PHP) Capistrano November 9, 2015 6 / 7