groundskeeper-bitcore 0.14.0 → 0.15.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
  SHA256:
3
- metadata.gz: 0f3abfedd064f6693fca5e7662bbbd9e9d86ad809745eb6447dae93b0f65836d
4
- data.tar.gz: 06b0d10e2ee271169399a386c13cd9da2baf5b23caaa11b9838a67635dbf68a5
3
+ metadata.gz: 6b2c9f76613a798df337da19c7e2f6c6acbced59c9f898436d0bfcd7580c5d8f
4
+ data.tar.gz: fd6a49caf739108191eb2f3467747ad5d2242753d8a0df13d4a9aefa3a35c9fd
5
5
  SHA512:
6
- metadata.gz: a6b169b9c74ae1efafe33c5a9fd47f990f4d14247c505fd790da3c679c713819187782688d6b7689d3572b16438bfae93e38e7128765faa0ddc0c9b189910aec
7
- data.tar.gz: f0b0d7874d08b8900ddde2e23150c7851d05329c8f5b34c372c70d0008dc1698c7a500159906c8ae19a1dcbb5e0d44640894c93819a6b480f17c782d8ced5d4f
6
+ metadata.gz: d393d4cfa508eea20bf88c1247afcec9526364143a6ecec634278e1fb8389e3c318e4d7880e5d90c96de36e5b6c9a3029d1c5888d4f7d9c1288e56525012eb8c
7
+ data.tar.gz: d40db43a6832f614a1bf83c3f1abc2e5909cb8a0a86bcb68f0afe729f11555ea01eef763617364bacdf3bed9dd29af4fcc83b5782ce9a1be931e0efe009cf4d7
data/README.md CHANGED
@@ -70,10 +70,11 @@ application directory:
70
70
  ground release
71
71
  ```
72
72
 
73
- To prepare the server (only required the first time) for deployment:
73
+ To prepare the server (only required the first time) for deployment, add nginx
74
+ flag if deploying to nginx server:
74
75
 
75
76
  ```bash
