coalla-deploy 0.1.10 → 0.1.11.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -3,29 +3,3 @@ require 'net/ssh'
3
3
  require 'net/scp'
4
4
  require 'fileutils'
5
5
 
6
- task 'build:gem' do
7
- host = '5.9.118.111'
8
- user = 'deployer'
9
- Net::SSH.start(host, user, port: 60000) do |ssh|
10
- base_dir = "/home/#{user}/temp/coalla-gems"
11
- project_name = 'coalla-deploy'
12
- git_url = "http://git.coalla.ru/#{project_name}.git"
13
- gems_dir = '/var/www/virtual-hosts/gems.coalla.ru'
14
- output = ssh.exec! <<-SH
15
- mkdir --parents #{base_dir}
16
- cd #{base_dir}
17
- git clone #{git_url}
18
- cd #{project_name}
19
- source /etc/profile.d/rvm.sh
20
- rvm 1.9.3
21
- gem build coalla-deploy.gemspec
22
- cp -rf *.gem #{gems_dir}/gems
23
- cd #{gems_dir}
24
- source /etc/profile.d/rvm.sh
25
- rvm 1.9.3
26
- gem generate_index
27
- rm -R #{base_dir}
28
- SH
29
- puts output
30
- end
31
- end
@@ -1,5 +1,5 @@
1
1
  module Coalla
2
2
  module Deploy
3
- VERSION = '0.1.10'
3
+ VERSION = '0.1.11.3'
4
4
  end
5
5
  end
@@ -6,7 +6,7 @@ module Coalla
6
6
 
7
7
  module Generators
8
8
 
9
- class InitGenerator < ::Rails::Generators::Base
9
+ class InitGenerator < ::Rails::Generators::NamedBase
10
10
 
11
11
  source_root File.expand_path('../../../../../../templates', __FILE__)
12
12
 
@@ -21,6 +21,28 @@ module Coalla
21
21
  copy_file 'staging.rb', 'config/deploy/staging.rb'
22
22
  copy_file 'production.rb', 'config/deploy/production.rb'
23
23
  copy_file 'http_auth.rb', 'config/initializers/http_auth.rb'
24
+ copy_file 'environments/staging.rb', 'config/environments/staging.rb'
25
+ copy_file 'production/robots.txt', 'config/deploy/production/robots.txt'
26
+ copy_file 'staging/robots.txt', 'config/deploy/staging/robots.txt'
27
+ end
28
+
29
+ def configure_staging
30
+ app_name = name.underscore
31
+
32
+ gsub_file 'config/environments/staging.rb', '# Configure mailer' do |match|
33
+ c = <<-CONFIG
34
+
35
+ config.action_mailer.default_url_options = {host: '#{app_name}.coalla.ru'}
36
+ Rails.application.config.middleware.use ExceptionNotification::Rack,
37
+ :email => {
38
+ :email_prefix => "ERROR: ",
39
+ :sender_address => %Q{"#{app_name} notifier [staging]" <no-reply@#{app_name}.coalla.ru>},
40
+ :exception_recipients => %w{dev@coalla.ru}
41
+ }
42
+ CONFIG
43
+
44
+ match << c
45
+ end
24
46
  end
25
47
  end
26
48
 
data/templates/deploy.rb CHANGED
@@ -13,6 +13,8 @@ set :use_whenever, File.exists?(File.join(File.expand_path('..', File.dirname(__
13
13
  set :use_sphinx, File.exists?(File.join(File.expand_path('..', File.dirname(__FILE__)), 'config', 'thinking_sphinx.yml'))
14
14
  set :use_delayed_job, File.exists?(File.join(File.expand_path('..', File.dirname(__FILE__)), 'bin', 'delayed_job'))
15
15
 
16
+ set :shared_children, fetch(:shared_children) + ['tmp/cache']
17
+
16
18
  # RVM configuration
17
19
  require 'rvm/capistrano'
18
20
  set :rvm_type, :system
@@ -80,7 +82,6 @@ after 'deploy:update_code', :backup_database
80
82
  before 'bundle:install', :update_gemfile
81
83
 
82
84
  after 'deploy:assets:precompile' do
83
- run "cd #{release_path} && bundle exec rake tmp:cache:clear RAILS_ENV=#{rails_env}"
84
85
  run "cd #{release_path} && bundle exec rake assets:non_digested RAILS_ENV=#{rails_env}"
85
86
  end
86
87
 
@@ -0,0 +1,84 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like
20
+ # NGINX, varnish or squid.
21
+ # config.action_dispatch.rack_cache = true
22
+
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26
+
27
+ # Compress JavaScripts and CSS.
28
+ config.assets.js_compressor = :uglifier
29
+ # config.assets.css_compressor = :sass
30
+
31
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
32
+ config.assets.compile = false
33
+
34
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35
+ # yet still be able to expire them through the digest params.
36
+ config.assets.digest = true
37
+
38
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39
+
40
+ # Specifies the header that your server uses for sending files.
41
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43
+
44
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
+ # config.force_ssl = true
46
+
47
+ # Use the lowest log level to ensure availability of diagnostic information
48
+ # when problems arise.
49
+ config.log_level = :debug
50
+
51
+ # Prepend all log lines with the following tags.
52
+ # config.log_tags = [ :subdomain, :uuid ]
53
+
54
+ # Use a different logger for distributed setups.
55
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56
+
57
+ # Use a different cache store in production.
58
+ # config.cache_store = :mem_cache_store
59
+
60
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61
+ config.action_mailer.delivery_method = :sendmail
62
+ config.action_mailer.sendmail_settings = {
63
+ :location => '/usr/sbin/sendmail',
64
+ :arguments => '-i'
65
+ }
66
+
67
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68
+ # the I18n.default_locale when a translation cannot be found).
69
+ config.i18n.fallbacks = true
70
+
71
+ # Send deprecation notices to registered listeners.
72
+ config.active_support.deprecation = :notify
73
+
74
+ # Use default logging formatter so that PID and timestamp are not suppressed.
75
+ config.log_formatter = ::Logger::Formatter.new
76
+
77
+ # Do not dump schema after migrations.
78
+ config.active_record.dump_schema_after_migration = false
79
+
80
+ config.action_mailer.perform_deliveries = true
81
+ config.action_mailer.raise_delivery_errors = true
82
+
83
+ # Configure mailer
84
+ end
@@ -3,7 +3,9 @@ module Coalla
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- before_action do
6
+ before_action :http_authenticate
7
+
8
+ def http_authenticate
7
9
  if ::Rails.env.staging?
8
10
  authenticate_or_request_with_http_basic do |username, password|
9
11
  username == 'demo' && password == '1qaz3edc'
@@ -0,0 +1 @@
1
+ Allow: /
@@ -0,0 +1 @@
1
+ Disallow: /
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coalla-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11.3
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - coalla
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-03-21 00:00:00.000000000 Z
12
+ date: 2016-03-10 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: railties
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: thor
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: bundler
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: rails
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ~>
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ~>
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: net-ssh
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ~>
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ~>
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: net-scp
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ~>
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ~>
95
108
  - !ruby/object:Gem::Version
@@ -119,31 +132,35 @@ files:
119
132
  - templates/build-production.sh
120
133
  - templates/build-staging.sh
121
134
  - templates/deploy.rb
135
+ - templates/environments/staging.rb
122
136
  - templates/http_auth.rb
123
137
  - templates/production.rb
138
+ - templates/production/robots.txt
124
139
  - templates/staging.rb
140
+ - templates/staging/robots.txt
125
141
  - templates/unicorn.rb
126
142
  homepage: http://coalla.ru
127
143
  licenses: []
128
- metadata: {}
129
144
  post_install_message:
130
145
  rdoc_options: []
131
146
  require_paths:
132
147
  - lib
133
148
  required_ruby_version: !ruby/object:Gem::Requirement
149
+ none: false
134
150
  requirements:
135
151
  - - ! '>='
136
152
  - !ruby/object:Gem::Version
137
153
  version: '0'
138
154
  required_rubygems_version: !ruby/object:Gem::Requirement
155
+ none: false
139
156
  requirements:
140
157
  - - ! '>='
141
158
  - !ruby/object:Gem::Version
142
159
  version: '0'
143
160
  requirements: []
144
161
  rubyforge_project: coalla-deploy
145
- rubygems_version: 2.4.3
162
+ rubygems_version: 1.8.25
146
163
  signing_key:
147
- specification_version: 4
164
+ specification_version: 3
148
165
  summary: Coalla deploy gem
149
166
  test_files: []
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjliYzkxNThjM2JlNDBmYTc3MjgwYjU3MmRlYTI1OWQwNjYxOWEzZA==
5
- data.tar.gz: !binary |-
6
- Y2Y5ZTg0NGEzMDAyN2QyMDNjYWFiYTU3YTliN2IyMWIxOGRmODM3Mg==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- M2JlOGQyOWFkZTIzOTNmZDFjMTc5NGVlNDg2MjgzZDBlYTU4ZmYyYzM0Njgz
10
- YzEzZjQ5YjM5OTI4OWE4ZTg2ODc5NzRhNTA2NmRmOTdjOTYzOTU4YTZjNjA1
11
- NTc3ZDkzMjNiMzQ5MGI2OTY5ZWZjZGQ2YTUxYjg0YjdjNWEyZmM=
12
- data.tar.gz: !binary |-
13
- M2JhZDQ1N2FiNzEzNWMwYzY5MGM5NjhiNmZiYThlZjdkODFlM2MwNDZjZmFk
14
- YWE1YmU5ZDg2MWQ4NjRlZTExNDY3NThhNWRhNzcyZWJmYmFhZDU3NzE3NGE4
15
- ZjgwMmQzMTY5NjRiZGY3OTJlMWM4YjRhOTRmNjY1YzM0YTA3OTg=