itamae-plugin-recipe-memcached 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bfc20fb68684c4e75d4c6f785ad236ef6db4bb48daeb6419a97bd270a8c7437b
4
+ data.tar.gz: 3c0aec7c1237363b86f7dfb49d51dac3037758b980e803b631a013c0c71ecedf
5
+ SHA512:
6
+ metadata.gz: 0c34d510a599894f2905b31ae5ffd60cdf5ca34333b4a9d979e818ef1e4400f3979090ae5ce215f51a03e7694db5011ef3bc0ce1d68d00b019b5efedcc50728a
7
+ data.tar.gz: 99b7d1d7268d522dfecbb02ec44d1d8b4b4d4d5d3e1dbb317bdcc1ab6dd94964643186e2ec0054e85e8d73e48329112f3d74483ea14b91debd3d30ca97b7323e
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in itamae-plugin-recipe-memcached.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 maedadev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Itamae::Plugin::Recipe::Memcached
2
+
3
+ itamae recipe for memcached.
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ $ bundle add itamae-plugin-recipe-memcached
10
+
11
+ If bundler is not being used to manage dependencies, install the gem by executing:
12
+
13
+ $ gem install itamae-plugin-recipe-memcached
14
+
15
+ ## Usage
16
+
17
+ ```
18
+ include_recipe 'memcached'
19
+ ```
20
+
21
+ ## Development
22
+
23
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
+
25
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
26
+
27
+ ## Contributing
28
+
29
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/itamae-plugin-recipe-memcached.
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ task default: %i[]
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/itamae/plugin/recipe/memcached/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "itamae-plugin-recipe-memcached"
7
+ spec.version = Itamae::Plugin::Recipe::Memcached::VERSION
8
+ spec.authors = ["y-matsuda"]
9
+ spec.email = ["y.matsuda@bizside.biz"]
10
+
11
+ spec.summary = %q{itamae recipe for memcached installation}
12
+ spec.description = %q{itamae recipe for memcached installation}
13
+ spec.homepage = "https://github.com/maedadev/itamae-plugin-recipe-memcached"
14
+ spec.required_ruby_version = ">= 2.5.0"
15
+
16
+ # Specify which files should be added to the gem when it is released.
17
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
+ spec.files = Dir.chdir(__dir__) do
19
+ `git ls-files -z`.split("\x0").reject do |f|
20
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
21
+ end
22
+ end
23
+ spec.bindir = "exe"
24
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
25
+ spec.require_paths = ["lib"]
26
+
27
+ spec.add_dependency 'itamae', '~> 1.10', '>= 1.10.4'
28
+ end
@@ -0,0 +1,43 @@
1
+ memcached_version = ENV['MEMCACHED_VERSION'] || Itamae::Plugin::Recipe::Memcached::MEMCACHED_VERSION
2
+
3
+ package 'libevent-devel' do
4
+ user 'root'
5
+ end
6
+
7
+ execute "download memcached-#{memcached_version}" do
8
+ cwd '/tmp'
9
+ command <<-EOF
10
+ rm -f memcached-#{memcached_version}.tar.gz
11
+ wget https://memcached.org/files/memcached-#{memcached_version}.tar.gz
12
+ EOF
13
+ not_if "test -e /opt/memcached/#{memcached_version}/INSTALLED || echo #{::File.read(::File.join(::File.dirname(__FILE__), "memcached-#{memcached_version}_sha256.txt")).strip} | sha256sum -c"
14
+ end
15
+
16
+ directory '/opt/memcached' do
17
+ user 'root'
18
+ owner 'root'
19
+ group 'root'
20
+ mode '755'
21
+ end
22
+
23
+ execute "install memcached-#{memcached_version}" do
24
+ cwd '/tmp'
25
+ command <<-EOF
26
+ rm -Rf memcached-#{memcached_version}/
27
+ tar zxf memcached-#{memcached_version}.tar.gz
28
+ sudo rm -Rf /opt/memcached/#{memcached_version}
29
+ cd memcached-#{memcached_version}/
30
+ ./configure --prefix=/opt/memcached/#{memcached_version}
31
+ make
32
+ make test
33
+ sudo make install
34
+ sudo touch /opt/memcached/#{memcached_version}/INSTALLED
35
+ EOF
36
+ not_if "test -e /opt/memcached/#{memcached_version}/INSTALLED"
37
+ end
38
+
39
+ link '/opt/memcached/current' do
40
+ to "/opt/memcached/#{memcached_version}"
41
+ user 'root'
42
+ force true
43
+ end
@@ -0,0 +1 @@
1
+ f83aa94cc59ebefeebc7caee65e36041650e1cb27c04917da601ed7c3a7ae544 memcached-1.6.21.tar.gz
@@ -0,0 +1,4 @@
1
+ service 'memcached' do
2
+ user 'root'
3
+ action [:enable, :start]
4
+ end
@@ -0,0 +1,4 @@
1
+ service 'memcached' do
2
+ user 'root'
3
+ action [:disable, :stop]
4
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Itamae
4
+ module Plugin
5
+ module Recipe
6
+ module Memcached
7
+ VERSION = '0.1.0'
8
+
9
+ MEMCACHED_VERSION = [
10
+ MEMCACHED_VERSION_MAJOR = '1',
11
+ MEMCACHED_VERSION_MINOR = '6',
12
+ MEMCACHED_VERSION_REVISION = '21'
13
+ ].join('.')
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "memcached/version"
4
+
5
+ include_recipe './memcached/stop'
6
+ include_recipe './memcached/install.rb'
7
+ include_recipe './memcached/start'
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-plugin-recipe-memcached
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - y-matsuda
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-08-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: itamae
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.10.4
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.10'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.10.4
33
+ description: itamae recipe for memcached installation
34
+ email:
35
+ - y.matsuda@bizside.biz
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - Gemfile
41
+ - LICENSE
42
+ - README.md
43
+ - Rakefile
44
+ - itamae-plugin-recipe-memcached.gemspec
45
+ - lib/itamae/plugin/recipe/memcached.rb
46
+ - lib/itamae/plugin/recipe/memcached/install.rb
47
+ - lib/itamae/plugin/recipe/memcached/memcached-1.6.21_sha256.txt
48
+ - lib/itamae/plugin/recipe/memcached/start.rb
49
+ - lib/itamae/plugin/recipe/memcached/stop.rb
50
+ - lib/itamae/plugin/recipe/memcached/version.rb
51
+ homepage: https://github.com/maedadev/itamae-plugin-recipe-memcached
52
+ licenses: []
53
+ metadata: {}
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 2.5.0
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubygems_version: 3.3.26
70
+ signing_key:
71
+ specification_version: 4
72
+ summary: itamae recipe for memcached installation
73
+ test_files: []