76
- tag=0.0.0 stage=production ground predeploy
77
+ tag=0.0.0 stage=production ground predeploy [--nginx]
77
78
  ```
78
79
 
79
80
  To deploy the release (note that `stage` is optional and will be set to staging
@@ -41,5 +41,6 @@ task :before_run do
41
41
 
42
42
  set :branch, "master"
43
43
  set :tag, tag
44
+ set :nginx, fetch(:nginx)
44
45
  end
45
46
  # rubocop:enable Metrics/BlockLength
@@ -28,6 +28,14 @@ def vhost_config_file
28
28
  "/etc/httpd/conf.d/#{fetch :application_name}.conf"
29
29
  end
30
30
 
31
+ def vhost_nginx_config_file
32
+ "/etc/nginx/sites-available/#{fetch :application_name}.conf"
33
+ end
34
+
35
+ def vhost_nginx_linked_file
36
+ "/etc/nginx/sites-enabled/#{fetch :application_name}.conf"
37
+ end
38
+
31
39
  def remote_shared_path(path)
32
40
  "#{fetch(:user)}@#{fetch(:domain)}:#{fetch(:shared_path)}/#{path}"
33
41
  end
@@ -101,14 +109,25 @@ namespace :deploy_configure do
101
109
  end
102
110
  # rubocop:enable Metrics/BlockLength
103
111
 
112
+ # rubocop:disable Metrics/BlockLength
104
113
  namespace :deploy_prepare do
105
114
  desc "Write the virtual host config file. May require an Apache restart."
106
115
  task :create_vhost do
107
116
  load_project
117
+ vhost_file = vhost_config_file
108
118
  vhost_config = load_template("vhost_config.conf.erb")
109
- if !(File.exist? vhost_config_file) || FORCE_OVERWRITE
110
- comment "Writing virtual host config to #{vhost_config_file}"
111
- command "echo \"#{vhost_config}\" > #{vhost_config_file}"
119
+
120
+ if fetch(:nginx)
121
+ vhost_file = vhost_nginx_config_file
122
+ vhost_config = load_template("vhost_config_nginx.conf.erb")
123
+ command "sudo chown -R deploy:nginx /etc/nginx/sites-available"
124
+ command "sudo chown -R deploy:nginx /etc/nginx/sites-enabled"
125
+ end
126
+
127
+ if !(File.exist? vhost_file) || FORCE_OVERWRITE
128
+ comment "Writing virtual host config to #{vhost_file}"
129
+ command "echo \"#{vhost_config}\" > #{vhost_file}"
130
+ command "ln -s #{vhost_file} #{vhost_nginx_linked_file}" if fetch(:nginx)
112
131
  end
113
132
  end
114
133
 
@@ -120,7 +139,9 @@ namespace :deploy_prepare do
120
139
 
121
140
  desc "Set owner."
122
141
  task :set_owner do
123
- comment "Setting owner of #{fetch :deploy_to} apache"
124
- command "sudo chgrp -R apache #{fetch :deploy_to}"
142
+ owner = fetch(:nginx) ? "nginx" : "apache"
143
+ comment "Setting owner of #{fetch :deploy_to} #{owner}"
144
+ command "sudo chgrp -R #{owner} #{fetch :deploy_to}"
125
145
  end
126
146
  end
147
+ # rubocop:enable Metrics/BlockLength
@@ -0,0 +1,26 @@
1
+ <% project = fetch :project -%>
2
+ server {
3
+ listen 80;
4
+
5
+ server_name <%= fetch :domain %>;
6
+ return 301 https://<%= fetch :domain -%>/;
7
+ }
8
+
9
+ server {
10
+ listen 443 ssl;
11
+ server_name <%= fetch :domain %>;
12
+
13
+ passenger_enabled on;
14
+ passenger_friendly_error_pages off;
15
+ passenger_app_env <%= fetch :stage %>;
16
+ passenger_ruby /usr/local/rvm/gems/ruby-<%= fetch :rvm_ruby_version -%>/wrappers/ruby;
17
+ passenger_min_instances 1;
18
+ passenger_base_uri /;
19
+
20
+ root <%= fetch :deploy_to -%>/current/public;
21
+
22
+ ssl_certificate <%= project.ssl_certificate_file(fetch(:stage).to_sym) %>;
23
+ ssl_certificate_key <%= project.ssl_certificate_key_file(fetch(:stage).to_sym) %>;
24
+ ssl_protocols TLSv1.2;
25
+ ssl_ciphers HIGH:!aNULL:!MD5;
26
+ }
@@ -29,6 +29,7 @@ module Groundskeeper
29
29
 
30
30
  # :nocov:
31
31
  desc "predeploy", "create configuration files for the project"
32
+ option :nginx, type: :boolean
32
33
  def predeploy
33
34
  commands.info options
34
35
  commands.predeploy options
@@ -7,7 +7,7 @@ require "open3"
7
7
 
8
8
  module Groundskeeper
9
9
  # Formulas for managing releases and deployments.
10
- # rubocop:disable Lint/Debugger,Metrics/ClassLength
10
+ # rubocop:disable Metrics/ClassLength
11
11
  class Commands
12
12
  RAKEFILE = File.join(
13
13
  File.dirname(__FILE__), "..", "..", "config", "deploy.rb"
@@ -191,6 +191,7 @@ module Groundskeeper
191
191
  cmd << " -s" if options[:simulate]
192
192
  cmd << " -v" if options[:verbose]
193
193
  cmd << " force_asset_precompile=true" if options[:force_asset_precompile]
194
+ cmd << " nginx=true" if options[:nginx]
194
195
  run_mina cmd
195
196
  end
196
197
 
@@ -434,5 +435,5 @@ module Groundskeeper
434
435
  @current_step += 1
435
436
  end
436
437
  end
437
- # rubocop:enable Lint/Debugger,Metrics/ClassLength
438
+ # rubocop:enable Metrics/ClassLength
438
439
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Groundskeeper
4
- VERSION = "0.14.0"
4
+ VERSION = "0.15.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groundskeeper-bitcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BIT Core
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - certs/ericcf.pem
12
- date: 2020-02-17 00:00:00.000000000 Z
12
+ date: 2020-04-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jira-ruby
@@ -181,6 +181,7 @@ files:
181
181
  - config/secrets_config.yml.erb
182
182
  - config/tasks.rb
183
183
  - config/vhost_config.conf.erb
184
+ - config/vhost_config_nginx.conf.erb
184
185
  - groundskeeper.gemspec
185
186
  - lib/groundskeeper.rb
186
187
  - lib/groundskeeper/application.rb