Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apontini/mina-proteus
support for multiple apps and multiple stages for Mina using Hanami ruby framework
https://github.com/apontini/mina-proteus
deploy hanami mina multiapp multienvironment ruby
Last synced: 25 days ago
JSON representation
support for multiple apps and multiple stages for Mina using Hanami ruby framework
- Host: GitHub
- URL: https://github.com/apontini/mina-proteus
- Owner: apontini
- License: mit
- Created: 2019-05-16T10:43:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-13T14:40:22.000Z (over 5 years ago)
- Last Synced: 2024-04-29T09:42:25.539Z (8 months ago)
- Topics: deploy, hanami, mina, multiapp, multienvironment, ruby
- Language: Ruby
- Homepage: https://rubygems.org/gems/mina-proteus
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-hanami - mina-proteus - [Mina](https://github.com/mina-deploy/mina) plugin for Hanami than allows you to deploy a specific application in a specific environment. (Hanami Gem List / Deploy)
README
[![Gem Version](https://badge.fury.io/rb/mina-proteus.svg)](https://badge.fury.io/rb/mina-proteus) ![Gem](https://img.shields.io/gem/dt/mina-proteus.svg?color=brightgreen)
# Mina::Proteus
Plugin for Mina that adds support for multiple stages and multiple apps to Mina, specifically built for [Hanami ruby framework](https://hanamirb.org/).
This gem is based on [endoze's mina-multistage gem](https://github.com/endoze/mina-multistage), huge thanks to him!## Installation & Usage
Add this line to your application's Gemfile:
```rb
gem 'mina-proteus', require: false
```And then execute:
```shell
$ bundle install
```Or install it yourself as:
```shell
$ gem install mina-proteus
```Require `mina/proteus` in your `config/deploy.rb`:
```rb
# config/deploy.rbrequire 'mina/proteus'
require 'mina/bundler'
require 'mina/git'...
task setup: do
...
enddesc 'Deploys the current version to the server.'
task deploy: do
...
end
```
You then need to specify your hanami apps like this:```rb
# config/deploy.rbset :hanami_apps, %w(app1 app2 app3)
```That's the only required parameter, optional parameters are:
```rb
# config/deploy.rbset :stages, %w(staging production) #specify your stages
set :stages_dir, 'config/deploy' #specify which directory will have all the configurations files
set :default_stage, 'staging' #specify your default stage#this is used to deploy a single application in a specific environment
set :bundle_prefix, -> { %{HANAMI_ENV="#{fetch(:current_stage)}" HANAMI_APPS="#{fetch(:current_app)}" #{fetch(:bundle_bin)} exec} }
```
Note that `current_stage` and `current_app` are respectively the stage and the application being called.Then to create every file run:
```shell
$ bundle exec mina proteus:init
```This will create `config/deploy/staging.rb` and `config/deploy/production.rb` stage files and
`config/deploy/staging/app1.rb`, `config/deploy/staging/app1.rb`, etc.
Use them to define stage and app specific configuration.Now you can deploy the default stage with:
```shell
$ mina deploy # this deploys to :default_stage
```Or specify a stage explicitly:
```shell
$ mina staging deploy
$ mina production deploy
```# Maintenance and Contribution
I'll be rarely maintaining this source code due to lack of time, but i will do as much as i can to resolve any open issues.
If you want to contribute, feel free to fork it, branch it and to create a pull request.