deploy_mate 0.18.2 → 0.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c147b5057ab98f1b7d09135001e7429c94e4351
4
- data.tar.gz: 5c887841bef0409e4546798816488780dd3d4f5c
3
+ metadata.gz: 8015a223be95cf034bc92c203370e527b870b59a
4
+ data.tar.gz: a68d6e4be14b9b7fba434ffb3ca62cded6afdbad
5
5
  SHA512:
6
- metadata.gz: baf968bb63926b1a15a0603536de6d5d49c15afaeae205ef5486ed4088e530a9abadbd65c2c1f0dd25522d75eac184cabfce90c0b108d57f2842c776c98537de
7
- data.tar.gz: f26223846beef52a51e4be1c13904ef7b61a8a4268a729bb2b424d3b84404a06d9b716c637d2d0a27ac54164acf150be996183ebb6bbf2fd14635f7de117c039
6
+ metadata.gz: f78cc6d64ad514db68e0e964d2a765bd5d9d20ef6c6410dd27d920ec6db39413376af3fc3db1860410c9cec9bd36f194ae0fad4e6f5771417f584ab7bad50b01
7
+ data.tar.gz: b4cbdd8fc83c41247a7729a494db321a1762dabb330cdcd23f1f8f9b270a00c165c7c50694159b0589fe923515c003da9381af03700ae834503a5d2aeeaea6ad
data/README.md CHANGED
@@ -29,6 +29,7 @@ It uses the following Capistrano-roles to divide the installed components:
29
29
  - **cronjobs**: [OPTIONAL] For environments where `whenever` should manage/run cronjobs
30
30
 
31
31
  ## Changelog
32
+ * **0.18.3 (2016-03-22)**: Added mandatory task to install `ssh_key`s
32
33
  * **0.18.2 (2016-03-08)**: Added basic DDoS and flooding-proof via nginx `req_limit` and `fail2ban`
33
34
  * **0.18.1 (2016-03-01)**: Added support for memcached
34
35
  * **0.18 (2016-02-25)**: Added support for capistrano 3.4, Ask before overwriting existing config-files
data/deploy-mate.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "deploy_mate"
3
- s.version = "0.18.2"
3
+ s.version = "0.18.3"
4
4
 
5
5
  s.authors = ["Tim Adler", "Marcus Geißler", "Johannes Strampe"]
6
- s.date = %q{2016-02-17}
6
+ s.date = %q{2016-03-22}
7
7
  s.description = %q{This is how we deploy around here.}
8
8
  s.summary = s.description
9
9
  s.email = %q{development (at) hanseventures (dot) com}
@@ -7,6 +7,7 @@ namespace :machine do
7
7
  on roles(:app) do
8
8
  apt_get_update
9
9
  end
10
+ invoke "machine:install:ssh_keys"
10
11
  invoke "machine:install:htop"
11
12
  invoke "machine:install:language_pack_de"
12
13
  invoke "machine:install:unattended_upgrades"
@@ -52,6 +53,7 @@ namespace :machine do
52
53
  end
53
54
  before :setup, "deploy:ensure_folder"
54
55
 
56
+ desc "Install all dependencies"
55
57
  namespace :install do
56
58
  task :set_defaults do
57
59
  on roles(:app) do
@@ -140,6 +142,10 @@ namespace :machine do
140
142
  task :ntp do
141
143
  on roles(:app) do
142
144
  apt_get_install("ntp") unless is_package_installed?("ntp")
145
+ sudo "chmod 666 /etc/timezone"
146
+ execute 'echo "Europe/Berlin" > /etc/timezone'
147
+ sudo "chmod 644 /etc/timezone"
148
+ sudo "dpkg-reconfigure -f noninteractive tzdata"
143
149
  end
144
150
  end
145
151
 
@@ -179,6 +185,34 @@ namespace :machine do
179
185
  end
180
186
  end
181
187
 
188
+ desc "Installs new SSH Keys"
189
+ task :ssh_keys do
190
+ on roles(:app) do
191
+ file_names = fetch(:ssh_file_names)
192
+
193
+ puts "Installing SSH Keys from '#{file_names}'..."
194
+
195
+ keys = []
196
+ Dir.glob(File.expand_path(file_names)).each do |file_name|
197
+ next if File.directory?(file_name)
198
+ key_as_string = File.read(file_name)
199
+
200
+ if key_as_string.start_with?("ssh-rsa")
201
+ keys << key_as_string
202
+ puts file_name
203
+ else
204
+ warn "#{file_name} is NO publickey"
205
+ end
206
+ end
207
+
208
+ fail "No ssh-keys found in #{file_names}." unless keys.any?
209
+
210
+ upload!(StringIO.new(keys.join("")), 'new_keys')
211
+ sudo "rm ~/.ssh/authorized_keys"
212
+ sudo "mv new_keys ~/.ssh/authorized_keys"
213
+ end
214
+ end
215
+
182
216
  task :update_rvm_key do
183
217
  on roles(:app) do
