Skip to content

Commit

Permalink
#FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashnikovisme committed Mar 26, 2017
1 parent fa59d7d commit ca7852a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
9 changes: 4 additions & 5 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ class ApplicationController < ActionController::Base

def redirect_to_another_main_page
unless Rails.env.test?
PROJECTS.each do |project|
if request.host.include?(project) && request.path != main_page_of(request.host)
redirect_to main_page_of project
break
end
if request.host.include?('it-way.pro') && request.path != main_page_of(request.host)
redirect_to main_page_of project
elsif request.host.include?('ul-lider.ru') && request.path != activity_lines_lider_ya_liders_path(15)
redirect_to activity_lines_lider_ya_liders(15)
end
end
end
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/concerns/it_projects_concern.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
module Concerns
module ItProjectsConcern
def main_page_of(it_project_name)
if it_project_name == 'ul-lider.ru'
activity_lines_lider_ya_liders(15)
else
page_page_path it_project_name.gsub('www.', '').split('.')[0].gsub('-', '_')
end
page_page_path it_project_name.gsub('www.', '').split('.')[0].gsub('-', '_')
end
end
end
10 changes: 5 additions & 5 deletions cm/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@
args:
chdir: "{{ release_path }}"

- name: Stop sidekiq
shell: "/usr/local/rvm/bin/rvm ruby-2.3.0 do bundle exec sidekiqctl stop /srv/ulmicru/shared/tmp/pids/sidekiq-0.pid 10"
args:
chdir: "{{ release_path }}"

- name: Linking current
file:
src={{ release_path }}
dest={{ app_path }}/current
state=link
force=yes

- name: Stop sidekiq
shell: "/usr/local/rvm/bin/rvm ruby-2.3.0 do bundle exec sidekiqctl stop /srv/ulmicru/shared/tmp/pids/sidekiq-0.pid 10"
args:
chdir: "{{ release_path }}"

- name: Stop unicorn
shell: "[ -e /srv/ulmicru/shared/tmp/pids/unicorn.pid ] && kill `cat /srv/ulmicru/shared/tmp/pids/unicorn.pid`"

Expand Down

0 comments on commit ca7852a

Please sign in to comment.