Merge branch 'master' of github.com:domify/registry

This commit is contained in:
Martin Lensment 2015-01-19 16:18:31 +02:00
commit 4e1d69d0d8
8 changed files with 26 additions and 14 deletions

View file

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

View file

@ -20,6 +20,8 @@
* Registry api log and whois database added, please update your database.yml,
you can view updated config at config/database-example.yml
* Upgraded to Rails 4.2 and ruby 2.2.0, be sure you have ruby 2.2.0 in your rbenv
NB! Update you passenger deb install, it should have recent fix for ruby 2.2.0
14.01.2015

View file

@ -1,5 +1,5 @@
!!!
%html{:lang => "en"}
%html{:lang => I18n.locale.to_s}
%head
%meta{:charset => "utf-8"}/
%meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}/

View file

@ -15,7 +15,7 @@ export RAILS_ENV=test
# cd to Rails root directory
cd "$(dirname "$0")"; cd ..
# cp config/secrets-example.yml config/secrets.yml
cp config/application-example.yml config/application.yml
# create manually config/database.yml
bundle install

View file

@ -17,6 +17,14 @@ set :deploy_to, '$HOME/registry'
set :repository, 'https://github.com/domify/registry' # dev repo
set :branch, 'master'
# alpha branch
task :epp do
set :domain, 'registry-st'
set :deploy_to, '$HOME/epp'
set :repository, 'https://github.com/domify/registry' # dev repo
set :branch, 'master'
end
# staging
task :st do
set :domain, 'registry-st'

View file

@ -2,7 +2,7 @@ namespace :api_log do
namespace :test do
namespace :schema do
# desc 'Dump additional database schema'
task :dump => [:environment] do
task dump: [:environment] do
filename = "#{Rails.root}/db/api_log_schema.rb"
File.open(filename, 'w:utf-8') do |file|
ActiveRecord::Base.establish_connection("api_log_#{Rails.env}".to_sym)
@ -11,21 +11,21 @@ namespace :api_log do
end
# desc 'Purge and load foo_test schema'
task :load => [:environment] do
task load: [:environment] do
# like db:test:purge
abcs = ActiveRecord::Base.configurations
ActiveRecord::Base.clear_all_connections!
ActiveRecord::Base.connection.drop_database("api_log_test")
ActiveRecord::Base.connection.create_database("api_log_test", abcs["api_log_test"])
ActiveRecord::Base.connection.drop_database('api_log_test')
ActiveRecord::Base.connection.create_database('api_log_test', abcs['api_log_test'])
# like db:test:load_schema
ActiveRecord::Base.establish_connection("api_log_test")
ActiveRecord::Base.establish_connection('api_log_test')
ActiveRecord::Schema.verbose = false
load("#{Rails.root}/db/api_log_schema.rb")
end
task :reload => [:environment] do
task reload: [:environment] do
Rake::Task['api_log:test:schema:dump'].invoke
Rake::Task['api_log:test:schema:load'].invoke
end

View file

@ -16,14 +16,14 @@ namespace :db do
namespace :all do
desc 'Create all databases: registry, api_log and whois'
task :setup => [:environment] do
task setup: [:environment] do
Rake::Task['db:all:create'].invoke
Rake::Task['db:all:schema:load'].invoke
Rake::Task['db:seed'].invoke
end
desc 'Create all databases: registry, api_log and whois'
task :create => [:environment] do
task create: [:environment] do
databases.each do |name|
begin
conf = ActiveRecord::Base.configurations
@ -37,7 +37,7 @@ namespace :db do
namespace :schema do
desc 'Schema load for all databases: registry, api_log and whois'
task :load => [:environment] do
task load: [:environment] do
databases.each do |name|
begin
puts "\n---------------------------- #{name} ----------------------------------------\n"
@ -54,7 +54,7 @@ namespace :db do
end
desc 'Schema load for all databases: registry, api_log and whois'
task :dump => [:environment] do
task dump: [:environment] do
databases.each do |name|
begin
puts "\n---------------------------- #{name} ----------------------------------------\n"

View file

@ -40,6 +40,6 @@ begin
`kill #{pid}`
end
end
rescue LoadError
# rspec gem not loaded, probably we are in production machine
rescue LoadError => e
puts e # rspec gem not loaded, probably we are in production machine
end