Capistrano 3 change ssh_options inside task

后端 未结 2 915
既然无缘
既然无缘 2020-12-18 06:38

I trying to run capistrano v.3 task in same stage with diferent ssh_options.

my production.rb say:

set :stag         


        
2条回答
  •  Happy的楠姐
    2020-12-18 07:26

    Answer of @activars didn't work for me. Because when I defined several roles for one environment - only one was deployed :(

    So my solution was to create several enviroments, e.g. production.rb and productionroot.rb.

    productionroot has content with no_release=true flag - just as you've specified:

    server '146.120.89.81', user: 'root', roles: %w{foo_role}, no_release: true
    

    After that I've created sh script which runs

    #/usr/bin/env bash
    bundle exec cap production deploy
    bundle exec cap productionroot deploy
    

提交回复
热议问题