railman-deployment 0.3.0 → 1.0.0

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: 74d033d4ce81b4d5dc55e8b06f733132eb49e2fe
4
- data.tar.gz: 03d2b3eb9eeae5b140248843a427ca6e20bea9fe
3
+ metadata.gz: '0481e134707e49cd9380a09ba35aba9b6cbcbaa6'
4
+ data.tar.gz: e9481b1fb905691ce4c6ef668decfa0302f0475b
5
5
  SHA512:
6
- metadata.gz: 54afbb054778d1c2283e48ac9b3a2d029166716c6641c26a578a5125b6795099e1b828e3649be9b7538c83a9fd9a25d5bf3349f9fca4e80e149f56c2a31b8f96
7
- data.tar.gz: 53e895b9320903702a021b6c74691e0e1dd46316cb6d4d7803eb09a1787534058c8249f91a62eed56aa18120430852322fde6cabc4849ac714f91606daa34baa
6
+ metadata.gz: c9154ab518da89c09a3c6d4b8ad41a05a53ef001cd76977c5b4594f4bb9653bf382559123ac3478190eb3833b03275e02f888f0e5dbb17591f039ebaefa5c740
7
+ data.tar.gz: 225a590104e5e7b0f20989aea39ac7f7248bb9ccc4962d97fb01f3d6c681701c50c0983f8e881d62524b423ca7bb7a9d555976cb8140ccb97369aa05a267b1ec
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.0
1
+ 2.3.3
@@ -1,3 +1,3 @@
1
1
  module RailmanDeployment
2
- VERSION = '0.3.0'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -9,8 +9,8 @@ task :setup do
9
9
  invoke :sync_local_dirs_to_server
10
10
  end
11
11
  server_conf_dir = "#{fetch(:deploy_to)}/config/server"
12
- execute :ln, "-s -f #{server_conf_dir}/nginx.conf /etc/nginx/conf.d/#{fetch(:application)}.conf"
13
- execute :ln, "-s -f #{server_conf_dir}/letsencrypt.conf /etc/nginx/letsencrypt/#{fetch(:application)}.conf"
12
+ execute :cp, "-s -f #{server_conf_dir}/nginx.conf /etc/nginx/sites-available/#{fetch(:domain)}"
13
+ execute :ln, "-s /etc/nginx/sites-available/#{fetch(:domain)}.conf /etc/nginx/sites-enabled/"
14
14
  execute :ln, "-s -f #{server_conf_dir}/logrotate.conf /etc/logrotate.d/#{fetch(:application)}"
15
15
  within fetch(:deploy_to) do
16
16
  execute :bundle, :install, '--without development test'
@@ -18,14 +18,14 @@ task :setup do
18
18
  if test "[ -f #{fetch(:deploy_to)}/.env ]"
19
19
  invoke :create_database_from_sql_file
20
20
  execute :rake, 'assets:precompile'
21
- execute :leye, :load, 'Eyefile'
22
- execute :leye, :start, fetch(:application)
21
+ execute :eye, :load, 'Eyefile'
22
+ execute :eye, :start, fetch(:application)
23
23
  execute :service, 'nginx restart'
24
+ execute :certbot, "--nginx -d #{fetch(:domain)}"
24
25
  else
25
26
  execute :cp, '.env.example.production', '.env'
26
27
  execute "sed -i -e 's/TODO: generate with: rake secret/#{SecureRandom.hex(64)}/g' #{fetch(:deploy_to)}/.env"
27
28
  warn 'TODO: Edit .env and modify your database and smtp settings.'
28
- warn 'TODO: Create ssl certificates by running the following command as root: /etc/nginx/letsencrypt/generate_letsencrypt.sh'
29
29
  warn 'TODO: Run \'cap ENV setup\' again!'
30
30
  end
31
31
  end
@@ -38,13 +38,13 @@ task :remove do
38
38
  on roles(:all) do
39
39
  with fetch(:environment) do
40
40
  within fetch(:deploy_to) do
41
- execute :leye, :load, 'Eyefile'
42
- execute :leye, :stop, fetch(:application)
41
+ execute :eye, :load, 'Eyefile'
42
+ execute :eye, :stop, fetch(:application)
43
43
  execute :rake, 'db:drop'
44
44
  execute :su_rm, "-rf #{fetch(:deploy_to)}"
45
45
  end if test "[ -d #{fetch(:deploy_to)} ]"
46
- execute :su_rm, "-f /etc/nginx/conf.d/#{fetch(:application)}.conf"
47
- execute :su_rm, "-f /etc/nginx/letsencrypt/#{fetch(:application)}.conf"
46
+ execute :su_rm, "-f /etc/nginx/sites-enabled/#{fetch(:domain)}"
47
+ execute :su_rm, "-f /etc/nginx/sites-available/#{fetch(:domain)}"
48
48
  execute :su_rm, "-f /etc/logrotate.d/#{fetch(:application)}"
49
49
  execute :service, 'nginx restart'
50
50
  end
@@ -60,8 +60,8 @@ task :deploy do
60
60
  execute :bundle, :install
61
61
  execute :rake, 'db:migrate'
62
62
  execute :rake, 'assets:precompile'
63
- execute :leye, :load, 'Eyefile'
64
- execute :leye, :restart, fetch(:application)
63
+ execute :eye, :load, 'Eyefile'
64
+ execute :eye, :restart, fetch(:application)
65
65
  execute :service, 'nginx restart'
66
66
  end
67
67
  end
@@ -87,14 +87,14 @@ task :reset_server do
87
87
  on roles(:all) do
88
88
  with fetch(:environment) do
89
89
  within fetch(:deploy_to) do
90
- execute :leye, :load, 'Eyefile'
91
- execute :leye, :stop, fetch(:application)
90
+ execute :eye, :load, 'Eyefile'
91
+ execute :eye, :stop, fetch(:application)
92
92
  sleep 6 # seconds
93
93
  invoke :fetch_and_reset_git_repository
94
94
  execute :rake, 'db:drop'
95
95
  invoke :create_database_from_sql_file
96
96
  invoke :sync_local_dirs_to_server
97
- execute :leye, :start, fetch(:application)
97
+ execute :eye, :start, fetch(:application)
98
98
  execute :service, 'nginx restart'
99
99
  end
100
100
  end
@@ -4,10 +4,10 @@ task :set_railman_env do
4
4
  set :environment, {path: "#{fetch(:rbenv_home)}/shims:#{fetch(:rbenv_home)}/bin:$PATH", rails_env: 'production'}
5
5
 
6
6
  SSHKit.config.command_map[:rake] = "#{fetch(:deploy_to)}/bin/rake"
7
- %w(ln service start restart stop status).each do |cmd|
7
+ %w(ln service start restart stop status certbot).each do |cmd|
8
8
  SSHKit.config.command_map[cmd.to_sym] = "sudo #{cmd}"
9
9
  end
10
- SSHKit.config.command_map[:leye] = "#{fetch(:rbenv_home)}/shims/leye"
10
+ SSHKit.config.command_map[:eye] = "#{fetch(:rbenv_home)}/shims/eye"
11
11
  SSHKit.config.command_map[:su_rm] = 'sudo rm'
12
12
  end
13
13
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railman-deployment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Jancev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-01 00:00:00.000000000 Z
11
+ date: 2017-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  version: '0'
185
185
  requirements: []
186
186
  rubyforge_project:
187
- rubygems_version: 2.5.1
187
+ rubygems_version: 2.5.2
188
188
  signing_key:
189
189
  specification_version: 4
190
190
  summary: Capistrano tasks for railman-generated rails applications