Giter Site home page Giter Site logo

chihsiang / mina-multistage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from endoze/mina-multistage

0.0 2.0 0.0 24 KB

Plugin for Mina that adds support for multiple stages.

Home Page: https://endoze.github.io/mina-multistage/

License: MIT License

Ruby 100.00%

mina-multistage's Introduction

Gem Version Stories in Ready

Mina::Multistage

Plugin for Mina that adds support for multiple stages.

Installation & Usage

Add this line to your application's Gemfile:

gem 'mina-multistage', require: false

And then execute:

$ bundle

Or install it yourself as:

$ gem install mina-multistage

Require mina/multistage in your config/deploy.rb:

require 'mina/multistage'
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'

...

task setup: :environment do
  ...
end

desc 'Deploys the current version to the server.'
task deploy: :environment do
  ...
end

Then run:

$ bundle exec mina multistage:init

This will create config/deploy/staging.rb and config/deploy/production.rb stage files. Use them to define stage specific configuration.

# config/deploy/staging.rb
set :domain, 'example.com'
set :deploy_to, '/var/www/my_app'
set :repository, 'https://github.com/user/repo'
set :branch, 'master'
set :user, 'www'
set :rails_env, 'staging'

If you receive the following error, make sure that you've required 'mina/multistage' in your config/deploy.rb

$ bundle exec mina multistage:init
mina aborted!
Don't know how to build task 'multistage:init'

Now you can deploy the default stage with:

$ mina deploy # this deploys staging by default

Or specify a stage explicitly:

$ mina staging deploy
$ mina production deploy

Configuration

  • stages - array of stages names, the default is the name of all *.rb files from stages_dir
  • stages_dir - stages files directory, the default is config/deploy
  • default_stage - default stage, the default is staging

If you want to override the default values for any of these options, they should be set before requiring mina/multistage.

# config/deploy.rb

set :stages, %w(development test staging production)
set :stages_dir, 'config/deploy_stages'
set :default_stage, 'development'

require 'mina/multistage'
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'

...

task setup: :environment do
  ...
end

desc 'Deploys the current version to the server.'
task deploy: :environment do
  ...
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

mina-multistage's People

Contributors

endoze avatar joker-hsiang avatar fahchen avatar waffle-with-pears avatar

Watchers

James Cloos avatar Auli.Chan 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.