deploy_mate 0.14 → 0.15

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: 15a9544626e2d3662f301c7739e88022fde3d2cd
4
- data.tar.gz: cc4b0b975dd655a93e2e29374808e314ee4d5b88
3
+ metadata.gz: 010748fec2c76a90ba7f99433ee1f5045980f40f
4
+ data.tar.gz: 4b5007ee4f0fcd32c37d0053a95e28d9935fb3bd
5
5
  SHA512:
6
- metadata.gz: 383702d8e2a8ca71022b6342d8667a603aea52387cea5054582b06a7e1d9efb59c70b353799c798caeb9cb0d4c4dc66a68ca5bc67873d78f2b42ae038a7e978e
7
- data.tar.gz: 1a0b558d4bd030b35f4343ddc61bab97e00eb03eb63d4f1012066fe46566a9265127aaf5a77ea80e2b86091dacb753bf61206fd7294b16faae2351588256b257
6
+ metadata.gz: cafffbfdaec1aad29f7cedbeff29878d94e1fc67864eda988a75d03f5741bdc08437fef20a28d8857968b21223af752a9bd43974c0c15e1e07dc381a1d6cc854
7
+ data.tar.gz: 1b5a3e7443df511271b70be63c40b49e0617131ffc5261940c012383420e5264e2912818249b5e0c52b1f7b3a19a79d55295355a7a0d148b42b8db18b9018644
data/README.md CHANGED
@@ -9,6 +9,7 @@ The resulting server will work with this setup:
9
9
  - Unicorn Rack App Server (http://unicorn.bogomips.org/)
10
10
  - Bluepill Process Monitoring (https://github.com/bluepill-rb/bluepill)
11
11
  - RVM as user-install (http://rvm.io)
12
+ - [Optional] ImageMagick (http://www.imagemagick.org)
12
13
 
13
14
  Other stuff taken care of:
14
15
  - Logration
@@ -21,7 +22,15 @@ You can choose a Database-Engine:
21
22
 
22
23
  **If you are not using Amazon AWS as a host:** The GEM needs a working Amazon AWS-style `ubuntu`-user on the system in order to work properly. It will create one, if needed.
23
24
 
25
+ It uses the following Capistrano-roles to divide the installed components:
26
+ - **web**: Machines with this role run NGINX as proxy
27
+ - **app**: Machines with this role run the Ruby-webapp
28
+ - **search**: [OPTIONAL] Machines with this role run ElasticSearch
29
+ - **cronjobs**: [OPTIONAL] For environments where `whenever` should manage/run cronjobs
30
+
24
31
  ## Changelog
32
+ * **2015-06-23**: Support for optional ElasticSearch
33
+ * **2015-06-23**: Support for optional `whenever`
25
34
  * **2015-06-23**: Support for optional `imagemagick`
26
35
  * **2015-06-23**: Support creation of working `ubuntu` user. Error out if another user than `ubuntu` is used.
27
36
  * **2015-06-22**: Support for choosing your Ruby-version when creating the `Capfile`. Suggestions come from `.ruby-version` and `Gemfile`.
data/deploy-mate.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "deploy_mate"
3
- s.version = "0.14"
3
+ s.version = "0.15"
4
4
 
5
5
  s.authors = ["Tim Adler"]
6
6
  s.date = %q{2015-06-23}
@@ -20,6 +20,4 @@ Gem::Specification.new do |s|
20
20
  s.add_dependency 'capistrano-rails'
21
21
  s.add_dependency 'rake'
22
22
 
23
- # s.add_development_dependency 'rake', '~> 10.1.0'
24
-
25
23
  end
@@ -28,6 +28,6 @@ require "capistrano/helpers.rb"
28
28
  end
29
29
 
30
30
  # Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
31
- %w(bluepill logrotate machine nginx rvm unicorn upstart).each do |t|
31
+ %w(bluepill logrotate machine elasticsearch nginx rvm unicorn upstart).each do |t|
32
32
  import File.expand_path("../tasks/#{t}.rake", __FILE__)
33
33
  end
@@ -0,0 +1,15 @@
1
+ namespace :elasticsearch do
2
+ include Aptitude
3
+ task :install do
4
+ on roles(:search) do
5
+ unless is_package_installed?("elasticsearch")
6
+ apt_get_install("openjdk-7-jre-headless") unless is_package_installed?("openjdk-7-jre-headless")
7
+ execute "wget -qO - https://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -"
8
+ sudo 'add-apt-repository "deb http://packages.elasticsearch.org/elasticsearch/1.5/debian stable main"'
9
+ apt_get_install("elasticsearch")
10
+ sudo "update-rc.d elasticsearch defaults 95 10"
11
+ sudo :service, :elasticsearch, :start
12
+ end
13
+ end
14
+ end
15
+ end
@@ -19,6 +19,7 @@ namespace :machine do
19
19
  invoke "machine:install:bluepill"
20
20
  invoke "machine:install:bundler"
21
21
  invoke "machine:install:nodejs"
22
+ invoke "machine:install:elasticsearch"
22
23
  invoke "machine:install:imagemagick" if fetch(:imagemagick)
23
24
  invoke "machine:install:mysql_dev" if fetch(:db_engine) == "mysql"
24
25
  invoke "machine:install:postgres_dev" if fetch(:db_engine) == "postgresql"
@@ -65,6 +66,12 @@ namespace :machine do
65
66
  end
66
67
  end
67
68
 
69
+ task :elasticsearch do
70
+ on roles(:search) do
71
+ invoke 'elasticsearch:install'
72
+ end
73
+ end
74
+
68
75
  task :language_pack_de do
69
76
  on roles(:app) do
70
77
  apt_get_install("language-pack-de") unless is_package_installed?("language-pack-de")
@@ -7,18 +7,18 @@ namespace :deploy_mate do
7
7
  puts "I'm your DEPLOY_MATE."
8
8
  puts "We will setting up your deployment now."
9
9
 
10
- @ruby_version = ask("[01/11] Ruby-Version (the RVM-way, e.g. ruby-2.2.0)", guess_ruby_version)
11
- @app_name = ask("[02/11] App-Name (for nginx, servers, etc.)", guess_app_name)
12
- @repo_url = ask("[03/11] Url-Location of git-repo", "git@github.com:hanseventures/#{@app_name}.git")
13
- @is_rails = yes_or_no?("[04/11] Is this a RAILS project ?", (rails_present? ? "yes" : "no"))
14
- @needs_imagemagick = yes_or_no?("[05/11] Does this project need ImageMagick ?", (needs_imagemagick? ? "yes" : "no"))
15
-
16
- @stage_name = ask("[06/11] Give the first stage a name", "prestage")
17
- @ssh_name = ask("[07/11] SSH-Hostname for the server", "#{@app_name}-#{@stage_name}")
18
- @branch_name = ask("[08/11] Branch to deploy '#{@stage_name}' from", "dev")
19
- @host_name = ask("[09/11] Web-URL for '#{@stage_name}'", "#{@stage_name}.#{@app_name}")
20
- @environment = ask("[10/11] #{@stage_name}'s environment (RACK_ENV/RAILS_ENV)", "#{@stage_name}")
21
- @db_engine = ask_until("[11/11] What db are you using?", %w( postgresql mysql ), "mysql")
10
+ @ssh_name = ask("[01/12] SSH-Hostname for the server", "#{@app_name}-#{@stage_name}")
11
+ @ruby_version = ask("[02/12] Ruby-Version (the RVM-way, e.g. ruby-2.2.0)", guess_ruby_version)
12
+ @app_name = ask("[03/12] App-Name (for nginx, servers, etc.)", guess_app_name)
13
+ @repo_url = ask("[04/12] Url-Location of git-repo", "git@github.com:hanseventures/#{@app_name}.git")
14
+ @is_rails = yes_or_no?("[05/12] Is this a RAILS project ?", (rails_present? ? "yes" : "no"))
15
+ @needs_imagemagick = yes_or_no?("[06/12] Does this project need ImageMagick ?", (needs_imagemagick? ? "yes" : "no"))
16
+ @stage_name = ask("[07/12] Give the first stage a name", "prestage")
17
+ @branch_name = ask("[08/12] Branch to deploy '#{@stage_name}' from", "dev")
18
+ @host_name = ask("[09/12] Web-URL for '#{@stage_name}'", "#{@stage_name}.#{@app_name}")
19
+ @environment = ask("[10/12] #{@stage_name}'s environment (RACK_ENV/RAILS_ENV)", "#{@stage_name}")
20
+ @db_engine = ask_until("[11/12] What db are you using?", %w( postgresql mysql ), "mysql")
21
+ @needs_elasticsearch = yes_or_no?("[12/12] Do you need ElasticSearch on this machine ?", "no")
22
22
 
23
23
  puts "Aye!"
24
24
  puts "Worrrrking..."
@@ -31,6 +31,8 @@ namespace :deploy_mate do
31
31
  config_template("deploy/stage.rb.erb", "config/deploy/#{@stage_name}.rb")
32
32
  sleep 1
33
33
 
34
+ puts "You can activate OPTIONAL components e.g. 'whenever' in deploy.rb/Capfile."
35
+
34
36
  puts "Arr, be dun working!"
35
37
  end
36
38
 
@@ -4,3 +4,8 @@ require 'capistrano/rails/assets'
4
4
  require 'capistrano/rails/migrations'
5
5
  <% end %>
6
6
  Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
7
+
8
+ # Optionals
9
+ # Uncomment, if needed
10
+
11
+ # require "whenever/capistrano"
@@ -11,4 +11,12 @@ set :default_stage, '<%= @stage_name %>'
11
11
  set :repo_url, '<%= @repo_url %>'
12
12
  set :db_engine, '<%= @db_engine %>'
13
13
 
14
- set :imagemagick, '<%= @needs_imagemagick %>'
14
+ set :imagemagick, '<%= @needs_imagemagick %>'
15
+
16
+ # Optionals
17
+ # Uncomment, if needed
18
+
19
+ # set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" }
20
+ # set :whenever_environment, fetch(:stage)
21
+ # set :whenever_roles, [:cronjobs]
22
+ # before "whenever:update_crontab", 'rvm:hook'
@@ -1,4 +1,4 @@
1
- server "<%= @ssh_name %>", roles: [:app, :web, :db], :primary => true
1
+ server "<%= @ssh_name %>", roles: [:app, :web<% if @needs_elasticsearch %>, :search<%end %>], :primary => true
2
2
 
3
3
  set :unicorn_workers, "2"
4
4
  set :nginx_server_name, "<%= @host_name %>"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploy_mate
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.14'
4
+ version: '0.15'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Adler
@@ -100,6 +100,7 @@ files:
100
100
  - lib/capistrano/scripts/install_rvm.sh
101
101
  - lib/capistrano/scripts/set_defaults.sh
102
102
  - lib/capistrano/tasks/bluepill.rake
103
+ - lib/capistrano/tasks/elasticsearch.rake
103
104
  - lib/capistrano/tasks/logrotate.rake
104
105
  - lib/capistrano/tasks/machine.rake
105
106
  - lib/capistrano/tasks/nginx.rake