Set default stage with Capistrano 3

后端 未结 5 1915
心在旅途
心在旅途 2021-02-05 03:26

Is there a way to set a default stage in Capistrano 3?

I\'ve tried putting set :stage, :production inside deploy.rb but that didn\'t work, it gives the erro

5条回答
  •  感动是毒
    2021-02-05 03:55

    The old solution works for me in Capistrano 3:

    cap --version
    #=> Capistrano Version: 3.3.5 (Rake Version: 10.4.2)
    

    At the very top of the Capfile after these lines

    # Load DSL and Setup Up Stages
    require 'capistrano/setup'
    

    add:

    set :stage, :production
    

    and then run you task as usual without the stage specified:

    cap foo:bar
    

提交回复
热议问题