Advertisement
Guest User

Untitled

a guest
Aug 1st, 2012
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  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'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement