From 26559b6d84255517c6456a8d0ce566dec44457bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suszy=C5=84ski=20Krzysztof?= Date: Mon, 26 Feb 2018 16:24:30 +0100 Subject: [PATCH 01/11] Code import --- .gitignore | 11 +++++ .rspec | 3 ++ .travis.yml | 5 +++ CODE_OF_CONDUCT.md | 74 ++++++++++++++++++++++++++++++++++ Gemfile | 6 +++ LICENSE.txt | 21 ++++++++++ README.md | 43 ++++++++++++++++++++ Rakefile | 6 +++ beaker-puppeter.gemspec | 36 +++++++++++++++++ bin/console | 14 +++++++ bin/setup | 8 ++++ lib/beaker/puppeter.rb | 7 ++++ lib/beaker/puppeter/version.rb | 5 +++ spec/beaker/puppeter_spec.rb | 9 +++++ spec/spec_helper.rb | 14 +++++++ 15 files changed, 262 insertions(+) create mode 100644 .gitignore create mode 100644 .rspec create mode 100644 .travis.yml create mode 100644 CODE_OF_CONDUCT.md create mode 100644 Gemfile create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 Rakefile create mode 100644 beaker-puppeter.gemspec create mode 100755 bin/console create mode 100755 bin/setup create mode 100644 lib/beaker/puppeter.rb create mode 100644 lib/beaker/puppeter/version.rb create mode 100644 spec/beaker/puppeter_spec.rb create mode 100644 spec/spec_helper.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b04a8c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ + +# rspec failure tracking +.rspec_status diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..34c5164 --- /dev/null +++ b/.rspec @@ -0,0 +1,3 @@ +--format documentation +--color +--require spec_helper diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..d359d87 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +sudo: false +language: ruby +rvm: + - 2.4.0 +before_install: gem install bundler -v 1.16.1 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..233ed7d --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at krzysztof.suszynski@coi.gov.pl. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..a1ef0ba --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } + +# Specify your gem's dependencies in beaker-puppeter.gemspec +gemspec diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..3f6def8 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Suszyński Krzysztof + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..f787317 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# Beaker::Puppeter + +Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/beaker/puppeter`. To experiment with that code, run `bin/console` for an interactive prompt. + +TODO: Delete this and the text above, and describe your gem + +## Installation + +Add this line to your application's Gemfile: + +```ruby +gem 'beaker-puppeter' +``` + +And then execute: + + $ bundle + +Or install it yourself as: + + $ gem install beaker-puppeter + +## Usage + +TODO: Write usage instructions here + +## Development + +After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. + +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). + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/cardil/beaker-puppeter. 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. + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). + +## Code of Conduct + +Everyone interacting in the Beaker::Puppeter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/cardil/beaker-puppeter/blob/master/CODE_OF_CONDUCT.md). diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..b7e9ed5 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) + +task :default => :spec diff --git a/beaker-puppeter.gemspec b/beaker-puppeter.gemspec new file mode 100644 index 0000000..eeab06c --- /dev/null +++ b/beaker-puppeter.gemspec @@ -0,0 +1,36 @@ + +lib = File.expand_path("../lib", __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require "beaker/puppeter/version" + +Gem::Specification.new do |spec| + spec.name = "beaker-puppeter" + spec.version = Beaker::Puppeter::VERSION + spec.authors = ["Suszyński Krzysztof"] + spec.email = ["krzysztof.suszynski@coi.gov.pl"] + + spec.summary = %q{TODO: Write a short summary, because RubyGems requires one.} + spec.description = %q{TODO: Write a longer description or delete this line.} + spec.homepage = "TODO: Put your gem's website or public repo URL here." + spec.license = "MIT" + + # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' + # to allow pushing to a single host or delete this section to allow pushing to any host. + if spec.respond_to?(:metadata) + spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" + else + raise "RubyGems 2.0 or newer is required to protect against " \ + "public gem pushes." + end + + spec.files = `git ls-files -z`.split("\x0").reject do |f| + f.match(%r{^(test|spec|features)/}) + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + spec.add_development_dependency "bundler", "~> 1.16" + spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rspec", "~> 3.0" +end diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..b92cf5e --- /dev/null +++ b/bin/console @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require "bundler/setup" +require "beaker/puppeter" + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. + +# (If you use this, don't forget to add pry to your Gemfile!) +# require "pry" +# Pry.start + +require "irb" +IRB.start(__FILE__) diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..dce67d8 --- /dev/null +++ b/bin/setup @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle install + +# Do any other automated setup that you need to do here diff --git a/lib/beaker/puppeter.rb b/lib/beaker/puppeter.rb new file mode 100644 index 0000000..d2c115c --- /dev/null +++ b/lib/beaker/puppeter.rb @@ -0,0 +1,7 @@ +require "beaker/puppeter/version" + +module Beaker + module Puppeter + # Your code goes here... + end +end diff --git a/lib/beaker/puppeter/version.rb b/lib/beaker/puppeter/version.rb new file mode 100644 index 0000000..061dd20 --- /dev/null +++ b/lib/beaker/puppeter/version.rb @@ -0,0 +1,5 @@ +module Beaker + module Puppeter + VERSION = "0.1.0" + end +end diff --git a/spec/beaker/puppeter_spec.rb b/spec/beaker/puppeter_spec.rb new file mode 100644 index 0000000..40940f1 --- /dev/null +++ b/spec/beaker/puppeter_spec.rb @@ -0,0 +1,9 @@ +RSpec.describe Beaker::Puppeter do + it "has a version number" do + expect(Beaker::Puppeter::VERSION).not_to be nil + end + + it "does something useful" do + expect(false).to eq(true) + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..082805f --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,14 @@ +require "bundler/setup" +require "beaker/puppeter" + +RSpec.configure do |config| + # Enable flags like --only-failures and --next-failure + config.example_status_persistence_file_path = ".rspec_status" + + # Disable RSpec exposing methods globally on `Module` and `main` + config.disable_monkey_patching! + + config.expect_with :rspec do |c| + c.syntax = :expect + end +end From ddea058b6ff930c30e28440fd980a311606e92a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suszy=C5=84ski=20Krzysztof?= Date: Fri, 25 May 2018 13:47:10 +0200 Subject: [PATCH 02/11] Opetration is complete --- .gitignore | 1 + Gemfile | 14 +- Gemfile.lock | 234 ++++++++++++++++++ LICENSE.txt | 28 +-- README.md | 18 +- Rakefile | 11 +- beaker-puppeter.gemspec | 23 +- bin/console | 14 -- bin/setup | 8 - lib/beaker/puppeter.rb | 43 +++- lib/beaker/puppeter/executor.rb | 38 +++ lib/beaker/puppeter/version.rb | 2 +- spec/acceptance/answers/agent-pc3x.yml | 3 + spec/acceptance/answers/agent-pc4x.yml | 3 + spec/acceptance/answers/agent-pc5x.yml | 3 + spec/acceptance/answers/agent-system.yml | 3 + spec/acceptance/answers/default.yml | 3 + spec/acceptance/complete_spec.rb | 12 + spec/acceptance/nodesets/centos-6-docker.yml | 20 ++ spec/acceptance/nodesets/centos-6-vagrant.yml | 15 ++ spec/acceptance/nodesets/centos-7-docker.yml | 21 ++ spec/acceptance/nodesets/centos-7-vagrant.yml | 15 ++ spec/acceptance/nodesets/debian-7-docker.yml | 19 ++ spec/acceptance/nodesets/debian-7-vagrant.yml | 15 ++ spec/acceptance/nodesets/debian-8-docker.yml | 21 ++ spec/acceptance/nodesets/debian-8-vagrant.yml | 15 ++ spec/acceptance/nodesets/default.yml | 15 ++ spec/acceptance/nodesets/ol-6-docker.yml | 20 ++ spec/acceptance/nodesets/ol-6-vagrant.yml | 15 ++ spec/acceptance/nodesets/ol-7-docker.yml | 21 ++ spec/acceptance/nodesets/ol-7-vagrant.yml | 15 ++ .../nodesets/ubuntu-14.04-docker.yml | 22 ++ .../nodesets/ubuntu-14.04-vagrant.yml | 15 ++ .../nodesets/ubuntu-16.04-docker.yml | 20 ++ .../nodesets/ubuntu-16.04-vagrant.yml | 15 ++ spec/beaker/puppeter/version_spec.rb | 11 + spec/beaker/puppeter_spec.rb | 9 - spec/spec_helper.rb | 10 +- spec/spec_helper_acceptance.rb | 7 + 39 files changed, 706 insertions(+), 91 deletions(-) create mode 100644 Gemfile.lock delete mode 100755 bin/console delete mode 100755 bin/setup create mode 100644 lib/beaker/puppeter/executor.rb create mode 100644 spec/acceptance/answers/agent-pc3x.yml create mode 100644 spec/acceptance/answers/agent-pc4x.yml create mode 100644 spec/acceptance/answers/agent-pc5x.yml create mode 100644 spec/acceptance/answers/agent-system.yml create mode 100644 spec/acceptance/answers/default.yml create mode 100644 spec/acceptance/complete_spec.rb create mode 100644 spec/acceptance/nodesets/centos-6-docker.yml create mode 100644 spec/acceptance/nodesets/centos-6-vagrant.yml create mode 100644 spec/acceptance/nodesets/centos-7-docker.yml create mode 100644 spec/acceptance/nodesets/centos-7-vagrant.yml create mode 100644 spec/acceptance/nodesets/debian-7-docker.yml create mode 100644 spec/acceptance/nodesets/debian-7-vagrant.yml create mode 100644 spec/acceptance/nodesets/debian-8-docker.yml create mode 100644 spec/acceptance/nodesets/debian-8-vagrant.yml create mode 100644 spec/acceptance/nodesets/default.yml create mode 100644 spec/acceptance/nodesets/ol-6-docker.yml create mode 100644 spec/acceptance/nodesets/ol-6-vagrant.yml create mode 100644 spec/acceptance/nodesets/ol-7-docker.yml create mode 100644 spec/acceptance/nodesets/ol-7-vagrant.yml create mode 100644 spec/acceptance/nodesets/ubuntu-14.04-docker.yml create mode 100644 spec/acceptance/nodesets/ubuntu-14.04-vagrant.yml create mode 100644 spec/acceptance/nodesets/ubuntu-16.04-docker.yml create mode 100644 spec/acceptance/nodesets/ubuntu-16.04-vagrant.yml create mode 100644 spec/beaker/puppeter/version_spec.rb delete mode 100644 spec/beaker/puppeter_spec.rb create mode 100644 spec/spec_helper_acceptance.rb diff --git a/.gitignore b/.gitignore index b04a8c8..7047da8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /pkg/ /spec/reports/ /tmp/ +/log/ # rspec failure tracking .rspec_status diff --git a/Gemfile b/Gemfile index a1ef0ba..bee3914 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,16 @@ source "https://rubygems.org" -git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } - # Specify your gem's dependencies in beaker-puppeter.gemspec gemspec + +group :acceptancetests do + gem 'beaker', require: false + gem 'beaker-rspec', require: false + gem 'beaker-vagrant', require: false + gem 'vagrant-wrapper', require: false +end + +group :development do + gem 'pry', require: false + gem 'pry-byebug', require: false +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..d5e0445 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,234 @@ +PATH + remote: . + specs: + beaker-puppeter (0.1.0) + +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.3.6) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + ansi (1.5.0) + ast (2.4.0) + aws-sdk-v1 (1.67.0) + json (~> 1.4) + nokogiri (~> 1) + beaker (3.35.0) + beaker-abs (~> 0.4) + beaker-aws (~> 0.1) + beaker-docker (~> 0.1) + beaker-google (~> 0.1) + beaker-hiera (~> 0.0) + beaker-hostgenerator + beaker-openstack (~> 0.1) + beaker-puppet (~> 0.0) + beaker-vagrant (~> 0.1) + beaker-vcloud (~> 0.1) + beaker-vmpooler (~> 1.0) + beaker-vmware (~> 0.1) + hocon (~> 1.0) + in-parallel (~> 0.1) + inifile (~> 3.0) + minitar (~> 0.6) + minitest (~> 5.4) + net-scp (~> 1.2) + net-ssh (~> 4.0) + open_uri_redirections (~> 0.2.1) + pry-byebug (~> 3.4.2) + rb-readline (~> 0.5.3) + rsync (~> 1.0.9) + stringify-hash (~> 0.0) + thor (~> 0.19) + beaker-abs (0.5.0) + beaker-aws (0.4.0) + aws-sdk-v1 (~> 1.57) + stringify-hash (~> 0.0.0) + beaker-docker (0.3.3) + docker-api + stringify-hash (~> 0.0.0) + beaker-google (0.1.0) + google-api-client (~> 0.9) + stringify-hash (~> 0.0.0) + beaker-hiera (0.1.1) + stringify-hash (~> 0.0.0) + beaker-hostgenerator (1.1.12) + deep_merge (~> 1.0) + stringify-hash (~> 0.0.0) + beaker-openstack (0.2.0) + fog-openstack + stringify-hash (~> 0.0.0) + beaker-puppet (0.15.2) + in-parallel (~> 0.1) + oga + stringify-hash (~> 0.0.0) + beaker-rspec (6.2.3) + beaker (~> 3.0) + rspec (~> 3.0) + serverspec (~> 2) + specinfra (~> 2) + beaker-vagrant (0.5.0) + stringify-hash (~> 0.0.0) + beaker-vcloud (0.2.0) + beaker-vmpooler + beaker-vmware + rbvmomi (~> 1.9) + stringify-hash (~> 0.0.0) + beaker-vmpooler (1.2.0) + stringify-hash (~> 0.0.0) + beaker-vmware (0.2.0) + fission (~> 0.4) + rbvmomi (~> 1.9) + stringify-hash (~> 0.0.0) + builder (3.2.3) + byebug (9.0.6) + coderay (1.1.2) + declarative (0.0.10) + declarative-option (0.1.0) + deep_merge (1.2.1) + diff-lcs (1.3) + docker-api (1.34.2) + excon (>= 0.47.0) + multi_json + excon (0.62.0) + faraday (0.15.2) + multipart-post (>= 1.2, < 3) + fission (0.5.0) + CFPropertyList (~> 2.2) + fog-core (1.45.0) + builder + excon (~> 0.58) + formatador (~> 0.2) + fog-json (1.0.2) + fog-core (~> 1.0) + multi_json (~> 1.10) + fog-openstack (0.1.25) + fog-core (~> 1.40) + fog-json (>= 1.0) + ipaddress (>= 0.8) + formatador (0.2.5) + google-api-client (0.21.2) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.5, < 0.7.0) + httpclient (>= 2.8.1, < 3.0) + mime-types (~> 3.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.0) + googleauth (0.6.2) + faraday (~> 0.12) + jwt (>= 1.4, < 3.0) + logging (~> 2.0) + memoist (~> 0.12) + multi_json (~> 1.11) + os (~> 0.9) + signet (~> 0.7) + hocon (1.2.5) + httpclient (2.8.3) + in-parallel (0.1.17) + inifile (3.0.0) + ipaddress (0.8.3) + json (1.8.6) + jwt (2.1.0) + little-plugger (1.1.4) + logging (2.2.2) + little-plugger (~> 1.1) + multi_json (~> 1.10) + memoist (0.16.0) + method_source (0.9.0) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.3.0) + minitar (0.6.1) + minitest (5.11.3) + multi_json (1.13.1) + multipart-post (2.0.0) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (4.2.0) + net-telnet (0.1.1) + nokogiri (1.8.2) + mini_portile2 (~> 2.3.0) + oga (2.15) + ast + ruby-ll (~> 2.1) + open_uri_redirections (0.2.1) + os (0.9.6) + pry (0.11.3) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + pry-byebug (3.4.3) + byebug (>= 9.0, < 9.1) + pry (~> 0.10) + public_suffix (3.0.2) + rake (10.5.0) + rb-readline (0.5.5) + rbvmomi (1.12.0) + builder (~> 3.0) + json (>= 1.8) + nokogiri (~> 1.5) + trollop (~> 2.1) + representable (3.0.4) + declarative (< 0.1.0) + declarative-option (< 0.2.0) + uber (< 0.2.0) + retriable (3.1.1) + rspec (3.7.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-core (3.7.1) + rspec-support (~> 3.7.0) + rspec-expectations (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-its (1.2.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-support (3.7.1) + rsync (1.0.9) + ruby-ll (2.1.2) + ansi + ast + serverspec (2.41.3) + multi_json + rspec (~> 3.0) + rspec-its + specinfra (~> 2.72) + sfl (2.3) + signet (0.8.1) + addressable (~> 2.3) + faraday (~> 0.9) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + specinfra (2.73.3) + net-scp + net-ssh (>= 2.7, < 5.0) + net-telnet + sfl + stringify-hash (0.0.2) + thor (0.20.0) + trollop (2.1.2) + uber (0.1.0) + vagrant-wrapper (2.0.3) + +PLATFORMS + ruby + +DEPENDENCIES + beaker + beaker-puppeter! + beaker-rspec + beaker-vagrant + bundler (~> 1.16) + pry + pry-byebug + rake (~> 10.0) + rspec (~> 3.0) + vagrant-wrapper + +BUNDLED WITH + 1.16.1 diff --git a/LICENSE.txt b/LICENSE.txt index 3f6def8..111a414 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,21 +1,13 @@ -The MIT License (MIT) +Copyright (c) 2018 Center for Information Technology -Copyright (c) 2018 Suszyński Krzysztof +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + http://www.apache.org/licenses/LICENSE-2.0 -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/README.md b/README.md index f787317..1903144 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,19 @@ # Beaker::Puppeter -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/beaker/puppeter`. To experiment with that code, run `bin/console` for an interactive prompt. - -TODO: Delete this and the text above, and describe your gem +This plugin integrates Puppeter into Beaker testing framework, by installing and running it with provided answer files. ## Installation -Add this line to your application's Gemfile: +Add this line to your module's Gemfile: ```ruby -gem 'beaker-puppeter' +gem 'beaker-puppeter', require: false ``` And then execute: $ bundle -Or install it yourself as: - - $ gem install beaker-puppeter - ## Usage TODO: Write usage instructions here @@ -32,12 +26,12 @@ To install this gem onto your local machine, run `bundle exec rake install`. To ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/cardil/beaker-puppeter. 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. +Bug reports and pull requests are welcome on GitHub at https://github.com/coi-gov-pl/beaker-puppeter. 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. ## License -The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). +The gem is available as open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0). ## Code of Conduct -Everyone interacting in the Beaker::Puppeter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/cardil/beaker-puppeter/blob/master/CODE_OF_CONDUCT.md). +Everyone interacting in the Beaker::Puppeter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/coi-gov-pl/beaker-puppeter/blob/master/CODE_OF_CONDUCT.md). diff --git a/Rakefile b/Rakefile index b7e9ed5..87191d9 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,13 @@ require "bundler/gem_tasks" require "rspec/core/rake_task" -RSpec::Core::RakeTask.new(:spec) +RSpec::Core::RakeTask.new(:spec) do |t| + t.pattern = 'spec/beaker/**/*_spec.rb' +end -task :default => :spec +desc 'Run Beaker acceptance self-test' +RSpec::Core::RakeTask.new(:acceptance) do |t| + t.pattern = 'spec/acceptance/**/*_spec.rb' +end + +task :default => [ :spec, :acceptance ] diff --git a/beaker-puppeter.gemspec b/beaker-puppeter.gemspec index eeab06c..142b775 100644 --- a/beaker-puppeter.gemspec +++ b/beaker-puppeter.gemspec @@ -9,25 +9,18 @@ Gem::Specification.new do |spec| spec.authors = ["Suszyński Krzysztof"] spec.email = ["krzysztof.suszynski@coi.gov.pl"] - spec.summary = %q{TODO: Write a short summary, because RubyGems requires one.} - spec.description = %q{TODO: Write a longer description or delete this line.} - spec.homepage = "TODO: Put your gem's website or public repo URL here." - spec.license = "MIT" - - # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' - # to allow pushing to a single host or delete this section to allow pushing to any host. - if spec.respond_to?(:metadata) - spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" - else - raise "RubyGems 2.0 or newer is required to protect against " \ - "public gem pushes." - end + spec.summary = "Integrates Puppeter into Beaker by adding extra helper methods" + spec.description = <<~eos + Puppeter is a automated, unattended, Puppet installer, and beaker-puppeter + is a Beaker extension that adds helper methods to use in your + spec_helper_acceptance file. + eos + spec.homepage = "https://github.com/coi-gov-pl/gem-beaker-puppeter" + spec.license = "Apache-2.0" spec.files = `git ls-files -z`.split("\x0").reject do |f| f.match(%r{^(test|spec|features)/}) end - spec.bindir = "exe" - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.16" diff --git a/bin/console b/bin/console deleted file mode 100755 index b92cf5e..0000000 --- a/bin/console +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby - -require "bundler/setup" -require "beaker/puppeter" - -# You can add fixtures and/or initialization code here to make experimenting -# with your gem easier. You can also use a different console, if you like. - -# (If you use this, don't forget to add pry to your Gemfile!) -# require "pry" -# Pry.start - -require "irb" -IRB.start(__FILE__) diff --git a/bin/setup b/bin/setup deleted file mode 100755 index dce67d8..0000000 --- a/bin/setup +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -IFS=$'\n\t' -set -vx - -bundle install - -# Do any other automated setup that you need to do here diff --git a/lib/beaker/puppeter.rb b/lib/beaker/puppeter.rb index d2c115c..a21c158 100644 --- a/lib/beaker/puppeter.rb +++ b/lib/beaker/puppeter.rb @@ -1,7 +1,46 @@ -require "beaker/puppeter/version" +require 'beaker/puppeter/version' +require 'beaker/puppeter/executor' module Beaker module Puppeter - # Your code goes here... + PUPPETER_SCRIPT_KEY = 'PUPPETER_ANSWERS' + PUPPETER_SCRIPT_DEFAULT_VALUE = 'default' + + def run_puppeter(answers = :auto) + run_puppeter_on(hosts, answers) + end + + def run_puppeter_on(hosts, answers = :auto) + if answers == :auto + answers = ENV.fetch(PUPPETER_SCRIPT_KEY, PUPPETER_SCRIPT_DEFAULT_VALUE) + end + + install_puppeter_on hosts + hosts.each do |host| + execute_puppeter_on(host).with(answers) + end + end + + private + + def install_puppeter_on(hosts) + hosts.each do |host| + ensure_curl_on host + on host, 'curl https://raw.githubusercontent.com/coi-gov-pl/puppeter/master/setup.sh | bash' + end + end + + def execute_puppeter_on(host) + Beaker::Puppeter::Executor.new(host) + end + + def ensure_curl_on(host) + pkg = 'curl' + unless host.check_for_package pkg + host.install_package pkg + end + end end end + +include Beaker::Puppeter diff --git a/lib/beaker/puppeter/executor.rb b/lib/beaker/puppeter/executor.rb new file mode 100644 index 0000000..e3630b4 --- /dev/null +++ b/lib/beaker/puppeter/executor.rb @@ -0,0 +1,38 @@ +module Beaker + module Puppeter + class Executor + + def initialize(host) + @host = host + @puppeter_ver = nil + end + + def with(answers) + root = Pathname.new '.' + answers_dir = root.join('spec') + .join('acceptance') + .join('answers') + answers_file = answers_dir.join("#{answers}.yml") + ver = infra_version + logger.debug "Installing Puppet via #{ver} on #{@host} with #{answers_file}" + copied = copy_answers answers_file + on @host, "puppeter --answers #{copied} > /tmp/puppeter-script.sh" + on @host, 'bash /tmp/puppeter-script.sh' + end + + private + + def copy_answers(answers_file) + target_file = Dir::Tmpname.make_tmpname('/tmp/puppeter-answers', nil) + scp_to @host, answers_file, target_file + target_file + end + + def infra_version + @puppeter_ver = on @host, 'puppeter --version' if @puppeter_ver.nil? + @puppeter_ver.stdout.strip + end + + end + end +end diff --git a/lib/beaker/puppeter/version.rb b/lib/beaker/puppeter/version.rb index 061dd20..693269a 100644 --- a/lib/beaker/puppeter/version.rb +++ b/lib/beaker/puppeter/version.rb @@ -1,5 +1,5 @@ module Beaker module Puppeter - VERSION = "0.1.0" + VERSION = '0.1.0' end end diff --git a/spec/acceptance/answers/agent-pc3x.yml b/spec/acceptance/answers/agent-pc3x.yml new file mode 100644 index 0000000..3b4737a --- /dev/null +++ b/spec/acceptance/answers/agent-pc3x.yml @@ -0,0 +1,3 @@ +installer: + mode: Agent + type: pc3x diff --git a/spec/acceptance/answers/agent-pc4x.yml b/spec/acceptance/answers/agent-pc4x.yml new file mode 100644 index 0000000..c040b73 --- /dev/null +++ b/spec/acceptance/answers/agent-pc4x.yml @@ -0,0 +1,3 @@ +installer: + mode: Agent + type: pc4x diff --git a/spec/acceptance/answers/agent-pc5x.yml b/spec/acceptance/answers/agent-pc5x.yml new file mode 100644 index 0000000..a0839cc --- /dev/null +++ b/spec/acceptance/answers/agent-pc5x.yml @@ -0,0 +1,3 @@ +installer: + mode: Agent + type: pc5x diff --git a/spec/acceptance/answers/agent-system.yml b/spec/acceptance/answers/agent-system.yml new file mode 100644 index 0000000..54d29c1 --- /dev/null +++ b/spec/acceptance/answers/agent-system.yml @@ -0,0 +1,3 @@ +installer: + mode: Agent + type: system diff --git a/spec/acceptance/answers/default.yml b/spec/acceptance/answers/default.yml new file mode 100644 index 0000000..a0839cc --- /dev/null +++ b/spec/acceptance/answers/default.yml @@ -0,0 +1,3 @@ +installer: + mode: Agent + type: pc5x diff --git a/spec/acceptance/complete_spec.rb b/spec/acceptance/complete_spec.rb new file mode 100644 index 0000000..9ba0be6 --- /dev/null +++ b/spec/acceptance/complete_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper_acceptance' + +describe 'beaker::puppeter' do + it 'should work install Puppet with no errors' do + result = run_puppeter + expect(result).to be_truthy + end + + describe command('puppet --version') do + its(:stdout) { should match /^\d+\.\d+\.\d+$/ } + end +end diff --git a/spec/acceptance/nodesets/centos-6-docker.yml b/spec/acceptance/nodesets/centos-6-docker.yml new file mode 100644 index 0000000..be143f0 --- /dev/null +++ b/spec/acceptance/nodesets/centos-6-docker.yml @@ -0,0 +1,20 @@ +HOSTS: + centos-6-docker: + platform: el-6-x86_64 + hypervisor: docker + image: centos:6 + docker_preserve_image: true + docker_image_commands: + - "sed -i 's/keepcache=0/keepcache=1/g' /etc/yum.conf" + - 'yum install -y crontabs wget' + mount_folders: + wget_cache: + host_path: /tmp/docker-cache/wget + container_path: /var/cache/wget + yum_cache: + host_path: /tmp/docker-cache/yum/centos-6-docker + container_path: /var/cache/yum +CONFIG: + trace_limit: 200 + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/centos-6-vagrant.yml b/spec/acceptance/nodesets/centos-6-vagrant.yml new file mode 100644 index 0000000..5bc668c --- /dev/null +++ b/spec/acceptance/nodesets/centos-6-vagrant.yml @@ -0,0 +1,15 @@ +HOSTS: + centos-6-vagrant: + platform: el-6-x86_64 + hypervisor: vagrant + box: boxcutter-centos68 + mount_folders: + wget_cache: + from: /tmp/vagrant-cache/wget + to: /var/cache/wget + yum_cache: + from: /tmp/vagrant-cache/yum/centos-6-vagrant + to: /var/cache/yum +CONFIG: + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/centos-7-docker.yml b/spec/acceptance/nodesets/centos-7-docker.yml new file mode 100644 index 0000000..df5efe0 --- /dev/null +++ b/spec/acceptance/nodesets/centos-7-docker.yml @@ -0,0 +1,21 @@ +HOSTS: + centos-7-docker: + platform: el-7-x86_64 + hypervisor: docker + image: centos:7 + docker_preserve_image: true + docker_cmd: '["/usr/sbin/init"]' + # install various tools required to get the image up to usable levels + docker_image_commands: + - 'yum install -y crontabs tar wget openssl sysvinit-tools iproute which initscripts' + mount_folders: + wget_cache: + host_path: /tmp/docker-cache/wget + container_path: /var/cache/wget + yum_cache: + host_path: /tmp/docker-cache/yum/centos-7-docker + container_path: /var/cache/yum +CONFIG: + trace_limit: 200 + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/centos-7-vagrant.yml b/spec/acceptance/nodesets/centos-7-vagrant.yml new file mode 100644 index 0000000..0ef68d7 --- /dev/null +++ b/spec/acceptance/nodesets/centos-7-vagrant.yml @@ -0,0 +1,15 @@ +HOSTS: + centos-7-vagrant: + platform: el-7-x86_64 + hypervisor: vagrant + box: boxcutter-centos73 + mount_folders: + wget_cache: + from: /tmp/vagrant-cache/wget + to: /var/cache/wget + yum_cache: + from: /tmp/vagrant-cache/yum/centos-7-vagrant + to: /var/cache/yum +CONFIG: + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/debian-7-docker.yml b/spec/acceptance/nodesets/debian-7-docker.yml new file mode 100644 index 0000000..4cef22f --- /dev/null +++ b/spec/acceptance/nodesets/debian-7-docker.yml @@ -0,0 +1,19 @@ +HOSTS: + debian-7-docker: + platform: debian-7-amd64 + hypervisor : docker + image: debian:7 + docker_preserve_image: true + docker_cmd: '["/sbin/init"]' + docker_image_commands: + - 'apt-get update && apt-get install -y cron locales-all net-tools wget' + mount_folders: + wget_cache: + host_path: /tmp/wget_cache + container_path: /var/cache/wget + apt_cache: + host_path: /tmp/apt_cache/debian-7-amd64 + container_path: /var/cache/apt +CONFIG: + type: foss +log_level: debug diff --git a/spec/acceptance/nodesets/debian-7-vagrant.yml b/spec/acceptance/nodesets/debian-7-vagrant.yml new file mode 100644 index 0000000..4f68c77 --- /dev/null +++ b/spec/acceptance/nodesets/debian-7-vagrant.yml @@ -0,0 +1,15 @@ +HOSTS: + debian-7-vagrant: + platform: debian-7-amd64 + hypervisor: vagrant + box: puppetlabs/debian-7.8-64-nocm + mount_folders: + wget_cache: + from: /tmp/vagrant-cache/wget + to: /var/cache/wget + apt_cache: + from: /tmp/vagrant-cache/apt/debian-7-vagrant + to: /var/cache/apt/archives +CONFIG: + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/debian-8-docker.yml b/spec/acceptance/nodesets/debian-8-docker.yml new file mode 100644 index 0000000..7df929c --- /dev/null +++ b/spec/acceptance/nodesets/debian-8-docker.yml @@ -0,0 +1,21 @@ +HOSTS: + debian-8-docker: + platform: debian-8-amd64 + hypervisor : docker + image: debian:8 + docker_preserve_image: true + docker_cmd: ["/bin/systemd"] + docker_preserve_image: true + docker_image_commands: + - apt-get install -y wget net-tools + - rm /lib/systemd/system/getty.target + mount_folders: + wget_cache: + host_path: /tmp/wget_cache + container_path: /var/cache/wget + apt_cache: + host_path: /tmp/apt_cache/debian-8-amd64 + container_path: /var/cache/apt +CONFIG: + type: foss +log_level: debug diff --git a/spec/acceptance/nodesets/debian-8-vagrant.yml b/spec/acceptance/nodesets/debian-8-vagrant.yml new file mode 100644 index 0000000..e5fa6eb --- /dev/null +++ b/spec/acceptance/nodesets/debian-8-vagrant.yml @@ -0,0 +1,15 @@ +HOSTS: + debian-8-vagrant: + platform: debian-8-amd64 + hypervisor: vagrant + box: puppetlabs/debian-8.2-64-nocm + mount_folders: + wget_cache: + from: /tmp/vagrant-cache/wget + to: /var/cache/wget + apt_cache: + from: /tmp/vagrant-cache/apt/debian-8-vagrant + to: /var/cache/apt/archives +CONFIG: + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml new file mode 100644 index 0000000..a5137aa --- /dev/null +++ b/spec/acceptance/nodesets/default.yml @@ -0,0 +1,15 @@ +HOSTS: + default-ol-6-vagrant: + platform: el-6-x86_64 + hypervisor: vagrant + box: boxcutter-ol68 + mount_folders: + wget_cache: + from: /tmp/vagrant-cache/wget + to: /var/cache/wget + yum_cache: + from: /tmp/vagrant-cache/wget/ol-6-vagrant + to: /var/cache/yum +CONFIG: + type: foss + log_level: info diff --git a/spec/acceptance/nodesets/ol-6-docker.yml b/spec/acceptance/nodesets/ol-6-docker.yml new file mode 100644 index 0000000..da0dd7d --- /dev/null +++ b/spec/acceptance/nodesets/ol-6-docker.yml @@ -0,0 +1,20 @@ +HOSTS: + ol-6-docker: + platform: el-6-x86_64 + hypervisor: docker + image: oraclelinux:6 + docker_preserve_image: true + docker_image_commands: + - "sed -i 's/keepcache=0/keepcache=1/g' /etc/yum.conf" + - 'yum install -y crontabs wget' + mount_folders: + wget_cache: + host_path: /tmp/docker-cache/wget + container_path: /var/cache/wget + yum_cache: + host_path: /tmp/docker-cache/yum/ol-6-docker + container_path: /var/cache/yum +CONFIG: + trace_limit: 200 + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/ol-6-vagrant.yml b/spec/acceptance/nodesets/ol-6-vagrant.yml new file mode 100644 index 0000000..ea2fe8d --- /dev/null +++ b/spec/acceptance/nodesets/ol-6-vagrant.yml @@ -0,0 +1,15 @@ +HOSTS: + ol-6-vagrant: + platform: el-6-x86_64 + hypervisor: vagrant + box: boxcutter-ol68 + mount_folders: + wget_cache: + from: /tmp/vagrant-cache/wget + to: /var/cache/wget + yum_cache: + from: /tmp/vagrant-cache/yum/ol-6-vagrant + to: /var/cache/yum +CONFIG: + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/ol-7-docker.yml b/spec/acceptance/nodesets/ol-7-docker.yml new file mode 100644 index 0000000..6aef9df --- /dev/null +++ b/spec/acceptance/nodesets/ol-7-docker.yml @@ -0,0 +1,21 @@ +HOSTS: + ol-7-docker: + platform: el-7-x86_64 + hypervisor: docker + image: oraclelinux:7 + docker_preserve_image: true + docker_cmd: '["/usr/sbin/init"]' + # install various tools required to get the image up to usable levels + docker_image_commands: + - 'yum install -y crontabs tar wget openssl sysvinit-tools iproute which initscripts' + mount_folders: + wget_cache: + host_path: /tmp/docker-cache/wget + container_path: /var/cache/wget + yum_cache: + host_path: /tmp/docker-cache/yum/ol-7-docker + container_path: /var/cache/yum +CONFIG: + trace_limit: 200 + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/ol-7-vagrant.yml b/spec/acceptance/nodesets/ol-7-vagrant.yml new file mode 100644 index 0000000..c81025d --- /dev/null +++ b/spec/acceptance/nodesets/ol-7-vagrant.yml @@ -0,0 +1,15 @@ +HOSTS: + ol-7-vagrant: + platform: el-7-x86_64 + hypervisor: vagrant + box: boxcutter-ol73 + mount_folders: + wget_cache: + from: /tmp/vagrant-cache/wget + to: /var/cache/wget + yum_cache: + from: /tmp/vagrant-cache/yum/ol-7-vagrant + to: /var/cache/yum +CONFIG: + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/ubuntu-14.04-docker.yml b/spec/acceptance/nodesets/ubuntu-14.04-docker.yml new file mode 100644 index 0000000..dca606b --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-14.04-docker.yml @@ -0,0 +1,22 @@ +HOSTS: + ubuntu-1404-docker: + platform: ubuntu-14.04-amd64 + hypervisor: docker + image: ubuntu:14.04 + docker_preserve_image: true + docker_cmd: '["/sbin/init"]' + docker_image_commands: + - 'rm /usr/sbin/policy-rc.d' + - 'rm /sbin/initctl; dpkg-divert --rename --remove /sbin/initctl' + - 'apt-get install -y net-tools wget' + - 'locale-gen en_US.UTF-8' + mount_folders: + wget_cache: + host_path: /tmp/docker-cache/wget + container_path: /var/cache/wget + apt_cache: + host_path: /tmp/docker-cache/apt/ubuntu-1404-docker + container_path: /var/cache/apt/archives +CONFIG: + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/ubuntu-14.04-vagrant.yml b/spec/acceptance/nodesets/ubuntu-14.04-vagrant.yml new file mode 100644 index 0000000..905a11e --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-14.04-vagrant.yml @@ -0,0 +1,15 @@ +HOSTS: + ubuntu-1404-vagrant: + platform: ubuntu-14.04-amd64 + hypervisor: vagrant + box: boxcutter-ubuntu1404 + mount_folders: + wget_cache: + from: /tmp/vagrant-cache/wget + to: /var/cache/wget + apt_cache: + from: /tmp/vagrant-cache/apt/ubuntu-1404-vagrant + to: /var/cache/apt/archives +CONFIG: + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/ubuntu-16.04-docker.yml b/spec/acceptance/nodesets/ubuntu-16.04-docker.yml new file mode 100644 index 0000000..76b66e1 --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-16.04-docker.yml @@ -0,0 +1,20 @@ +HOSTS: + ubuntu-1604-docker: + platform: ubuntu-16.04-amd64 + hypervisor: docker + image: ubuntu:16.04 + docker_preserve_image: true + docker_cmd: '["/sbin/init"]' + docker_image_commands: + - 'apt-get install -y net-tools wget locales' + - 'locale-gen en_US.UTF-8' + mount_folders: + wget_cache: + host_path: /tmp/docker-cache/wget + container_path: /var/cache/wget + apt_cache: + host_path: /tmp/docker-cache/apt/ubuntu-1604-docker + container_path: /var/cache/apt/archives +CONFIG: + type: foss + log_level: debug diff --git a/spec/acceptance/nodesets/ubuntu-16.04-vagrant.yml b/spec/acceptance/nodesets/ubuntu-16.04-vagrant.yml new file mode 100644 index 0000000..e276d8d --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-16.04-vagrant.yml @@ -0,0 +1,15 @@ +HOSTS: + ubuntu-1604-vagrant: + platform: ubuntu-16.04-amd64 + hypervisor: vagrant + box: boxcutter-ubuntu1604 + mount_folders: + wget_cache: + from: /tmp/vagrant-cache/wget + to: /var/cache/wget + apt_cache: + from: /tmp/vagrant-cache/apt/ubuntu-1604-vagrant + to: /var/cache/apt/archives +CONFIG: + type: foss + log_level: debug diff --git a/spec/beaker/puppeter/version_spec.rb b/spec/beaker/puppeter/version_spec.rb new file mode 100644 index 0000000..dc67c1e --- /dev/null +++ b/spec/beaker/puppeter/version_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe Beaker::Puppeter do + it 'has a version number' do + expect(Beaker::Puppeter::VERSION).not_to be nil + end + + it 'version number is semantic' do + expect(Beaker::Puppeter::VERSION).to match /^\d+\.\d+\.\d+$/ + end +end diff --git a/spec/beaker/puppeter_spec.rb b/spec/beaker/puppeter_spec.rb deleted file mode 100644 index 40940f1..0000000 --- a/spec/beaker/puppeter_spec.rb +++ /dev/null @@ -1,9 +0,0 @@ -RSpec.describe Beaker::Puppeter do - it "has a version number" do - expect(Beaker::Puppeter::VERSION).not_to be nil - end - - it "does something useful" do - expect(false).to eq(true) - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 082805f..81a8f0a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,13 +1,7 @@ -require "bundler/setup" -require "beaker/puppeter" +require 'bundler/setup' +require 'beaker/puppeter' RSpec.configure do |config| - # Enable flags like --only-failures and --next-failure - config.example_status_persistence_file_path = ".rspec_status" - - # Disable RSpec exposing methods globally on `Module` and `main` - config.disable_monkey_patching! - config.expect_with :rspec do |c| c.syntax = :expect end diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb new file mode 100644 index 0000000..7032c92 --- /dev/null +++ b/spec/spec_helper_acceptance.rb @@ -0,0 +1,7 @@ +require 'beaker-rspec' +require 'beaker/puppeter' + +RSpec.configure do |c| + c.formatter = :documentation + c.order = :defined +end From 25627e3652d1bd28df93997fdf44ce4994855e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suszy=C5=84ski=20Krzysztof?= Date: Fri, 25 May 2018 15:30:11 +0200 Subject: [PATCH 03/11] Overriding logic for answers parameter --- .gitignore | 1 + lib/beaker/puppeter.rb | 24 +++++++++---------- lib/beaker/puppeter/executor.rb | 21 +++++++++++++++- spec/acceptance/complete_spec.rb | 18 +++++++++++++- spec/acceptance/nodesets/centos-6-docker.yml | 1 - spec/acceptance/nodesets/centos-6-vagrant.yml | 1 - spec/acceptance/nodesets/centos-7-docker.yml | 1 - spec/acceptance/nodesets/centos-7-vagrant.yml | 1 - spec/acceptance/nodesets/debian-7-docker.yml | 3 +-- spec/acceptance/nodesets/debian-7-vagrant.yml | 1 - spec/acceptance/nodesets/debian-8-docker.yml | 3 +-- spec/acceptance/nodesets/debian-8-vagrant.yml | 1 - spec/acceptance/nodesets/default.yml | 1 - spec/acceptance/nodesets/ol-6-docker.yml | 1 - spec/acceptance/nodesets/ol-6-vagrant.yml | 1 - spec/acceptance/nodesets/ol-7-docker.yml | 1 - spec/acceptance/nodesets/ol-7-vagrant.yml | 1 - .../nodesets/ubuntu-14.04-docker.yml | 1 - .../nodesets/ubuntu-14.04-vagrant.yml | 1 - .../nodesets/ubuntu-16.04-docker.yml | 1 - .../nodesets/ubuntu-16.04-vagrant.yml | 1 - 21 files changed, 52 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index 7047da8..01644c0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /spec/reports/ /tmp/ /log/ +/.vagrant/ # rspec failure tracking .rspec_status diff --git a/lib/beaker/puppeter.rb b/lib/beaker/puppeter.rb index a21c158..2daa3ee 100644 --- a/lib/beaker/puppeter.rb +++ b/lib/beaker/puppeter.rb @@ -4,30 +4,30 @@ module Beaker module Puppeter PUPPETER_SCRIPT_KEY = 'PUPPETER_ANSWERS' - PUPPETER_SCRIPT_DEFAULT_VALUE = 'default' def run_puppeter(answers = :auto) run_puppeter_on(hosts, answers) end def run_puppeter_on(hosts, answers = :auto) - if answers == :auto - answers = ENV.fetch(PUPPETER_SCRIPT_KEY, PUPPETER_SCRIPT_DEFAULT_VALUE) - end - - install_puppeter_on hosts hosts.each do |host| - execute_puppeter_on(host).with(answers) + install_puppeter_on host + execute_puppeter_on(host) + .with(code: answers, env: env_answers) end end private - def install_puppeter_on(hosts) - hosts.each do |host| - ensure_curl_on host - on host, 'curl https://raw.githubusercontent.com/coi-gov-pl/puppeter/master/setup.sh | bash' - end + def env_answers + answers = ENV.fetch(PUPPETER_SCRIPT_KEY, nil) + set = !answers.nil? + { set: set, answers: answers } + end + + def install_puppeter_on(host) + ensure_curl_on host + on host, 'curl -L https://raw.githubusercontent.com/coi-gov-pl/puppeter/master/setup.sh | bash' end def execute_puppeter_on(host) diff --git a/lib/beaker/puppeter/executor.rb b/lib/beaker/puppeter/executor.rb index e3630b4..d0f93c8 100644 --- a/lib/beaker/puppeter/executor.rb +++ b/lib/beaker/puppeter/executor.rb @@ -1,7 +1,10 @@ module Beaker module Puppeter + class Executor + PUPPETER_SCRIPT_DEFAULT_VALUE = 'default' + def initialize(host) @host = host @puppeter_ver = nil @@ -12,7 +15,8 @@ def with(answers) answers_dir = root.join('spec') .join('acceptance') .join('answers') - answers_file = answers_dir.join("#{answers}.yml") + inject_ansers_to_host(answers) + answers_file = answers_dir.join("#{@host.options[:puppeter_answers]}.yml") ver = infra_version logger.debug "Installing Puppet via #{ver} on #{@host} with #{answers_file}" copied = copy_answers answers_file @@ -22,6 +26,21 @@ def with(answers) private + def inject_ansers_to_host(answers) + code_a = answers[:code] + env_a = answers[:env] + nodeset_a = @host.options[:puppeter_answers] + result = nodeset_a + if env_a[:set] + result = env_a[:answers] + elsif code_a != :auto + result = code_a + end + result = PUPPETER_SCRIPT_DEFAULT_VALUE if result.nil? + @host.options[:puppeter_answers] = result + result + end + def copy_answers(answers_file) target_file = Dir::Tmpname.make_tmpname('/tmp/puppeter-answers', nil) scp_to @host, answers_file, target_file diff --git a/spec/acceptance/complete_spec.rb b/spec/acceptance/complete_spec.rb index 9ba0be6..cc17317 100644 --- a/spec/acceptance/complete_spec.rb +++ b/spec/acceptance/complete_spec.rb @@ -1,12 +1,28 @@ require 'spec_helper_acceptance' describe 'beaker::puppeter' do + + def puppet_major + case hosts.first.options[:puppeter_answers] + when 'default' + 5 + when 'agent-pc3x' + 3 + when 'agent-pc4x' + 4 + when 'agent-pc5x' + 5 + when 'agent-system' + 3 + end + end + it 'should work install Puppet with no errors' do result = run_puppeter expect(result).to be_truthy end describe command('puppet --version') do - its(:stdout) { should match /^\d+\.\d+\.\d+$/ } + its(:stdout) { should match /^#{puppet_major}\.\d+\.\d+$/ } end end diff --git a/spec/acceptance/nodesets/centos-6-docker.yml b/spec/acceptance/nodesets/centos-6-docker.yml index be143f0..69636d0 100644 --- a/spec/acceptance/nodesets/centos-6-docker.yml +++ b/spec/acceptance/nodesets/centos-6-docker.yml @@ -16,5 +16,4 @@ HOSTS: container_path: /var/cache/yum CONFIG: trace_limit: 200 - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/centos-6-vagrant.yml b/spec/acceptance/nodesets/centos-6-vagrant.yml index 5bc668c..e2813d1 100644 --- a/spec/acceptance/nodesets/centos-6-vagrant.yml +++ b/spec/acceptance/nodesets/centos-6-vagrant.yml @@ -11,5 +11,4 @@ HOSTS: from: /tmp/vagrant-cache/yum/centos-6-vagrant to: /var/cache/yum CONFIG: - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/centos-7-docker.yml b/spec/acceptance/nodesets/centos-7-docker.yml index df5efe0..5a95420 100644 --- a/spec/acceptance/nodesets/centos-7-docker.yml +++ b/spec/acceptance/nodesets/centos-7-docker.yml @@ -17,5 +17,4 @@ HOSTS: container_path: /var/cache/yum CONFIG: trace_limit: 200 - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/centos-7-vagrant.yml b/spec/acceptance/nodesets/centos-7-vagrant.yml index 0ef68d7..c9eb29e 100644 --- a/spec/acceptance/nodesets/centos-7-vagrant.yml +++ b/spec/acceptance/nodesets/centos-7-vagrant.yml @@ -11,5 +11,4 @@ HOSTS: from: /tmp/vagrant-cache/yum/centos-7-vagrant to: /var/cache/yum CONFIG: - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/debian-7-docker.yml b/spec/acceptance/nodesets/debian-7-docker.yml index 4cef22f..f8fa03b 100644 --- a/spec/acceptance/nodesets/debian-7-docker.yml +++ b/spec/acceptance/nodesets/debian-7-docker.yml @@ -15,5 +15,4 @@ HOSTS: host_path: /tmp/apt_cache/debian-7-amd64 container_path: /var/cache/apt CONFIG: - type: foss -log_level: debug + log_level: debug diff --git a/spec/acceptance/nodesets/debian-7-vagrant.yml b/spec/acceptance/nodesets/debian-7-vagrant.yml index 4f68c77..28514fa 100644 --- a/spec/acceptance/nodesets/debian-7-vagrant.yml +++ b/spec/acceptance/nodesets/debian-7-vagrant.yml @@ -11,5 +11,4 @@ HOSTS: from: /tmp/vagrant-cache/apt/debian-7-vagrant to: /var/cache/apt/archives CONFIG: - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/debian-8-docker.yml b/spec/acceptance/nodesets/debian-8-docker.yml index 7df929c..08f3215 100644 --- a/spec/acceptance/nodesets/debian-8-docker.yml +++ b/spec/acceptance/nodesets/debian-8-docker.yml @@ -17,5 +17,4 @@ HOSTS: host_path: /tmp/apt_cache/debian-8-amd64 container_path: /var/cache/apt CONFIG: - type: foss -log_level: debug + log_level: debug diff --git a/spec/acceptance/nodesets/debian-8-vagrant.yml b/spec/acceptance/nodesets/debian-8-vagrant.yml index e5fa6eb..cae48d4 100644 --- a/spec/acceptance/nodesets/debian-8-vagrant.yml +++ b/spec/acceptance/nodesets/debian-8-vagrant.yml @@ -11,5 +11,4 @@ HOSTS: from: /tmp/vagrant-cache/apt/debian-8-vagrant to: /var/cache/apt/archives CONFIG: - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml index a5137aa..92bde66 100644 --- a/spec/acceptance/nodesets/default.yml +++ b/spec/acceptance/nodesets/default.yml @@ -11,5 +11,4 @@ HOSTS: from: /tmp/vagrant-cache/wget/ol-6-vagrant to: /var/cache/yum CONFIG: - type: foss log_level: info diff --git a/spec/acceptance/nodesets/ol-6-docker.yml b/spec/acceptance/nodesets/ol-6-docker.yml index da0dd7d..753f614 100644 --- a/spec/acceptance/nodesets/ol-6-docker.yml +++ b/spec/acceptance/nodesets/ol-6-docker.yml @@ -16,5 +16,4 @@ HOSTS: container_path: /var/cache/yum CONFIG: trace_limit: 200 - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/ol-6-vagrant.yml b/spec/acceptance/nodesets/ol-6-vagrant.yml index ea2fe8d..76ba2f5 100644 --- a/spec/acceptance/nodesets/ol-6-vagrant.yml +++ b/spec/acceptance/nodesets/ol-6-vagrant.yml @@ -11,5 +11,4 @@ HOSTS: from: /tmp/vagrant-cache/yum/ol-6-vagrant to: /var/cache/yum CONFIG: - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/ol-7-docker.yml b/spec/acceptance/nodesets/ol-7-docker.yml index 6aef9df..03cb707 100644 --- a/spec/acceptance/nodesets/ol-7-docker.yml +++ b/spec/acceptance/nodesets/ol-7-docker.yml @@ -17,5 +17,4 @@ HOSTS: container_path: /var/cache/yum CONFIG: trace_limit: 200 - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/ol-7-vagrant.yml b/spec/acceptance/nodesets/ol-7-vagrant.yml index c81025d..6bc3acb 100644 --- a/spec/acceptance/nodesets/ol-7-vagrant.yml +++ b/spec/acceptance/nodesets/ol-7-vagrant.yml @@ -11,5 +11,4 @@ HOSTS: from: /tmp/vagrant-cache/yum/ol-7-vagrant to: /var/cache/yum CONFIG: - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/ubuntu-14.04-docker.yml b/spec/acceptance/nodesets/ubuntu-14.04-docker.yml index dca606b..6b49b3c 100644 --- a/spec/acceptance/nodesets/ubuntu-14.04-docker.yml +++ b/spec/acceptance/nodesets/ubuntu-14.04-docker.yml @@ -18,5 +18,4 @@ HOSTS: host_path: /tmp/docker-cache/apt/ubuntu-1404-docker container_path: /var/cache/apt/archives CONFIG: - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/ubuntu-14.04-vagrant.yml b/spec/acceptance/nodesets/ubuntu-14.04-vagrant.yml index 905a11e..1173588 100644 --- a/spec/acceptance/nodesets/ubuntu-14.04-vagrant.yml +++ b/spec/acceptance/nodesets/ubuntu-14.04-vagrant.yml @@ -11,5 +11,4 @@ HOSTS: from: /tmp/vagrant-cache/apt/ubuntu-1404-vagrant to: /var/cache/apt/archives CONFIG: - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/ubuntu-16.04-docker.yml b/spec/acceptance/nodesets/ubuntu-16.04-docker.yml index 76b66e1..dbdcc80 100644 --- a/spec/acceptance/nodesets/ubuntu-16.04-docker.yml +++ b/spec/acceptance/nodesets/ubuntu-16.04-docker.yml @@ -16,5 +16,4 @@ HOSTS: host_path: /tmp/docker-cache/apt/ubuntu-1604-docker container_path: /var/cache/apt/archives CONFIG: - type: foss log_level: debug diff --git a/spec/acceptance/nodesets/ubuntu-16.04-vagrant.yml b/spec/acceptance/nodesets/ubuntu-16.04-vagrant.yml index e276d8d..4f3d15d 100644 --- a/spec/acceptance/nodesets/ubuntu-16.04-vagrant.yml +++ b/spec/acceptance/nodesets/ubuntu-16.04-vagrant.yml @@ -11,5 +11,4 @@ HOSTS: from: /tmp/vagrant-cache/apt/ubuntu-1604-vagrant to: /var/cache/apt/archives CONFIG: - type: foss log_level: debug From fe7224ea98c848590e223d7ed52c6d4b96f26802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suszy=C5=84ski=20Krzysztof?= Date: Fri, 25 May 2018 17:14:08 +0200 Subject: [PATCH 04/11] Tests completly cover the code --- Gemfile | 5 +- Gemfile.lock | 9 +- Rakefile | 2 +- beaker-puppeter.gemspec | 2 + lib/beaker/puppeter.rb | 1 + lib/beaker/puppeter/executor.rb | 2 - spec/acceptance/nodesets/default.yml | 22 +++-- spec/spec_helper.rb | 7 +- spec/unit/beaker/puppeter/executor_spec.rb | 81 ++++++++++++++++++ .../beaker/puppeter/version_spec.rb | 0 spec/unit/beaker/puppeter_spec.rb | 85 +++++++++++++++++++ 11 files changed, 202 insertions(+), 14 deletions(-) create mode 100644 spec/unit/beaker/puppeter/executor_spec.rb rename spec/{ => unit}/beaker/puppeter/version_spec.rb (100%) create mode 100644 spec/unit/beaker/puppeter_spec.rb diff --git a/Gemfile b/Gemfile index bee3914..aff9ffe 100644 --- a/Gemfile +++ b/Gemfile @@ -4,12 +4,15 @@ source "https://rubygems.org" gemspec group :acceptancetests do - gem 'beaker', require: false gem 'beaker-rspec', require: false gem 'beaker-vagrant', require: false gem 'vagrant-wrapper', require: false end +group :tests do + gem 'simplecov', require: false +end + group :development do gem 'pry', require: false gem 'pry-byebug', require: false diff --git a/Gemfile.lock b/Gemfile.lock index d5e0445..12616e1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,6 +2,7 @@ PATH remote: . specs: beaker-puppeter (0.1.0) + beaker (< 4) GEM remote: https://rubygems.org/ @@ -87,6 +88,7 @@ GEM declarative-option (0.1.0) deep_merge (1.2.1) diff-lcs (1.3) + docile (1.3.0) docker-api (1.34.2) excon (>= 0.47.0) multi_json @@ -204,6 +206,11 @@ GEM faraday (~> 0.9) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) specinfra (2.73.3) net-scp net-ssh (>= 2.7, < 5.0) @@ -219,7 +226,6 @@ PLATFORMS ruby DEPENDENCIES - beaker beaker-puppeter! beaker-rspec beaker-vagrant @@ -228,6 +234,7 @@ DEPENDENCIES pry-byebug rake (~> 10.0) rspec (~> 3.0) + simplecov vagrant-wrapper BUNDLED WITH diff --git a/Rakefile b/Rakefile index 87191d9..fa3adf5 100644 --- a/Rakefile +++ b/Rakefile @@ -2,7 +2,7 @@ require "bundler/gem_tasks" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = 'spec/beaker/**/*_spec.rb' + t.pattern = 'spec/unit/**/*_spec.rb' end desc 'Run Beaker acceptance self-test' diff --git a/beaker-puppeter.gemspec b/beaker-puppeter.gemspec index 142b775..cad3418 100644 --- a/beaker-puppeter.gemspec +++ b/beaker-puppeter.gemspec @@ -23,6 +23,8 @@ Gem::Specification.new do |spec| end spec.require_paths = ["lib"] + spec.add_dependency 'beaker', '< 4' + spec.add_development_dependency "bundler", "~> 1.16" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rspec", "~> 3.0" diff --git a/lib/beaker/puppeter.rb b/lib/beaker/puppeter.rb index 2daa3ee..994374a 100644 --- a/lib/beaker/puppeter.rb +++ b/lib/beaker/puppeter.rb @@ -1,5 +1,6 @@ require 'beaker/puppeter/version' require 'beaker/puppeter/executor' +require 'beaker' module Beaker module Puppeter diff --git a/lib/beaker/puppeter/executor.rb b/lib/beaker/puppeter/executor.rb index d0f93c8..2becd12 100644 --- a/lib/beaker/puppeter/executor.rb +++ b/lib/beaker/puppeter/executor.rb @@ -1,8 +1,6 @@ module Beaker module Puppeter - class Executor - PUPPETER_SCRIPT_DEFAULT_VALUE = 'default' def initialize(host) diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml index 92bde66..9aabe66 100644 --- a/spec/acceptance/nodesets/default.yml +++ b/spec/acceptance/nodesets/default.yml @@ -1,14 +1,20 @@ HOSTS: - default-ol-6-vagrant: - platform: el-6-x86_64 - hypervisor: vagrant - box: boxcutter-ol68 + default-centos-7-docker: + platform: el-7-x86_64 + hypervisor: docker + image: centos:7 + docker_preserve_image: true + docker_cmd: '["/usr/sbin/init"]' + # install various tools required to get the image up to usable levels + docker_image_commands: + - 'yum install -y crontabs tar wget openssl sysvinit-tools iproute which initscripts' mount_folders: wget_cache: - from: /tmp/vagrant-cache/wget - to: /var/cache/wget + host_path: /tmp/docker-cache/wget + container_path: /var/cache/wget yum_cache: - from: /tmp/vagrant-cache/wget/ol-6-vagrant - to: /var/cache/yum + host_path: /tmp/docker-cache/yum/centos-7-docker + container_path: /var/cache/yum CONFIG: + trace_limit: 200 log_level: info diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 81a8f0a..9619abd 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,9 @@ -require 'bundler/setup' +require 'simplecov' + +SimpleCov.start do + add_filter "/spec/" +end + require 'beaker/puppeter' RSpec.configure do |config| diff --git a/spec/unit/beaker/puppeter/executor_spec.rb b/spec/unit/beaker/puppeter/executor_spec.rb new file mode 100644 index 0000000..8ecf75f --- /dev/null +++ b/spec/unit/beaker/puppeter/executor_spec.rb @@ -0,0 +1,81 @@ +require 'spec_helper' + +describe Beaker::Puppeter::Executor do + let :subject do + Beaker::Puppeter::Executor.new(host) + end + let :logger { double() } + describe '#with' do + context 'on host with nodeset config value puppeter_answers set to "alice"' do + let :host do + double(options: { puppeter_answers: 'alice' }, to_s: 'centos7') + end + before :each do + expect(subject).to receive(:on) + .with(host, 'puppeter --version').and_return(double(stdout: 'puppeter 0.8.0')) + expect(subject).to receive(:logger).and_return(logger) + expect(subject).to receive(:on) + .with(host, /^puppeter --answers \/tmp\/puppeter-answers[a-z0-9-]+ > \/tmp\/puppeter-script\.sh$/) + expect(subject).to receive(:on) + .with(host, 'bash /tmp/puppeter-script.sh') + end + it 'executes puppeter with cecylia.yml if environment given' do + expect(logger).to receive(:debug) + .with('Installing Puppet via puppeter 0.8.0 on centos7 with spec/acceptance/answers/cecylia.yml') + expect(subject).to receive(:scp_to) + .with(host, Pathname.new('spec/acceptance/answers/cecylia.yml'), /^\/tmp\//) + subject.with(code: 'bob', env: { set: true, answers: 'cecylia' }) + end + it 'executes puppeter with bob.yml if no environment given' do + expect(logger).to receive(:debug) + .with('Installing Puppet via puppeter 0.8.0 on centos7 with spec/acceptance/answers/bob.yml') + expect(subject).to receive(:scp_to) + .with(host, Pathname.new('spec/acceptance/answers/bob.yml'), /^\/tmp\//) + subject.with(code: 'bob', env: { set: false, answers: nil }) + end + it 'executes puppeter with alice.yml if no environment and code given' do + expect(logger).to receive(:debug) + .with('Installing Puppet via puppeter 0.8.0 on centos7 with spec/acceptance/answers/alice.yml') + expect(subject).to receive(:scp_to) + .with(host, Pathname.new('spec/acceptance/answers/alice.yml'), /^\/tmp\//) + subject.with(code: :auto, env: { set: false, answers: nil }) + end + end + + + context 'on simple host without any configuration values' do + let :host { double(options: {}, to_s: 'ubuntu16') } + + before :each do + expect(subject).to receive(:on) + .with(host, 'puppeter --version').and_return(double(stdout: 'puppeter 0.8.1')) + expect(subject).to receive(:logger).and_return(logger) + expect(subject).to receive(:on) + .with(host, /^puppeter --answers \/tmp\/puppeter-answers[a-z0-9-]+ > \/tmp\/puppeter-script\.sh$/) + expect(subject).to receive(:on) + .with(host, 'bash /tmp/puppeter-script.sh') + end + it 'executes puppeter with cecylia.yml if environment given' do + expect(logger).to receive(:debug) + .with('Installing Puppet via puppeter 0.8.1 on ubuntu16 with spec/acceptance/answers/cecylia.yml') + expect(subject).to receive(:scp_to) + .with(host, Pathname.new('spec/acceptance/answers/cecylia.yml'), /^\/tmp\//) + subject.with(code: 'bob', env: { set: true, answers: 'cecylia' }) + end + it 'executes puppeter with bob.yml if no environment given' do + expect(logger).to receive(:debug) + .with('Installing Puppet via puppeter 0.8.1 on ubuntu16 with spec/acceptance/answers/bob.yml') + expect(subject).to receive(:scp_to) + .with(host, Pathname.new('spec/acceptance/answers/bob.yml'), /^\/tmp\//) + subject.with(code: 'bob', env: { set: false, answers: nil }) + end + it 'executes puppeter with default.yml if no environment and code given' do + expect(logger).to receive(:debug) + .with('Installing Puppet via puppeter 0.8.1 on ubuntu16 with spec/acceptance/answers/default.yml') + expect(subject).to receive(:scp_to) + .with(host, Pathname.new('spec/acceptance/answers/default.yml'), /^\/tmp\//) + subject.with(code: :auto, env: { set: false, answers: nil }) + end + end + end +end diff --git a/spec/beaker/puppeter/version_spec.rb b/spec/unit/beaker/puppeter/version_spec.rb similarity index 100% rename from spec/beaker/puppeter/version_spec.rb rename to spec/unit/beaker/puppeter/version_spec.rb diff --git a/spec/unit/beaker/puppeter_spec.rb b/spec/unit/beaker/puppeter_spec.rb new file mode 100644 index 0000000..a29db81 --- /dev/null +++ b/spec/unit/beaker/puppeter_spec.rb @@ -0,0 +1,85 @@ +require 'spec_helper' + +describe Beaker::Puppeter do + let :subject do + Class.new { include Beaker::Puppeter } + end + let :hosts do + with_answers_host = double(puppeter_answers: 'agent-pc4x') + simple_host = double() + [ with_answers_host, simple_host ] + end + after :each do + ENV.delete('PUPPETER_ANSWERS') + end + before :each do + allow(subject).to receive(:hosts).and_return(hosts) + end + + describe '#run_puppeter' do + context 'without any arguments' do + it 'calls run_puppeter_on on each host' do + expect(subject).to receive(:run_puppeter_on).with(hosts, :auto) + subject.run_puppeter + end + end + context 'with answers set to "pc45"' do + it 'calls run_puppeter_on on each host' do + expect(subject).to receive(:run_puppeter_on).with(hosts, 'pc45') + subject.run_puppeter 'pc45' + end + end + end + + describe '#run_puppeter_on' do + let :executor do + double(with: true) + end + before :each do + hosts.each do |h| + expect(Beaker::Puppeter::Executor).to receive(:new).with(h) + .and_return(executor) + expect(h).to receive(:check_for_package).with('curl').and_return(false) + expect(h).to receive(:install_package).with('curl') + end + expect(subject).to receive(:on) + .with(anything, 'curl -L https://raw.githubusercontent.com/coi-gov-pl/puppeter/master/setup.sh | bash').twice + end + context 'without any arguments' do + context 'with environment variable PUPPETER_ANSWERS set to "puppet5"' do + it 'calls Beaker::Puppeter::Executor on every host with { code: :auto, env: { set: true, answers: "puppet5" } }' do + expect(executor).to receive(:with).with(code: :auto, env: { set: true, answers: 'puppet5' }) + ENV['PUPPETER_ANSWERS'] = 'puppet5' + subject.run_puppeter_on(hosts) + end + end + + context 'without environment variables set' do + it 'calls Beaker::Puppeter::Executor on every host with { code: :auto, env: { set: false, answers: nil } }' do + expect(executor).to receive(:with).with(code: :auto, env: { set: false, answers: nil }) + subject.run_puppeter_on(hosts) + end + end + end + + + context 'with answers argument set to "alice"' do + context 'with environment variable PUPPETER_ANSWERS set to "puppet4"' do + it 'calls Beaker::Puppeter::Executor on every host with { code: "alice", env: { set: true, answers: "puppet4" } }' do + expect(executor).to receive(:with) + .with(code: 'alice', env: { set: true, answers: 'puppet4' }) + ENV['PUPPETER_ANSWERS'] = 'puppet4' + subject.run_puppeter_on(hosts, 'alice') + end + end + + context 'without environment variables set' do + it 'calls Beaker::Puppeter::Executor on every host with { code: "alice", env: { set: false, answers: nil } }' do + expect(executor).to receive(:with).with(code: 'alice', env: { set: false, answers: nil }) + subject.run_puppeter_on(hosts, 'alice') + end + end + end + + end +end From 0e5db8ecfb87b6a6d40eaa23d927a01511f9acec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suszy=C5=84ski=20Krzysztof?= Date: Mon, 28 May 2018 16:18:39 +0200 Subject: [PATCH 05/11] Usage documentation --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1903144..fe30ed5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Beaker::Puppeter -This plugin integrates Puppeter into Beaker testing framework, by installing and running it with provided answer files. +This plugin integrates [Puppeter](https://github.com/coi-gov-pl/puppeter/) into [Beaker](https://github.com/puppetlabs/beaker) testing harness, by installing and running it with user provided answer files. ## Installation @@ -10,17 +10,58 @@ Add this line to your module's Gemfile: gem 'beaker-puppeter', require: false ``` -And then execute: +## Usage - $ bundle +To use beaker-puppeter add those lines to yours `spec/spec_helper_acceptance.rb` file: -## Usage +```ruby +require 'beaker/puppeter' +run_puppeter +``` + +This configuration will look automatically for Puppeter answers in `spec/acceptance/answers/default.yml`, so place it there. + +Answer file must be in format accepted by Puppeter. Consult [Puppeter documentation](https://github.com/coi-gov-pl/puppeter/blob/develop/README.rst) for more details. + +Sample answer file can be as simple as: + +```yaml +# will install puppet agent 5.x from Puppet Inc. managed deb repositories +installer: + mode: Agent + type: pc5x +``` + +### Changing Puppeter answer file + +You can change answers file in tree ways: + +1. Using environment variable `PUPPETER_ANSWERS`: +```bash +PUPPETER_ANSWERS=puppet4 RS_SET=centos7 bundle exec rake acceptance +``` + +2. Using directly in code: +```ruby +run_puppeter 'puppet4' # will run spec/acceptance/answers/puppet4.yml +``` + +3. Configuring `puppeter_answers` variable in nodeset: + +```yaml +CONFIG: + puppeter_answers: puppet4 +``` + +The importance of those set methods are: environment variables, direct code, nodeset settings. + +### Fine tuned usage -TODO: Write usage instructions here +You can also utilize `run_puppeter_on` helper method to run Puppeter on specific hosts. It's useful when you would like to run different answer files on different hosts. ## Development -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. +After checking out the repo, run `bundle` to install dependencies. Then, run `bundle exec rake spec` to run the unit tests. You can also run `bundle exec rake acceptance` to run Docker/Vagrant based acceptance tests. 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). From 66f820f59c069e477e7ae69a6c994b21d00c992e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Mon, 28 May 2018 22:36:35 +0200 Subject: [PATCH 06/11] Setup Travis CI --- .travis.yml | 12 ++++++--- Gemfile | 4 +++ Gemfile.lock | 29 +++++++++++++++++++--- beaker-puppeter.gemspec | 8 +++--- spec/spec_helper.rb | 2 ++ spec/unit/beaker/puppeter/executor_spec.rb | 4 +-- 6 files changed, 45 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index d359d87..95c8bb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,11 @@ -sudo: false +--- language: ruby +sudo: false +before_install: gem install bundler +bundler_args: --without development acceptancetests --jobs=3 --retry=3 --no-deployment +cache: bundler +script: bundle exec rake spec rvm: - - 2.4.0 -before_install: gem install bundler -v 1.16.1 + - '2.1' + - '2.3' + - '2.4' diff --git a/Gemfile b/Gemfile index aff9ffe..de3391a 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,9 @@ source "https://rubygems.org" # Specify your gem's dependencies in beaker-puppeter.gemspec gemspec +gem 'rake', require: false +gem 'rspec', require: false + group :acceptancetests do gem 'beaker-rspec', require: false gem 'beaker-vagrant', require: false @@ -10,6 +13,7 @@ group :acceptancetests do end group :tests do + gem 'coveralls', require: false gem 'simplecov', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 12616e1..fd08f7c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -84,6 +84,12 @@ GEM builder (3.2.3) byebug (9.0.6) coderay (1.1.2) + coveralls (0.7.1) + multi_json (~> 1.3) + rest-client + simplecov (>= 0.7) + term-ansicolor + thor declarative (0.0.10) declarative-option (0.1.0) deep_merge (1.2.1) @@ -92,6 +98,8 @@ GEM docker-api (1.34.2) excon (>= 0.47.0) multi_json + domain_name (0.5.20180417) + unf (>= 0.0.5, < 1.0.0) excon (0.62.0) faraday (0.15.2) multipart-post (>= 1.2, < 3) @@ -125,6 +133,8 @@ GEM os (~> 0.9) signet (~> 0.7) hocon (1.2.5) + http-cookie (1.0.3) + domain_name (~> 0.5) httpclient (2.8.3) in-parallel (0.1.17) inifile (3.0.0) @@ -149,6 +159,7 @@ GEM net-ssh (>= 2.6.5) net-ssh (4.2.0) net-telnet (0.1.1) + netrc (0.11.0) nokogiri (1.8.2) mini_portile2 (~> 2.3.0) oga (2.15) @@ -174,6 +185,10 @@ GEM declarative (< 0.1.0) declarative-option (< 0.2.0) uber (< 0.2.0) + rest-client (2.0.2) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) retriable (3.1.1) rspec (3.7.0) rspec-core (~> 3.7.0) @@ -217,9 +232,15 @@ GEM net-telnet sfl stringify-hash (0.0.2) + term-ansicolor (1.6.0) + tins (~> 1.0) thor (0.20.0) + tins (1.16.3) trollop (2.1.2) uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.5) vagrant-wrapper (2.0.3) PLATFORMS @@ -229,13 +250,13 @@ DEPENDENCIES beaker-puppeter! beaker-rspec beaker-vagrant - bundler (~> 1.16) + coveralls pry pry-byebug - rake (~> 10.0) - rspec (~> 3.0) + rake + rspec simplecov vagrant-wrapper BUNDLED WITH - 1.16.1 + 1.16.2 diff --git a/beaker-puppeter.gemspec b/beaker-puppeter.gemspec index cad3418..c293c2a 100644 --- a/beaker-puppeter.gemspec +++ b/beaker-puppeter.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.email = ["krzysztof.suszynski@coi.gov.pl"] spec.summary = "Integrates Puppeter into Beaker by adding extra helper methods" - spec.description = <<~eos + spec.description = <<-eos.gsub /^\s*/, '' Puppeter is a automated, unattended, Puppet installer, and beaker-puppeter is a Beaker extension that adds helper methods to use in your spec_helper_acceptance file. @@ -23,9 +23,7 @@ Gem::Specification.new do |spec| end spec.require_paths = ["lib"] - spec.add_dependency 'beaker', '< 4' + spec.required_ruby_version = [ '>= 2.1.0', '< 2.5.0' ] - spec.add_development_dependency "bundler", "~> 1.16" - spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "rspec", "~> 3.0" + spec.add_dependency 'beaker', '< 4' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9619abd..42b32e8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,8 +1,10 @@ require 'simplecov' +require 'coveralls' SimpleCov.start do add_filter "/spec/" end +Coveralls.wear! require 'beaker/puppeter' diff --git a/spec/unit/beaker/puppeter/executor_spec.rb b/spec/unit/beaker/puppeter/executor_spec.rb index 8ecf75f..3d3ba4b 100644 --- a/spec/unit/beaker/puppeter/executor_spec.rb +++ b/spec/unit/beaker/puppeter/executor_spec.rb @@ -4,7 +4,7 @@ let :subject do Beaker::Puppeter::Executor.new(host) end - let :logger { double() } + let(:logger) { double() } describe '#with' do context 'on host with nodeset config value puppeter_answers set to "alice"' do let :host do @@ -44,7 +44,7 @@ context 'on simple host without any configuration values' do - let :host { double(options: {}, to_s: 'ubuntu16') } + let(:host) { double(options: {}, to_s: 'ubuntu16') } before :each do expect(subject).to receive(:on) From 7848b89ba5b665db16aa4638c34449aef21c463f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Mon, 28 May 2018 23:27:11 +0200 Subject: [PATCH 07/11] Setup Circle CI --- .circleci/config.yml | 83 ++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 84 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..31da900 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,83 @@ +# Ruby CircleCI 2.0 configuration file +# Check https://circleci.com/docs/2.0/language-ruby/ for more details +version: 2 + +references: + machine-defaults: &environment-defaults + machine: true + restore-cache-bundler: &restore-cache-bundler + restore_cache: + keys: + - v1-dependencies-{{ checksum "Gemfile.lock" }} + - v1-dependencies- + save-cache-bundler: &save-cache-bundler + save_cache: + paths: + - ./vendor/bundle + key: v1-dependencies-{{ checksum "Gemfile.lock" }} + bundle-install: &bundle-install + run: + name: Install dependencies with Bundler + shell: /bin/bash -leo pipefail + command: bundle install --without development --jobs=4 --retry=3 --no-deployment --path vendor/bundle + acceptance-tests: &acceptance-tests + run: + name: Run acceptance tests using Beaker + shell: /bin/bash -leo pipefail + command: bundle exec rake acceptance + + steps: &steps + steps: + - checkout + - *restore-cache-bundler + - *bundle-install + - *save-cache-bundler + - *acceptance-tests + +workflows: + version: 2 + integration-tests: + jobs: + - centos-6-default + - centos-7-system + - debian-8-puppet4 + - debian-9-system + - ubuntu-1404-puppet3 + - ubuntu-1604-puppet5 + +jobs: + centos-6-default: + <<: *environment-defaults + <<: *steps + environment: + RS_SET: centos-6-docker + centos-7-system: + <<: *environment-defaults + <<: *steps + environment: + RS_SET: centos-7-docker + PUPPETER_ANSWERS: agent-system + ubuntu-1404-puppet3: + <<: *environment-defaults + <<: *steps + environment: + RS_SET: ubuntu-14.04-docker + PUPPETER_ANSWERS: agent-pc3x + ubuntu-1604-puppet5: + <<: *environment-defaults + <<: *steps + environment: + RS_SET: ubuntu-16.04-docker + PUPPETER_ANSWERS: agent-pc5x + debian-8-puppet4: + <<: *environment-defaults + <<: *steps + environment: + RS_SET: debian-8-docker + PUPPETER_ANSWERS: agent-pc4x + debian-9-system: + <<: *environment-defaults + <<: *steps + environment: + RS_SET: debian-9-docker + PUPPETER_ANSWERS: agent-system diff --git a/.gitignore b/.gitignore index 01644c0..7a8f4f7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ /tmp/ /log/ /.vagrant/ +/vendor/ # rspec failure tracking .rspec_status From 478e9bc84f489c3c11b199a978e828a8299f3eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Tue, 29 May 2018 00:08:53 +0200 Subject: [PATCH 08/11] Fix installed puppet check --- .circleci/config.yml | 7 ------- spec/acceptance/complete_spec.rb | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 31da900..cce6eb0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,7 +41,6 @@ workflows: - centos-6-default - centos-7-system - debian-8-puppet4 - - debian-9-system - ubuntu-1404-puppet3 - ubuntu-1604-puppet5 @@ -75,9 +74,3 @@ jobs: environment: RS_SET: debian-8-docker PUPPETER_ANSWERS: agent-pc4x - debian-9-system: - <<: *environment-defaults - <<: *steps - environment: - RS_SET: debian-9-docker - PUPPETER_ANSWERS: agent-system diff --git a/spec/acceptance/complete_spec.rb b/spec/acceptance/complete_spec.rb index cc17317..9d45e11 100644 --- a/spec/acceptance/complete_spec.rb +++ b/spec/acceptance/complete_spec.rb @@ -22,7 +22,7 @@ def puppet_major expect(result).to be_truthy end - describe command('puppet --version') do + describe command('bash -lc "puppet --version"') do its(:stdout) { should match /^#{puppet_major}\.\d+\.\d+$/ } end end From 2744aa2dfaabd2365648b082167dee9045b7e8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suszy=C5=84ski=20Krzysztof?= Date: Wed, 6 Jun 2018 10:42:11 +0200 Subject: [PATCH 09/11] Add CI badges --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fe30ed5..82c5acd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Beaker::Puppeter +[![Build Status](https://travis-ci.org/coi-gov-pl/gem-beaker-puppeter.svg?branch=develop)](https://travis-ci.org/coi-gov-pl/gem-beaker-puppeter) [![CircleCI](https://circleci.com/gh/coi-gov-pl/gem-beaker-puppeter.svg?style=svg)](https://circleci.com/gh/coi-gov-pl/gem-beaker-puppeter) [![Coverage Status](https://coveralls.io/repos/github/coi-gov-pl/gem-beaker-puppeter/badge.svg?branch=develop)](https://coveralls.io/github/coi-gov-pl/gem-beaker-puppeter?branch=develop) + This plugin integrates [Puppeter](https://github.com/coi-gov-pl/puppeter/) into [Beaker](https://github.com/puppetlabs/beaker) testing harness, by installing and running it with user provided answer files. ## Installation From 3b40b9f2cecd57ffe5b603d83c9ccc6f04e62676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suszy=C5=84ski=20Krzysztof?= Date: Wed, 6 Jun 2018 11:56:33 +0200 Subject: [PATCH 10/11] Pre release version --- Gemfile.lock | 2 +- lib/beaker/puppeter/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index fd08f7c..194edd2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - beaker-puppeter (0.1.0) + beaker-puppeter (0.1.0.pre) beaker (< 4) GEM diff --git a/lib/beaker/puppeter/version.rb b/lib/beaker/puppeter/version.rb index 693269a..f1d8f57 100644 --- a/lib/beaker/puppeter/version.rb +++ b/lib/beaker/puppeter/version.rb @@ -1,5 +1,5 @@ module Beaker module Puppeter - VERSION = '0.1.0' + VERSION = '0.1.0.pre' end end From 56c7809fb86135c98dcb26e3ecd5d4160f70cc7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suszy=C5=84ski=20Krzysztof?= Date: Wed, 6 Jun 2018 11:58:40 +0200 Subject: [PATCH 11/11] Release version --- Gemfile.lock | 2 +- lib/beaker/puppeter/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 194edd2..fd08f7c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - beaker-puppeter (0.1.0.pre) + beaker-puppeter (0.1.0) beaker (< 4) GEM diff --git a/lib/beaker/puppeter/version.rb b/lib/beaker/puppeter/version.rb index f1d8f57..693269a 100644 --- a/lib/beaker/puppeter/version.rb +++ b/lib/beaker/puppeter/version.rb @@ -1,5 +1,5 @@ module Beaker module Puppeter - VERSION = '0.1.0.pre' + VERSION = '0.1.0' end end