184
218
  execute :gpg, "--keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3"
@@ -5,23 +5,24 @@ namespace :deploy_mate do
5
5
  desc 'Installs the needed capistrano files to deploy with the mate.'
6
6
  task :install do |t,args|
7
7
  puts "I'm your DEPLOY_MATE."
8
- puts "We will setting up your deployment now."
9
-
10
- @app_name = ask("[01/15] App-Name (for nginx, servers, etc.)", guess_app_name)
11
- @stage_name = ask("[02/15] Give the first stage a name", "prestage")
12
- @ssh_name = ask("[03/15] SSH-Hostname for the server", "#{@app_name}-#{@stage_name}")
13
- @ruby_version = ask("[04/15] Ruby-Version (the RVM-way, e.g. ruby-2.2.0)", guess_ruby_version)
14
- @db_engine = ask_until("[05/15] What db are you using?", %w( postgresql mysql ), "mysql")
15
- @app_server = ask_until("[06/15] What app server do you want to use?", %w( unicorn puma ), "unicorn")
16
- @repo_url = ask("[07/15] Url-Location of git-repo", "git@github.com:hanseventures/#{@app_name}.git")
17
- @is_rails = yes_or_no?("[08/15] Is this a RAILS project ?", (rails_present? ? "yes" : "no"))
18
- @needs_imagemagick = yes_or_no?("[09/15] Does this project need ImageMagick ?", (needs_imagemagick? ? "yes" : "no"))
19
- @uses_sidekiq = yes_or_no?("[10/15] Does this project use Sidekiq ?", (uses_sidekiq? ? "yes" : "no"))
20
- @branch_name = ask("[11/15] Branch to deploy '#{@stage_name}' from", "dev")
21
- @host_name = ask("[12/15] Web-URL for '#{@stage_name}'", "#{@stage_name}.#{@app_name}")
22
- @environment = ask("[13/15] #{@stage_name}'s environment (RACK_ENV/RAILS_ENV)", "#{@stage_name}")
23
- @needs_elasticsearch = yes_or_no?("[14/15] Do you need ElasticSearch on this machine ?", "no")
24
- @needs_memcached = yes_or_no?("[15/15] Do you need Memcached on this machine ?", (needs_memcached? ? "yes" : "no"))
8
+ puts "We will set up your deployment now."
9
+
10
+ @app_name = ask("[01/16] App-Name (for nginx, servers, etc.)", guess_app_name)
11
+ @stage_name = ask("[02/16] Give the first stage a name", "prestage")
12
+ @ssh_name = ask("[03/16] SSH-Hostname for the server", "#{@app_name}-#{@stage_name}")
13
+ @ssh_file_names = ask("[04/16] SSH Keys to be installed", "~/.ssh/*.pub")
14
+ @ruby_version = ask("[05/16] Ruby-Version (the RVM-way, e.g. ruby-2.2.0)", guess_ruby_version)
15
+ @db_engine = ask_until("[06/16] What db are you using?", %w( postgresql mysql ), "mysql")
16
+ @app_server = ask_until("[07/16] What app server do you want to use?", %w( unicorn puma ), "unicorn")
17
+ @repo_url = ask("[08/16] Url-Location of git-repo", "git@github.com:hanseventures/#{@app_name}.git")
18
+ @is_rails = yes_or_no?("[09/16] Is this a RAILS project ?", (rails_present? ? "yes" : "no"))
19
+ @needs_imagemagick = yes_or_no?("[10/16] Does this project need ImageMagick ?", (needs_imagemagick? ? "yes" : "no"))
20
+ @uses_sidekiq = yes_or_no?("[11/16] Does this project use Sidekiq ?", (uses_sidekiq? ? "yes" : "no"))
21
+ @branch_name = ask("[12/16] Branch to deploy '#{@stage_name}' from", "dev")
22
+ @host_name = ask("[13/16] Web-URL for '#{@stage_name}'", "#{@stage_name}.#{@app_name}")
23
+ @environment = ask("[14/16] #{@stage_name}'s environment (RACK_ENV/RAILS_ENV)", "#{@stage_name}")
24
+ @needs_elasticsearch = yes_or_no?("[15/16] Do you need ElasticSearch on this machine ?", "no")
25
+ @needs_memcached = yes_or_no?("[16/16] Do you need Memcached on this machine ?", (needs_memcached? ? "yes" : "no"))
25
26
 
26
27
  puts "Aye!"
27
28
  puts "Worrrrking..."
@@ -16,6 +16,8 @@ set :imagemagick, <%= @needs_imagemagick %>
16
16
  set :memcached, <%= @needs_memcached %>
17
17
  set :sidekiq, <%= @uses_sidekiq %>
18
18
 
19
+ set :ssh_file_names, '<%= @ssh_file_names %>'
20
+
19
21
  # Optionals
20
22
  # Uncomment, if needed
21
23
 
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.18.2
4
+ version: 0.18.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Adler
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-02-17 00:00:00.000000000 Z
13
+ date: 2016-03-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capistrano