deployinator 0.0.4 → 0.0.5

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.
Files changed (2) hide show
  1. data/lib/deployinator/deploy.rb +12 -8
  2. metadata +2 -2
@@ -11,9 +11,11 @@ namespace :deploy do
11
11
  "-e", "GEM_PATH=#{fetch(:deploy_to)}/shared/bundle",
12
12
  "-e", "PATH=#{fetch(:deploy_to)}/shared/bundle/bin:$PATH",
13
13
  "--entrypoint", "#{fetch(:deploy_to)}/shared/bundle/bin/bundle",
14
+ "--volume $SSH_AUTH_SOCK:/ssh-agent --env SSH_AUTH_SOCK=/ssh-agent",
14
15
  "--volume #{fetch(:deploy_to)}:#{fetch(:deploy_to)}:rw",
15
16
  "--volume /etc/passwd:/etc/passwd:ro",
16
17
  "--volume /etc/group:/etc/group:ro",
18
+ "--volume /home:/home:rw",
17
19
  fetch(:ruby_image_name)
18
20
  ].join(' ')
19
21
  end
@@ -224,6 +226,15 @@ namespace :deploy do
224
226
  desc 'Restart application using bluepill restart inside the docker container.'
225
227
  task :restart => [:set_www_data_user_id, :install_config_files] do
226
228
  on roles(:app), in: :sequence, wait: 5 do
229
+ as :root do
230
+ paths = [
231
+ fetch(:external_socket_path),
232
+ "#{fetch(:deploy_to)}/current/public",
233
+ "#{fetch(:deploy_to)}/shared/tmp",
234
+ "#{fetch(:deploy_to)}/shared/log/production.log"
235
+ ].join(' ')
236
+ execute "chown", "-R", "#{fetch(:www_data_user_id)}:#{fetch(:www_data_user_id)}", paths
237
+ end
227
238
  if test "docker", "inspect", fetch(:ruby_container_name), "&>", "/dev/null"
228
239
  if (capture "docker", "inspect",
229
240
  "--format='{{.State.Restarting}}'",
@@ -242,15 +253,8 @@ namespace :deploy do
242
253
  end
243
254
  else
244
255
  as :root do
245
- paths = [
246
- fetch(:external_socket_path),
247
- "#{fetch(:deploy_to)}/current/public",
248
- "#{fetch(:deploy_to)}/shared/tmp",
249
- "#{fetch(:deploy_to)}/shared/log/production.log"
250
- ].join(' ')
251
- execute "chown", "-R", "#{fetch(:www_data_user_id)}:#{fetch(:www_data_user_id)}", paths
252
- execute "chown", "-R", "#{fetch(:deployer_user_id)}:#{fetch(:deployer_user_id)}", "#{fetch(:deploy_to)}/shared/bundle"
253
256
  execute("rm", "-f", "#{fetch(:external_socket_path)}/unicorn.pid")
257
+ g execute "chown", "-R", "#{fetch(:deployer_user_id)}:#{fetch(:deployer_user_id)}", "#{fetch(:deploy_to)}/shared/bundle"
254
258
  end
255
259
  execute("docker", "run", fetch(:docker_run_bluepill_command))
256
260
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deployinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-17 00:00:00.000000000 Z
12
+ date: 2014-12-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano