Giter Site home page Giter Site logo

mina-multideploy's Introduction

Mina multideploy

A useful tool for parallel deployment on multiple servers with mina.

How it works

How it works

This gem will help you to deploy the application on multiple servers simultaneously. It takes original mina deploy.rb file, changes application_name, domain and starts the deployment process.

Installation

Add this line to your application's Gemfile:

gem 'mina-multideploy', '~> 1.1.0'

And then execute:

bundle install

Or install it yourself as:

gem install mina-multideploy

Getting Started

Start by generating a configuration file:

bundle exec rails multideploy:init

It should give you a file in:

config/initializers/multideploy.rb

It should look something like this:

return unless defined? Mina::Multideploy

Mina::Multideploy.configure do |config|
  config.servers = {}
  # Default velues
  # config.original = 'config/deploy.rb'
  # config.w_dir = 'tmp/deploy'
end

Configuration

servers - hash at format domain => array of application_name's.

Example:

config.servers = {
  '84.155.207.209' => %w[carghana caryange cartanzania]
  '105.87.69.69'   => %w[poster]
  '48.84.207.183'  => %w[codica timebot]
}

It means that your code will be deployed to 3 servers, and there can be several applications on one server.

original - path to the original mina deploy.rb file which will be taken as a basic.

w_dir - path to directory where temoporary files and logs will be created.

Available features

After you have configured servers at config/initializers/multideploy.rb you can start deploying in two ways.

Semi-automatic deploy (recommended for first deploy)

Run this command:

bundle exec rails multideploy:prepare

You will get file servers_deploy.rb at working directory (tmp/deploy by default). Check it and run ruby ./tmp/deploy/server_deploy.rb.

Automatic deploy

Run this command:

bundle exec rails multideploy:start

It will make the same as multideploy:prepare, but the deployment will start automatically.

Runing mina or rake tasks

Use command as argument for multideploy:run

bundle exec rails "multideploy:run[rake[db:migrate]]"

Additional information

  • all scripts are updated according config file before launch multideploy:prepare and multideploy:start
  • add public SSH key, so you can login to server without password. Run ssh-copy-id user@$host

License

mina-multideploy is Copyright © 2015-2019 Codica. It is released under the MIT License.

About Codica

Codica logo

mina-multideploy is maintained and funded by Codica. The names and logos for Codica are trademarks of Codica.

We love open source software! See our other projects or hire us to design, develop, and grow your product.

mina-multideploy's People

Contributors

volkov-sergey avatar rostislavkor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.