deploy and bins scripts now rubocop friendly

This commit is contained in:
Priit Tamboom 2014-09-25 13:45:05 +03:00
parent 1f2c12d7da
commit d25b5ef29e
6 changed files with 21 additions and 22 deletions

View file

@ -6,8 +6,6 @@ AllCops:
# stuff generated by AR and rails # stuff generated by AR and rails
- 'db/schema.rb' - 'db/schema.rb'
- 'db/migrate/*' - 'db/migrate/*'
# spring generated stuff
- 'bin/*'
# epp support files until 'complexity issues' will be solved # epp support files until 'complexity issues' will be solved
- 'spec/support/epp.rb' - 'spec/support/epp.rb'
- 'spec/support/epp_contact_xml_builder.rb' - 'spec/support/epp_contact_xml_builder.rb'

View file

@ -115,4 +115,3 @@ group :development, :test do
# For unique IDs (used by the epp gem) # For unique IDs (used by the epp gem)
gem 'uuidtools', '~> 2.1.4' gem 'uuidtools', '~> 2.1.4'
end end

View file

@ -2,6 +2,7 @@
begin begin
load File.expand_path('../spring', __FILE__) load File.expand_path('../spring', __FILE__)
rescue LoadError rescue LoadError
puts 'no spring'
end end
APP_PATH = File.expand_path('../../config/application', __FILE__) APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot' require_relative '../config/boot'

View file

@ -2,6 +2,7 @@
begin begin
load File.expand_path('../spring', __FILE__) load File.expand_path('../spring', __FILE__)
rescue LoadError rescue LoadError
puts 'no spring'
end end
require_relative '../config/boot' require_relative '../config/boot'
require 'rake' require 'rake'

View file

@ -7,9 +7,10 @@ unless defined?(Spring)
require 'rubygems' require 'rubygems'
require 'bundler' require 'bundler'
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
if match
ENV['GEM_PATH'] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) ENV['GEM_PATH'] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
ENV['GEM_HOME'] = '' ENV['GEM_HOME'] = nil
Gem.paths = ENV Gem.paths = ENV
gem 'spring', match[1] gem 'spring', match[1]

View file

@ -18,9 +18,9 @@ set :branch, 'master'
# Manually create these paths in shared/ (eg: shared/config/database.yml) in your server. # Manually create these paths in shared/ (eg: shared/config/database.yml) in your server.
# They will be linked in the 'deploy:link_shared_paths' step. # They will be linked in the 'deploy:link_shared_paths' step.
set :shared_paths, [ set :shared_paths, [
'config/database.yml', 'config/database.yml',
'config/secrets.yml', 'config/secrets.yml',
'log', 'log',
'public/system' 'public/system'
] ]
@ -42,25 +42,25 @@ end
# Put any custom mkdir's in here for when `mina setup` is ran. # Put any custom mkdir's in here for when `mina setup` is ran.
# For Rails apps, we'll make some of the shared paths that are shared between # For Rails apps, we'll make some of the shared paths that are shared between
# all releases. # all releases.
task :setup => :environment do task setup: :environment do
queue! %[mkdir -p "#{deploy_to}/shared/log"] queue! %(mkdir -p "#{deploy_to}/shared/log")
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"] queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/log")
queue! %[mkdir -p "#{deploy_to}/shared/config"] queue! %(mkdir -p "#{deploy_to}/shared/config")
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"] queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/config")
queue! %[mkdir -p "#{deploy_to}/shared/public"] queue! %(mkdir -p "#{deploy_to}/shared/public")
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/public"] queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/public")
queue! %[mkdir -p "#{deploy_to}/shared/public/system"] queue! %(mkdir -p "#{deploy_to}/shared/public/system")
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/public/system"] queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/public/system")
queue! %[touch "#{deploy_to}/shared/config/database.yml"] queue! %(touch "#{deploy_to}/shared/config/database.yml")
queue %[echo "-----> Be sure to edit 'shared/config/database.yml'."] queue %(echo '-----> Be sure to edit 'shared/config/database.yml'.')
end end
desc "Deploys the current version to the server." desc 'Deploys the current version to the server.'
task :deploy => :environment do task deploy: :environment do
deploy do deploy do
# Put things that will set up an empty directory into a fully set-up # Put things that will set up an empty directory into a fully set-up
# instance of your project. # instance of your project.
@ -82,4 +82,3 @@ end
# - http://nadarei.co/mina/tasks # - http://nadarei.co/mina/tasks
# - http://nadarei.co/mina/settings # - http://nadarei.co/mina/settings
# - http://nadarei.co/mina/helpers # - http://nadarei.co/mina/helpers