capistrano-exfel 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +81 -7
- data/lib/capistrano/exfel/version.rb +1 -1
- data/lib/capistrano/tasks/application.rake +24 -57
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac8d8376221fd414caea1a171e504075556f32cc
|
4
|
+
data.tar.gz: d9429c9efd767346e59382e5d8148d1f5cbd43a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59c1cfb6de84e62176ad49aa96146da98047248d526238226b107ad4b735571e84f794b78dd2894da66cd1d17418d9269ee60b5b040dee8bf0f9a3ea39ab8d00
|
7
|
+
data.tar.gz: f46b46e8aaee29436f38bdc6e10052bb4cd4d234ecd9cd14c6febb585265d30c4042f6aee6f86b0e35522f22500c4c1a8f49fb5f512baf2f99009955babf859a
|
data/README.md
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
# Capistrano::Exfel
|
2
2
|
|
3
|
-
|
3
|
+
Deploys Ruby on Rails 4 Applications in EXFEL VMs using Capistrano3 throw username/password authentication.
|
4
|
+
The standard EXFEL VMs consist of Scientific Linux 6 with Apache.
|
5
|
+
Installation of Phusion Passenger and RVM are also required to this gem.
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
7
|
-
Add
|
9
|
+
Add these lines to your application's Gemfile:
|
8
10
|
|
9
|
-
|
10
|
-
gem 'capistrano
|
11
|
-
|
11
|
+
# Use Capistrano for deployment
|
12
|
+
gem 'capistrano', '~> 3.4.0'
|
13
|
+
gem 'capistrano-rails', '~> 1.1.2'
|
14
|
+
gem 'capistrano-rvm', '~> 0.1.2'
|
15
|
+
gem 'capistrano-exfel', '~> 0.0.1'
|
12
16
|
|
13
17
|
And then execute:
|
14
18
|
|
@@ -20,11 +24,81 @@ Or install it yourself as:
|
|
20
24
|
|
21
25
|
## Usage
|
22
26
|
|
23
|
-
|
27
|
+
Add this line to your `Capfile`:
|
28
|
+
|
29
|
+
# Load Capistrano Exfel Scientific Linux 6 tasks
|
30
|
+
require 'capistrano/exfel/sl6'
|
31
|
+
|
32
|
+
This gem will reuse `capistrano-rails` and `capistrano-rvm` tasks to build the following tasks:
|
33
|
+
|
34
|
+
# Task 'application:deploy_first_time' deploys an application for the first time in the configured server(s).
|
35
|
+
# This task besides deploying the application also make all the necessary configurations
|
36
|
+
# Description: Re-deploys existent Application in the configured server(s):
|
37
|
+
cap application:deploy
|
38
|
+
|
39
|
+
# Task 'application:deploy' deploys a new version of the application in the configured server(s)
|
40
|
+
# Description: Configures Apache and deploys the Application for the first time in the configured server(s)
|
41
|
+
# with the right permissions:
|
42
|
+
cap application:deploy_first_time
|
43
|
+
|
44
|
+
# Description: 'Restarts the application, including reloading server cache'
|
45
|
+
cap application:restart
|
46
|
+
|
47
|
+
# Description: 'Re-deploys apache configuration files and restart it'
|
48
|
+
cap application:reconfigure_apache
|
49
|
+
|
50
|
+
# Description: 'Shows variables values generated without deploying anything'
|
51
|
+
cap application:show_variables
|
52
|
+
|
53
|
+
#
|
54
|
+
# See all the additional available tasks using the command:
|
55
|
+
cap -T
|
56
|
+
|
57
|
+
The most important configurable options and their defaults:options can be added to the `deploy.rb` file:
|
58
|
+
|
59
|
+
# Set username and password
|
60
|
+
set :username, ask('username', 'maial') # If not specified will present current user
|
61
|
+
set :password, ask('password', nil, echo: false) # If not specified will ask for it
|
62
|
+
|
63
|
+
# Application Name
|
64
|
+
set :app_name, 'my_app_name' # If not specified will ask for it
|
65
|
+
|
66
|
+
# Set application related information
|
67
|
+
# set :app_domain, 'https://in.xfel.eu/'
|
68
|
+
# set :app_name_uri, 'my_app_uri'
|
69
|
+
|
70
|
+
# Set git repository information
|
71
|
+
set :repo_url, 'exflgit:/data/git/calibration' # 'git@example.com:me/my_repo.git'
|
72
|
+
|
73
|
+
# Default branch is :master
|
74
|
+
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
|
75
|
+
|
76
|
+
# Default value for :scm is :git
|
77
|
+
# set :scm, :git
|
78
|
+
|
79
|
+
# Default value for :format is :pretty
|
80
|
+
# set :format, :pretty
|
81
|
+
|
82
|
+
# Default value for :log_level is :debug
|
83
|
+
# set :log_level, :info
|
84
|
+
|
85
|
+
# Default value for :linked_files is []
|
86
|
+
# set :linked_files, %w(config/database.yml config/secrets.yml)
|
87
|
+
|
88
|
+
# Default value for linked_dirs is []
|
89
|
+
# set :linked_dirs, %w(bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system)
|
90
|
+
|
91
|
+
# Default value for keep_releases is 5
|
92
|
+
# set :keep_releases, 5
|
93
|
+
|
94
|
+
# RVM related information
|
95
|
+
# set :rvm_type, :system
|
96
|
+
set :rvm_ruby_version, '2.1.5' # If not specified will ask for it
|
97
|
+
# set :rvm_roles, [:app, :web]
|
24
98
|
|
25
99
|
## Contributing
|
26
100
|
|
27
|
-
1. Fork it ( https://github.com/
|
101
|
+
1. Fork it ( https://github.com/luismaia/capistrano-exfel/fork )
|
28
102
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
103
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
104
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -1,73 +1,40 @@
|
|
1
|
-
####################################################################################################
|
2
|
-
#
|
3
|
-
# Capistrano Important Tasks
|
4
|
-
#
|
5
|
-
#####################################################################################################
|
6
|
-
#
|
7
|
-
# See all available tasks
|
8
|
-
# cap -T
|
9
|
-
|
10
|
-
# To deploy a new server with capistrano execute:
|
11
|
-
# cap [development|test|production] application:deploy_first_time
|
12
|
-
|
13
|
-
# To deploy the application, including assets compilation:
|
14
|
-
# cap [development|test|production] application:deploy
|
15
|
-
|
16
|
-
# To restart the application, including reloading server cache:
|
17
|
-
# cap [development|test|production] application:restart
|
18
|
-
|
19
|
-
####################################################################################################
|
20
|
-
#
|
21
|
-
# Capistrano Internal Tasks
|
22
|
-
#
|
23
|
-
#####################################################################################################
|
24
|
-
#
|
25
|
-
# To execute db seed (can only be executed once... to add default roles and users):
|
26
|
-
# cap [development|test|production] db:seed
|
27
|
-
|
28
|
-
# To restart Apache:
|
29
|
-
# cap [development|test|production] deploy:restart_apache
|
30
|
-
|
31
|
-
# To execute rake commands:
|
32
|
-
# cap [development|test|production] util:runrake task=secret
|
33
|
-
|
34
1
|
# XFEL application specific tasks
|
35
2
|
namespace :application do
|
36
|
-
# Task 'application:
|
37
|
-
|
38
|
-
|
3
|
+
# Task 'application:deploy_first_time' deploys an application for the first time in the configured server(s).
|
4
|
+
# This task besides deploying the application also make all the necessary configurations
|
5
|
+
desc 'Configures Apache and deploys the Application for the first time in the configured server(s) '/
|
6
|
+
'with the right permissions'
|
7
|
+
task :deploy_first_time do
|
39
8
|
on roles(:app, :web) do
|
40
9
|
info '#' * 100
|
41
|
-
info '#' * 10 + ' => Start
|
10
|
+
info '#' * 10 + ' => Start Application first time deployment...'
|
42
11
|
info '#' * 100
|
43
12
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
invoke '
|
48
|
-
|
13
|
+
invoke 'app_home:create_all'
|
14
|
+
invoke 'database:configure_mysql'
|
15
|
+
invoke 'secrets:configure'
|
16
|
+
invoke 'apache:configure_and_start'
|
17
|
+
invoke 'apache:check_write_permissions'
|
49
18
|
invoke :deploy
|
19
|
+
invoke 'app_home:correct_shared_permissions'
|
50
20
|
invoke 'application:restart'
|
51
21
|
end
|
52
22
|
end
|
53
23
|
|
54
|
-
# Task 'application:
|
55
|
-
|
56
|
-
|
57
|
-
task :deploy_first_time do
|
24
|
+
# Task 'application:deploy' deploys a new version of the application in the configured server(s)
|
25
|
+
desc 'Re-deploys existent Application in the configured server(s)'
|
26
|
+
task :deploy do
|
58
27
|
on roles(:app, :web) do
|
59
28
|
info '#' * 100
|
60
|
-
info '#' * 10 + ' => Start
|
29
|
+
info '#' * 10 + ' => Start Application re-deployment...'
|
61
30
|
info '#' * 100
|
62
31
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
invoke 'secrets:
|
67
|
-
|
68
|
-
invoke 'apache:check_write_permissions'
|
32
|
+
# This is advisable to kill users cookies after the upgrade.
|
33
|
+
# The consequence is that users will be logged out automatically from the Application after the upgrade.
|
34
|
+
# This is important to avoid errors with old validity_token in forms
|
35
|
+
invoke 'secrets:update_app_secret'
|
36
|
+
|
69
37
|
invoke :deploy
|
70
|
-
invoke 'app_home:correct_shared_permissions'
|
71
38
|
invoke 'application:restart'
|
72
39
|
end
|
73
40
|
end
|
@@ -80,13 +47,13 @@ namespace :application do
|
|
80
47
|
invoke 'app_home:deploy_success_msg'
|
81
48
|
end
|
82
49
|
|
83
|
-
desc '
|
50
|
+
desc 'Re-deploys apache configuration files and restart it'
|
84
51
|
task :reconfigure_apache do
|
85
52
|
invoke 'apache:configure'
|
86
53
|
invoke 'application:restart'
|
87
54
|
end
|
88
55
|
|
89
|
-
desc '
|
56
|
+
desc 'Shows variables values generated without deploying anything'
|
90
57
|
task :show_variables do
|
91
58
|
on roles(:app, :web) do
|
92
59
|
info '#' * 100
|
@@ -203,7 +170,7 @@ namespace :load do
|
|
203
170
|
|
204
171
|
# RVM related information
|
205
172
|
set :rvm_type, -> { :system }
|
206
|
-
|
173
|
+
set :rvm_ruby_version, -> { ask('Please specify the Ruby version (i.e. 2.1.5)', '') }
|
207
174
|
set :rvm_roles, [:app, :web]
|
208
175
|
# set :rvm_custom_path, '~/.myveryownrvm' # only needed if not detected
|
209
176
|
|