itamae-plugin-recipe-selenium 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
+ SHA1:
3
+ metadata.gz: b404d5cbf3b017f81d1f44f3eaf2491793de8b5c
4
+ data.tar.gz: c52939431200932ac94df99316a7617923751545
5
+ SHA512:
6
+ metadata.gz: 8d0b31e07c790dc6c1c1e58a1ac331dfc4e24517216d9953105aaf9453a6e8e45b49704b0c7b26c577069256865a899f0d1e1dcad9d4a6b5ce98ac1df24d1504
7
+ data.tar.gz: ad7882f21919dd7caf69d8dbf4678b3ded000bf33617f4891954663fd0adc9a36b691a3b99b4eeb5f36864785913a18927f166073cc9f0def172638fd6031d23
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /Gemfile.lock
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at atsushi.inoue@probizmo.co.jp. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in itamae-plugin-recipe-selenium.gemspec
6
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 atsushi.inoue
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Itamae::Plugin::Recipe::Selenium
2
+
3
+ itamae recipe for selenium
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'itamae-plugin-recipe-selenium'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install itamae-plugin-recipe-selenium
20
+
21
+ ## Usage
22
+
23
+ Include this recpie as:
24
+
25
+ include_recipe 'selenium'
26
+
27
+ This recipe will install chrome web brawser and selenium webdriver for chrome and gecko.
28
+
29
+ ## Development
30
+
31
+ 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.
32
+
33
+ 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34
+
35
+ ## Contributing
36
+
37
+ Bug reports and pull requests are welcome on GitHub at https://github.com/maedadev/itamae-plugin-recipe-selenium. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
38
+
39
+ ## License
40
+
41
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
42
+
43
+ ## Code of Conduct
44
+
45
+ Everyone interacting in the Itamae::Plugin::Recipe::Selenium project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/maedadev/itamae-plugin-recipe-selenium/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "itamae/plugin/recipe/selenium"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,31 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "itamae/plugin/recipe/selenium/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "itamae-plugin-recipe-selenium"
8
+ spec.version = Itamae::Plugin::Recipe::Selenium::VERSION
9
+ spec.authors = ["y-matsuda"]
10
+ spec.email = ["matsuda@lab.acs-jp.com"]
11
+
12
+ spec.summary = %q{itamae recipe for god process monitoring framework}
13
+ spec.description = %q{itamae recipe for god process monitoring framework}
14
+ spec.homepage = "https://github.com/maedadev/itamae-plugin-recipe-selenium"
15
+ spec.license = "MIT"
16
+
17
+ # Specify which files should be added to the gem when it is released.
18
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ end
22
+ spec.bindir = "exe"
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ["lib"]
25
+
26
+ spec.add_dependency 'itamae', '~> 1.10', '>= 1.10.4'
27
+
28
+ spec.add_development_dependency "bundler", ">= 1.17"
29
+ spec.add_development_dependency "rake", "~> 10.0"
30
+ spec.add_development_dependency "minitest", "~> 5.0"
31
+ end
@@ -0,0 +1,6 @@
1
+ require "itamae/plugin/recipe/selenium/version"
2
+
3
+ include_recipe './selenium/tmp_directory'
4
+ include_recipe './selenium/chrome'
5
+ include_recipe './selenium/chromedriver'
6
+ include_recipe './selenium/geckodriver'
@@ -0,0 +1,8 @@
1
+ package 'google-chrome-stable' do
2
+ user 'root'
3
+ end
4
+
5
+ execute 'yum update -y google-chrome-stable' do
6
+ user 'root'
7
+ not_if "which google-chrome-stable && google-chrome-stable --version | egrep 'Google Chrome (76|77)\.'"
8
+ end
@@ -0,0 +1,29 @@
1
+ require 'net/http'
2
+
3
+ host = 'chromedriver.storage.googleapis.com'
4
+ base_url = 'https://' + host
5
+ browser_version = run_command('sudo yum list | grep google-chrome-stable').stdout.split[1]
6
+ browser_version = Gem::Version.new(browser_version.to_s).segments[0..2].join('.')
7
+ driver_version_url = base_url + "/LATEST_RELEASE_#{browser_version}"
8
+ version = Net::HTTP.get_response(URI(driver_version_url)).body
9
+ download_url = base_url + "/#{version}/chromedriver_linux64.zip"
10
+ header = Net::HTTP.start(host) { |http| http.head("/#{version}/chromedriver_linux64.zip") }
11
+ etag = header['etag'][1...-1]
12
+
13
+ execute "download chromedriver-#{version}" do
14
+ cwd '/tmp/itamae-plugin-recipe-selenium'
15
+ command <<-EOF
16
+ rm -Rf chromedriver_linux64-#{version}*
17
+ curl -o chromedriver_linux64-#{version}.zip #{download_url}
18
+ EOF
19
+ not_if "echo '#{etag} chromedriver_linux64-#{version}.zip' | md5sum -c -"
20
+ end
21
+
22
+ execute "install chromedriver-#{version}" do
23
+ cwd '/tmp/itamae-plugin-recipe-selenium'
24
+ command <<-EOF
25
+ unzip chromedriver_linux64-#{version}.zip
26
+ sudo mv -f chromedriver /usr/local/bin/
27
+ EOF
28
+ not_if "/usr/local/bin/chromedriver -v | grep 'ChromeDriver #{version}'"
29
+ end
@@ -0,0 +1,31 @@
1
+ require 'net/http'
2
+
3
+ base_url = "https://github.com/mozilla/geckodriver/releases"
4
+ url = base_url + '/latest'
5
+ response = nil
6
+ 5.times do
7
+ response = Net::HTTP.get_response(URI(url))
8
+
9
+ break unless response.is_a?(Net::HTTPRedirection)
10
+ url = response['location']
11
+ end
12
+ version = response.uri.to_s[/[^v]*$/]
13
+ download_url = base_url + "/download/v#{version}/geckodriver-v#{version}-linux64.tar.gz"
14
+
15
+ execute "download geckodriver-#{version}" do
16
+ cwd '/tmp/itamae-plugin-recipe-selenium'
17
+ command <<-EOF
18
+ rm -Rf geckodriver-v#{version}-linux64*
19
+ curl -L -o geckodriver-v#{version}-linux64.tar.gz #{download_url}
20
+ EOF
21
+ not_if "test -e geckodriver-v#{version}-linux64.tar.gz"
22
+ end
23
+
24
+ execute "install geckodriver-#{version}" do
25
+ cwd '/tmp/itamae-plugin-recipe-selenium'
26
+ command <<-EOF
27
+ tar zxf geckodriver-v#{version}-linux64.tar.gz
28
+ sudo mv -f geckodriver /usr/local/bin/
29
+ EOF
30
+ not_if "/usr/local/bin/geckodriver -V | grep 'geckodriver #{version}'"
31
+ end
@@ -0,0 +1,6 @@
1
+ directory '/tmp/itamae-plugin-recipe-selenium' do
2
+ user 'root'
3
+ owner ENV['USER']
4
+ group ENV['USER']
5
+ mode '755'
6
+ end
@@ -0,0 +1,9 @@
1
+ module Itamae
2
+ module Plugin
3
+ module Recipe
4
+ module Selenium
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,121 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-plugin-recipe-selenium
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: 2019-08-28 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
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '1.17'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '1.17'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '10.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '10.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: minitest
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '5.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '5.0'
75
+ description: itamae recipe for god process monitoring framework
76
+ email:
77
+ - matsuda@lab.acs-jp.com
78
+ executables: []
79
+ extensions: []
80
+ extra_rdoc_files: []
81
+ files:
82
+ - ".gitignore"
83
+ - CODE_OF_CONDUCT.md
84
+ - Gemfile
85
+ - LICENSE.txt
86
+ - README.md
87
+ - Rakefile
88
+ - bin/console
89
+ - bin/setup
90
+ - itamae-plugin-recipe-selenium.gemspec
91
+ - lib/itamae/plugin/recipe/selenium.rb
92
+ - lib/itamae/plugin/recipe/selenium/chrome.rb
93
+ - lib/itamae/plugin/recipe/selenium/chromedriver.rb
94
+ - lib/itamae/plugin/recipe/selenium/geckodriver.rb
95
+ - lib/itamae/plugin/recipe/selenium/tmp_directory.rb
96
+ - lib/itamae/plugin/recipe/selenium/version.rb
97
+ homepage: https://github.com/maedadev/itamae-plugin-recipe-selenium
98
+ licenses:
99
+ - MIT
100
+ metadata: {}
101
+ post_install_message:
102
+ rdoc_options: []
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ requirements: []
116
+ rubyforge_project:
117
+ rubygems_version: 2.5.2.3
118
+ signing_key:
119
+ specification_version: 4
120
+ summary: itamae recipe for god process monitoring framework
121
+ test_files: []