Class: Dolphin::Nginx

Inherits:
Base
  • Object
show all
Defined in:
lib/dolphin/nginx.rb

Overview

Nginx related commands

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Dolphin::Base

Instance Method Details

#confObject



23
24
25
26
27
28
29
30
31
# File 'lib/dolphin/nginx.rb', line 23

def conf
  menu = [
    "
      sudo ln -sf #{@deploy_dir}/config/nginx/#{@application}.conf /etc/nginx/conf.d/#{@application}.conf
    ",
  ]

  execute menu
end

#installObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dolphin/nginx.rb', line 5

def install
  menu = [
    "
      # set repo
      sudo cp ~/nginx.repo /etc/yum.repos.d/

      # list repos
      # yum repolist

      # install nginx
      sudo yum -y install nginx
    ",
  ]

  execute menu
end

#restartObject



58
59
60
61
62
63
64
65
66
67
# File 'lib/dolphin/nginx.rb', line 58

def restart
  menu = [
    "
      # common settings
      sudo service nginx restart
    ",
  ]

  execute menu
end

#startObject



34
35
36
37
38
39
40
41
42
43
# File 'lib/dolphin/nginx.rb', line 34

def start
  menu = [
    "
      # common settings
      sudo service nginx start
    ",
  ]

  execute menu
end

#stopObject



46
47
48
49
50
51
52
53
54
55
# File 'lib/dolphin/nginx.rb', line 46

def stop
  menu = [
    "
      # common settings
      sudo service nginx stop
    ",
  ]

  execute menu
end