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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29182346107c7a5c7bcaabf4698dbb6c84dda129
4
- data.tar.gz: c0291a197ccb9aa843dd3869dc9ef9ad790865bf
3
+ metadata.gz: ac8d8376221fd414caea1a171e504075556f32cc
4
+ data.tar.gz: d9429c9efd767346e59382e5d8148d1f5cbd43a5
5
5
  SHA512:
6
- metadata.gz: d97ad3f520a63a0447ce58b14bcd746ec87a942b1c6891b3a89391cafd1feea638084bdda1a7d283b22ff0c43e4e9ddb6617ebef4f9094cfa37fdfc5213182a7
7
- data.tar.gz: f17164547d6601a7f4f9367af96eb8f55e5bcb73cfcd3a7cdfa6bb8f7ce0ba3c29bf54452f28542000a657f3600dbcdfbbab4effd03c3e5569c1c03e8f2be8f1
6
+ metadata.gz: 59c1cfb6de84e62176ad49aa96146da98047248d526238226b107ad4b735571e84f794b78dd2894da66cd1d17418d9269ee60b5b040dee8bf0f9a3ea39ab8d00
7
+ data.tar.gz: f46b46e8aaee29436f38bdc6e10052bb4cd4d234ecd9cd14c6febb585265d30c4042f6aee6f86b0e35522f22500c4c1a8f49fb5f512baf2f99009955babf859a
data/README.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # Capistrano::Exfel
2
2
 
3
- TODO: Write a gem description
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 this line to your application's Gemfile:
9
+ Add these lines to your application's Gemfile:
8
10
 
9
- ```ruby
10
- gem 'capistrano-exfel'
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
- TODO: Write usage instructions here
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/[my-github-username]/capistrano-exfel/fork )
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,6 +1,6 @@
1
1
  module Capistrano
2
2
  # Capistrano::Exfel version information
3
3
  module Exfel
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
6
6
  end
@@ -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:deploy' deploys a new version of the application in the specified server
37
- desc 'Re-deploy existent Application in the specified server'
38
- task :deploy do
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 subsequents times deploy...'
10
+ info '#' * 10 + ' => Start Application first time deployment...'
42
11
  info '#' * 100
43
12
 
44
- # This is advisable to kill users cookies after the upgrade.
45
- # The consequence is that users will be logged out automatically from the Application after the upgrade.
46
- # This is important to avoid errors with old validity_token in forms
47
- invoke 'secrets:update_app_secret'
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:deploy_first_time' deploys an application for the first time in the specified server.
55
- # This task besides deploying the application also make all the necessary configurations
56
- desc 'Deploy Application for the first time in the specified server'
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 first time deploy...'
29
+ info '#' * 10 + ' => Start Application re-deployment...'
61
30
  info '#' * 100
62
31
 
63
- invoke 'app_home:create_all'
64
- invoke 'haproxy:configure_and_start' # This should go to Puppet
65
- invoke 'database:configure_mysql'
66
- invoke 'secrets:configure'
67
- invoke 'apache:configure_and_start'
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 'Restarts the application, including reloading server cache'
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 'Show variables values without deploying'
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
- # set :rvm_ruby_version, '2.1.2'
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-exfel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Maia