railman-deployment 2.0.3 → 2.0.4

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
  SHA256:
3
- metadata.gz: 816485d74430a15e0bd1b4ad6dddc7becdc6002c011912049487b29b097ec972
4
- data.tar.gz: 9fd69f857274bdc31b00695dbe72bb1836b0e456d68a4810bb94b9da80b57bc7
3
+ metadata.gz: fe48564545ec8f43274ae23c0487e72212b728b73d690ceebea998d84c5aab5f
4
+ data.tar.gz: b6602cffaa413dc77abdd94bd764c363d933b3aed20fa61e88af293048294136
5
5
  SHA512:
6
- metadata.gz: 064c8b3ac7f247a63509f1dbaae8cbd061586a1ce965354290d2eb8bcc00b31ba17b1282f075a22a1b7f1228c4761d109585fcf16755e74a5c8b69f6faa96330
7
- data.tar.gz: 81d071628e65a2b5b01a10dc78548022c7d6cc01cbe0e2a2729a46878c7c09a0436d242bf725388c6e2b7bb43421aaebbe05a2b2138a469aca78b986094c9f02
6
+ metadata.gz: da2af54cccba64ac8ac43ffbf9af3115fff13ab2062b49a5a99a9c0a183cbc3988ad94c87d062e52522b743179584f454720103d23176b18952e8bc039be89e7
7
+ data.tar.gz: 55b5cf932de139e23d03051ba0a59db058b70a441394ab2fb2bef6fefe6fb1d7678a7ac514406b8cb3e3af1bbab95649800e3d080201ddefae5337428b05e748
@@ -1,3 +1,3 @@
1
1
  module RailmanDeployment
2
- VERSION = '2.0.3'
2
+ VERSION = '2.0.4'
3
3
  end
@@ -39,7 +39,6 @@ task :setup do
39
39
  end
40
40
  end
41
41
 
42
- # todo
43
42
  desc 'Remove the application completely from the server'
44
43
  task :remove do
45
44
  on roles(:all) do
@@ -61,7 +60,6 @@ task :remove do
61
60
  execute :systemctl, :restart, :nginx
62
61
  # remove logrotate configuration
63
62
  execute :su_rm, "-f /etc/logrotate.d/#{fetch(:application)}"
64
- # todo remove letsencrypt certificates and renew cron job
65
63
  end
66
64
  end
67
65
  end
@@ -97,25 +95,6 @@ task :update do
97
95
  end
98
96
  end
99
97
 
100
- desc "Recreate server database from db/#{fetch(:application)}.sql and sync local dirs if any"
101
- task :reset_server do
102
- on roles(:all) do
103
- with fetch(:environment) do
104
- within fetch(:deploy_to) do
105
- execute :systemctl, :stop, fetch(:application)
106
- execute :systemctl, :stop, "#{fetch(:application)}_sidekiq"
107
- invoke :fetch_and_reset_git_repository
108
- execute :rake, 'db:drop'
109
- invoke :create_database_from_sql_file
110
- invoke :sync_local_dirs_to_server
111
- execute :systemctl, :restart, fetch(:application)
112
- execute :systemctl, :restart, "#{fetch(:application)}_sidekiq"
113
- execute :systemctl, :restart, :nginx
114
- end
115
- end
116
- end
117
- end
118
-
119
98
  task :sync_local_dirs_to_server do
120
99
  on roles(:all) do
121
100
  fetch(:sync_dirs, []).each do |sync_dir|
@@ -129,8 +108,10 @@ end
129
108
  task :sync_local_dirs_from_server do
130
109
  on roles(:all) do
131
110
  fetch(:sync_dirs, []).each do |sync_dir|
132
- run_locally do
133
- execute "rsync -avzm --delete --force -e ssh #{fetch(:user)}@#{fetch(:server)}:#{fetch(:deploy_to)}/#{sync_dir}/ ./#{sync_dir}/"
111
+ if test "[ -f #{fetch(:deploy_to)}//#{sync_dir} ]"
112
+ run_locally do
113
+ execute "rsync -avzm --delete --force -e ssh #{fetch(:user)}@#{fetch(:server)}:#{fetch(:deploy_to)}/#{sync_dir}/ ./#{sync_dir}/"
114
+ end
134
115
  end
135
116
  end
136
117
  end
@@ -3,7 +3,7 @@ task :set_railman_env do
3
3
  set :environment, { rails_env: 'production'}
4
4
  set :chruby_prefix, "/usr/local/bin/chruby-exec #{fetch(:chruby_ruby)} -- RAILS_ENV=production "
5
5
 
6
- SSHKit.config.command_map[:rake] = "#{fetch(:chruby_prefix)} #{fetch(:deploy_to)}/bin/rake"
6
+ SSHKit.config.command_map[:rake] = "#{fetch(:chruby_prefix)} DISABLE_DATABASE_ENVIRONMENT_CHECK=1 #{fetch(:deploy_to)}/bin/rake"
7
7
  SSHKit.config.command_map[:bundle] = "#{fetch(:chruby_prefix)} #{fetch(:deploy_to)}/bin/bundle"
8
8
  %w(systemctl certbot).each do |cmd|
9
9
  SSHKit.config.command_map[cmd.to_sym] = "sudo #{cmd}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railman-deployment
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Jancev