This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 1st, 2012  |  syntax: None  |  size: 0.79 KB  |  views: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Passing parameters to Capistrano
  2. git clone johndoe@gitsrv.domain:app
  3. cd app
  4. git checkout r2s1
  5.        
  6. desc "Parameter Testing"
  7. task :parameter do
  8.   puts "Parameter test #{configuration[:branch]} #{configuration[:tag]}"
  9. end
  10.        
  11. cap test:parameter -s branch=master -s tag=1.0.0
  12.        
  13. desc "Parameter Testing"
  14. task :parameter do
  15.   system("whoami", user)
  16.   puts "Parameter test #{user} #{configuration[:branch]} #{configuration[:tag]}"
  17. end
  18.        
  19. $ GIT_REPO="johndoe@gitsrv.domain:app" GIT_BRANCH="r2s1" cap testing
  20.        
  21. #deploy.rb:
  22. task :testing, :roles => :app do
  23.   puts ENV['GIT_REPO']
  24.   puts ENV['GIT_BRANCH']
  25. end
  26.        
  27. # deploy from git repo
  28. set :repository, "git@git.mygitserver.com:mygitrepo.git"
  29. # tells cap to use git
  30. set :scm, :git
  31.        
  32. set :repository, "#{scm_user}@gitsrv.domain:app"
  33.        
  34. set :scm_user, 'someuser'
clone this paste RAW Paste Data