本文介绍了使用Mina部署子目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过Mina部署仓库的子目录?我见过有人使用Capistrano使用自定义部署策略来实现这一目标,而我希望能够通过Mina来实现。

Is there a way to deploy a subdirectory of the repo through Mina? I've seen people using custom deploy strategy to achieve this with Capistrano and I would like to be able to do it with Mina.

推荐答案

我能够通过将许多setp包装在 in_directory'./rails'do end 这样的代码块(我的rails应用程序位于 rails 目录下):

I was able to fix this by wrapping a number of the setps in a in_directory './rails' do end block like this (my rails app is under the rails directory):

task :deploy => :environment do
  deploy do
    # stop accepting new workers
    invoke :'sidekiq:quiet'

    # Put things that will set up an empty directory into a fully set-up
    # instance of your project.
    invoke :'git:clone'
    in_directory './rails' do
      invoke :'deploy:link_shared_paths'
      invoke :'bundle:install'
      invoke :'rails:db_migrate'
      invoke :'deploy:cleanup'
    end

    to :launch do
      in_directory './rails' do
        #invoke :'sidekiq:restart'
        invoke :'unicorn:restart'
      end
    end
  end
end

这篇关于使用Mina部署子目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-08 00:56