Passing parameters to Capistrano

前端 未结 5 780
感情败类
感情败类 2021-01-31 16:44

I\'m looking into the possibility of using Capistrano as a generic deploy solution. By \"generic\", I mean not-rails. I\'m not happy with the quality of the documentation I\'m f

5条回答
  •  Happy的楠姐
    2021-01-31 17:10

    I'd suggest to use ENV variables.

    Somethings like this (command):

    $ GIT_REPO="johndoe@gitsrv.domain:app" GIT_BRANCH="r2s1" cap testing
    

    Cap config:

    #deploy.rb:
    task :testing, :roles => :app do
      puts ENV['GIT_REPO']
      puts ENV['GIT_BRANCH']
    end
    

    And take a look at the https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension, may be this approach will be useful for you as well.

提交回复
热议问题