itamae-plugin-recipe-openresty 0.0.1 → 0.0.2

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: f89efec1e48122b252dbd9218ca1dbc5e5fd51f2
4
- data.tar.gz: c7b2b56851f14337ac97baa61436460a9d36445d
3
+ metadata.gz: e7243dd38145bf70b65578a45576912a5865e1ac
4
+ data.tar.gz: 1301b2564549888afb7f1adf9ef2925ad61adaeb
5
5
  SHA512:
6
- metadata.gz: 7ea7408b218de9560b9fcd531ccb20a8096c46cff0a52ad397ef186a57943397079145351fbe028688af8df3b0630b0f7ea509e6aa9e564bfd7f9b7c77262d79
7
- data.tar.gz: a2c91c07ff8938df69bb81937bfbc1d1a9b48629b088746d388fb161175ee16cd1d22fbc3b060fe4cf9220082a89e72d5e1d1518d6ad2b72d5a4abbb3a200bcb
6
+ metadata.gz: 6858502832bf6e4ac6979f4598cc60b03c063169a0ec1fab206cc59f9056974cc1373d2973dae6caf63571a70ecd48300f7dfef169c242fd65d5bfc73b756eec
7
+ data.tar.gz: 3ac0045c25eb84ca1325aa9133d2ca0950a12044cdf1c9cef99cbed97e276e99255486fca92127ee411d29144f6ebb1739e64f917e52335780a7ecfa698eaae2
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Itamae::Plugin::Recipe::Openresty
2
2
 
3
- TODO: Write a gem description
3
+ Itamae plugin to install [OpenResty](https://openresty.org/) with init scripts
4
4
 
5
5
  ## Installation
6
6
 
@@ -20,11 +20,41 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ Write a following line to your itamae recipe.
24
+
25
+ ```rb
26
+ # recipe.rb
27
+
28
+ # Install openresty from source
29
+ include_recipe 'openresty::source'
30
+ service 'openresty'
31
+ ```
32
+
33
+ Execute it with: `itamae ssh -h ... recipe.rb`.
34
+
35
+ ```yml
36
+ # node.yml
37
+ openresty:
38
+ version: 1.11.2.1
39
+ archive_url: https://openresty.org/download/openresty-1.11.2.1.tar.gz
40
+ work_dir: /tmp/openresty
41
+ install_depends_package: true
42
+ configure_flags:
43
+ prefix: /opt
44
+ with-lua51:
45
+ with-luajit:
46
+ with-pcre-jit:
47
+ with-http_gzip_static_module:
48
+ user: nginx
49
+ group: nginx
50
+ config-path: /opt/nginx/conf/nginx.conf
51
+ pid-path: /opt/nginx/logs/nginx.pid
52
+ sbin-path: /opt/nginx/sbin/nginx
53
+ ```
24
54
 
25
55
  ## Contributing
26
56
 
27
- 1. Fork it ( https://github.com/[my-github-username]/itamae-plugin-recipe-openresty/fork )
57
+ 1. Fork it ( https://github.com/TakatoshiMaeda/itamae-plugin-recipe-openresty/fork )
28
58
  2. Create your feature branch (`git checkout -b my-new-feature`)
29
59
  3. Commit your changes (`git commit -am 'Add some feature'`)
30
60
  4. Push to the branch (`git push origin my-new-feature`)
@@ -4,7 +4,7 @@ module Itamae
4
4
  module Plugin
5
5
  module Recipe
6
6
  module Openresty
7
- DEFAULT_VERSION = '1.7.4.1'.freeze
7
+ DEFAULT_VERSION = '1.11.2.1'.freeze
8
8
 
9
9
  DEFAULT_PACKAGES = {
10
10
  ubuntu: [
@@ -44,7 +44,7 @@ module Itamae
44
44
 
45
45
  metadata = {}
46
46
  metadata[:version] = raw['version'] || DEFAULT_VERSION
47
- metadata[:archive_url] = raw['archive_url'] || "http://openresty.org/download/ngx_openresty-#{metadata[:version]}.tar.gz"
47
+ metadata[:archive_url] = raw['archive_url'] || "https://openresty.org/download/openresty-#{metadata[:version]}.tar.gz"
48
48
  metadata[:work_dir] = raw['work_dir'] || BUILD_WORKING_DIR
49
49
  metadata[:configure_flags] = self.extract_configure_flags(raw['configure_flags'])
50
50
  metadata[:install_depends_package] = raw['install_depends_package'] || true
@@ -3,7 +3,7 @@ require 'itamae/plugin/recipe/openresty'
3
3
  metadata = Itamae::Plugin::Recipe::Openresty.extract_metadata(node)
4
4
 
5
5
  if metadata[:install_depends_package]
6
- Itamae::Plugin::Recipe::Openresty::DEFAULT_PACKAGES[os[:family].to_sym].each do |pkg|
6
+ Itamae::Plugin::Recipe::Openresty::DEFAULT_PACKAGES[node[:platform].to_sym].each do |pkg|
7
7
  package pkg
8
8
  end
9
9
  end
@@ -14,18 +14,18 @@ end
14
14
 
15
15
  execute 'download openresty archive file' do
16
16
  command "wget #{metadata[:archive_url]} -O #{metadata[:work_dir]}/openresty.tar.gz"
17
- not_if "test #{metadata[:work_dir]}/openresty.tar.gz"
17
+ not_if "test -f #{metadata[:work_dir]}/openresty.tar.gz"
18
18
  end
19
19
 
20
20
  execute 'unzip openresty' do
21
21
  command "tar xvfz #{metadata[:work_dir]}/openresty.tar.gz -C #{metadata[:work_dir]}"
22
- not_if "test #{metadata[:work_dir]}/ngx_openresty-#{metadata[:version]}"
22
+ not_if "test -d #{metadata[:work_dir]}/openresty-#{metadata[:version]}"
23
23
  end
24
24
 
25
25
  execute 'build openresty' do
26
- command "cd #{metadata[:work_dir]}/ngx_openresty-#{metadata[:version]} && ./configure #{metadata[:configure_flags].join(' ')} && make && make install"
26
+ command "cd #{metadata[:work_dir]}/openresty-#{metadata[:version]} && ./configure #{metadata[:configure_flags].join(' ')} && make && make install"
27
27
  unless ENV['OPENRESTY_REBUILD'] != nil
28
- not_if "test #{Itamae::Plugin::Recipe::Openresty.sbin_path(node)}"
28
+ not_if "test -f #{Itamae::Plugin::Recipe::Openresty.sbin_path(node)}"
29
29
  end
30
30
  end
31
31
 
@@ -38,7 +38,7 @@ end
38
38
 
39
39
  execute 'setup openresty init script' do
40
40
  command "chmod +x #{init_script_options[:init_script_path]}"
41
- only_if "test #{init_script_options[:init_script_path]}"
41
+ only_if "test -f #{init_script_options[:init_script_path]}"
42
42
  end
43
43
 
44
44
  service 'openresty' do
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module Openresty
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
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-openresty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takatoshi Maeda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-29 00:00:00.000000000 Z
11
+ date: 2016-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  version: '0'
76
76
  requirements: []
77
77
  rubyforge_project:
78
- rubygems_version: 2.2.2
78
+ rubygems_version: 2.4.5.1
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: Itamae openresty recipe plugin