Capistrano::Exfel
Deploys Ruby on Rails Applications in EuXFEL VMs using Capistrano3 throw username/password authentication.
The standard EuXFEL VMs for web applications is Ubuntu 22 with Apache web server.
Installation of Phusion Passenger and RVM are also required to this gem.
Installation
Add these lines to your application's Gemfile:
# Use Capistrano for deployment
gem 'capistrano', '3.18.1', require: false
gem 'capistrano-exfel', '0.5.1', require: false
gem 'capistrano-rails', '1.6.3', require: false
gem 'capistrano-rvm', '0.1.2', require: false
And then execute:
$ bundle
Or install it yourself as:
$ gem install capistrano-exfel
Usage
Add this line to your Capfile
for Ubuntu 22 machines:
# Load Ubuntu 14 tasks
require 'capistrano/exfel/ubuntu22'
This gem will reuse capistrano-rails
and capistrano-rvm
tasks to build the following tasks:
Task application:deploy_first_time:
# Task 'application:deploy_first_time' deploys an application for the first time in the configured server(s).
# This task besides deploying the application also make all the necessary configurations
# Description: Configures Apache and deploys the Application for the first time in the configured server(s)
# with the right permissions:
cap application:deploy_first_time
Task application:deploy:
# Task 'application:deploy' deploys a new version of the application in the configured server(s)
# Description: Re-deploys existent Application in the configured server(s):
cap application:deploy
Task application:restart:
# Description: 'Restarts the application, including reloading server cache'
cap application:restart
Task application:reconfigure_apache:
# Description: 'Re-deploys apache configuration files and restart it'
cap application:reconfigure_apache
Task application:show_variables:
# Description: 'Shows variables values generated without deploying anything'
cap application:show_variables
Additional Tasks:
# See all the additional available tasks using the command:
cap -T
The most important configurable options and their defaults:options can be added to the deploy.rb
file:
set :username, ask('username', proc { `whoami`.chomp }.call)
set :password, ask('password', nil, echo: false)
set :app_name, 'my_app_name'
set :repo_url, 'exfl_git_server:/my_app_repo_path'
set :rvm_ruby_version, '3.1.3'
As an example, to configure GIT plugin, add the following to the Capfile:
require 'capistrano/scm/git'
install_plugin Capistrano::SCM::Git
Contributing
- Fork it ( https://github.com/luismaia/capistrano-exfel/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request