itamae-plugin-recipe-nginx_build 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37eaf0f254530642430a59da8bf226d0f171816e
4
- data.tar.gz: 128f02b217f6550d5a146a97c014040ce472ebe0
3
+ metadata.gz: ffefba9ed0c058e078cd787aec939a7ac8ca9030
4
+ data.tar.gz: 66d86358911d65fc3cc90d53cb1289b44ce2f499
5
5
  SHA512:
6
- metadata.gz: dc405a60fb706e06ab5b9ec7014d1b0ac441419364c45ea1f2478d71015cad82c3193de9a5f98f83499a2ddf24859a4ecaeeef791b8df877ee84709fdc47c8c4
7
- data.tar.gz: 641340093d583222d7314ef3dfedb4494eb54c5eb1f6ba75206bfd7785d6f637fd45bba8c7b78fbe2ae256028678dd87df8ac12979df4a5d45cb2325b4a73ee4
6
+ metadata.gz: becba8a83c24052ad17c599ee330bb5ba58ae9c95077aed2bf884c5155ffb798ede97385d0c9f7d71fd7237d1004fe5ae9ed73a3d5ac12732b3f8a1d7b818ca9
7
+ data.tar.gz: aac1f0da61851142f1d07ee62a14b83612e73f1ad8e1bf7cd8619b9477268cde1f704bfeb07205709c5a4490e9c4fd4506f28ca94f22e33d27edc311748f7dd4
data/README.md CHANGED
@@ -74,7 +74,8 @@ nginx_build:
74
74
  prefix: /etc/nginx
75
75
  error-log-path: /var/log/nginx/error.log
76
76
  http-log-path: /var/log/nginx/access.log
77
-
77
+ build_target: openresty
78
+ openresty_version: 1.11.2.2
78
79
  ```
79
80
 
80
81
  ## Contributing
@@ -9,6 +9,10 @@ def build_nginx_configure_options
9
9
  nginx_configure_options
10
10
  end
11
11
 
12
+ def openresty?
13
+ node[:nginx_build] && node[:nginx_build][:build_target] && node[:nginx_build][:build_target] == 'openresty'
14
+ end
15
+
12
16
  nginx_build_bin = "/usr/local/bin/"
13
17
  nginx_build_bin = node[:nginx_build][:bin] if node[:nginx_build] && node[:nginx_build][:bin]
14
18
 
@@ -38,12 +42,24 @@ modules3rd_path = node[:nginx_build][:modules3rd_path] if node[:nginx_build] &&
38
42
  nginx_modules3rds = []
39
43
  nginx_modules3rds = node[:nginx_build][:modules3rds] if node[:nginx_build] && node[:nginx_build][:modules3rds]
40
44
 
41
- nginx_version = "1.8.0"
42
- nginx_version = node[:nginx_build][:nginx_version] if node[:nginx_build] && node[:nginx_build][:nginx_version]
43
-
44
45
  build_user = node[:server][:user]
45
46
  build_user = node[:nginx_build][:build_user] if node[:nginx_build] && node[:nginx_build][:build_user]
46
47
 
48
+ configure_command = "#{nginx_build_bin}nginx-build -d work -c #{configure_path} -m #{modules3rd_path}"
49
+ work_dir = ''
50
+ if openresty?
51
+ openresty_version = '1.11.2.2'
52
+ openresty_version = node[:nginx_build][:openresty_version] if node[:nginx_build] && node[:nginx_build][:openresty_version]
53
+ configure_command << " -openresty -openrestyversion #{openresty_version}"
54
+ work_dir = "~/work/openresty/#{openresty_version}/openresty-#{openresty_version}"
55
+ else
56
+ nginx_version = '1.8.0'
57
+ nginx_version = node[:nginx_build][:nginx_version] if node[:nginx_build] && node[:nginx_build][:nginx_version]
58
+ configure_command << " -v #{nginx_version}"
59
+ work_dir = "~/work/nginx/#{nginx_version}/nginx-#{nginx_version}"
60
+ end
61
+ nginx_build_command = "#{configure_command} && cd #{work_dir} && sudo make install"
62
+
47
63
  if configure_path =~ /^(.+)\/([^\/]+)$/
48
64
  directory $1
49
65
 
@@ -78,8 +94,7 @@ if modules3rd_path =~ /^(.+)\/([^\/]+)$/
78
94
  end
79
95
 
80
96
  execute "build-nginx" do
81
- command "#{nginx_build_bin}nginx-build -d work -v #{nginx_version} -c #{configure_path} -m #{modules3rd_path} && \
82
- cd ~/work/nginx/#{nginx_version}/nginx-#{nginx_version} && sudo make install"
97
+ command nginx_build_command
83
98
  user build_user
84
99
  action :nothing
85
100
  end
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module NginxBuild
5
- VERSION = "0.1.5"
5
+ VERSION = "0.1.6"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-nginx_build
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - zaru
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-14 00:00:00.000000000 Z
11
+ date: 2017-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: itamae
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.4.5.1
111
+ rubygems_version: 2.6.8
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Itamae plugin to install nginx-build