From 5de87ae184529f2f5eff85922f65f6d73ba53449 Mon Sep 17 00:00:00 2001 From: Jennifer Davis Date: Tue, 25 Apr 2017 15:07:23 -0700 Subject: [PATCH 1/2] Sync the version installed in the recipe with the resource. Update testing to validate install. Signed-off-by: Jennifer Davis --- README.md | 36 +++++++++++++++++++++-- attributes/default.rb | 2 +- test/integration/default/activemq_spec.rb | 8 +++++ 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c8411cd..8dc5585 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/chef-cookbooks/activemq.svg?branch=master)](https://travis-ci.org/chef-cookbooks/activemq) [![Cookbook Version](https://img.shields.io/cookbook/v/activemq.svg)](https://supermarket.chef.io/cookbooks/activemq) -Installs Apache ActiveMQ and sets up the service using the included init script. +Provides resources for installing Apache ActiveMQ and managing the Apache ActiveMQ service for use in wrapper cookbooks. Installs from tarballs from the Apache.org website by default. ## Requirements @@ -33,13 +33,43 @@ Installs Apache ActiveMQ and sets up the service using the included init script. ## Usage -Simply add `recipe[activemq]` to a run list. +Due to the complexity of configuring ActiveMQ it's not possible to create a single solution that solves everyone's potential desired configuration. Instead this cookbook provides resources for installing and managing the ActiveMQ service, which are best used in your own wrapper cookbook. The best way to understand how this could be used is to look at the docs_example test recipe located at test/cookbooks/test/recipes/docs_example.rb + +## Resources + +### activemq_install + +The activemq_install resource installs an instance of the Apache ActiveMQ binary direct from Apache's mirror site. As distro packages are not used we can easily deploy per-instance installations and any version available on the Apache archive site can be installed. + +#### Properties + +* `instance_name`, String +* `version`, String. The version to install. Default: '5.12.0' +* `home`, String. The top level directory to install software. Default: '/opt' +* `install_path`, String. The full level path to install software. +* `tarball_base_path`, String. The base path to the location containing the binary package of ActiveMQ. Default: 'http://archive.apache. org/dist/activemq/' +* checksum_base_path, String, The base path to the location containing the checksum file. default: 'http://archive.apache.org/dist/activemq/' +* exclude_docs, [true, false], default: true +* exclude_examples, [true, false], default: true +* exclude_webapp_demo, [true, false], default: true +* tarball_uri, String +* activemq_user, String user to run activemq +* activemq_group, String group to run activemq + +#### Example + +``` +# Install hello instance of activemq +activemq_install 'hello' do + version '5.12.0' +end +``` ## License & Authors **Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io)) -**Copyright:** 2008-2016, Chef Software, Inc. +**Copyright:** 2008-2017, Chef Software, Inc. ``` Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/attributes/default.rb b/attributes/default.rb index 3ac3425..467118e 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -18,7 +18,7 @@ # default['activemq']['mirror'] = 'https://repository.apache.org/content/repositories/releases/org/apache' -default['activemq']['version'] = '5.12.0' +default['activemq']['version'] = '5.14.4' default['activemq']['home'] = '/opt' default['activemq']['wrapper']['max_memory'] = '1024' default['activemq']['wrapper']['useDedicatedTaskRunner'] = 'true' diff --git a/test/integration/default/activemq_spec.rb b/test/integration/default/activemq_spec.rb index bc2cbbe..87d0cf2 100644 --- a/test/integration/default/activemq_spec.rb +++ b/test/integration/default/activemq_spec.rb @@ -1,3 +1,11 @@ describe command('ps ax | grep activem[q]') do its('exit_status') { should eq 0 } end + +describe command("/opt/apache-activemq-5.14.4/bin/activemq producer") do + its('stdout') { should match(/Produced: 1000 messages/) } +end + +describe command("/opt/apache-activemq-5.14.4/bin/activemq consumer") do + its('stdout') { should match(/Consumed: 1000 messages/) } +end From 9e322c104f917e8ab16e2bf5a073592c9804e8a1 Mon Sep 17 00:00:00 2001 From: Jennifer Davis Date: Tue, 25 Apr 2017 15:11:15 -0700 Subject: [PATCH 2/2] Fix linting Signed-off-by: Jennifer Davis --- test/integration/default/activemq_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/default/activemq_spec.rb b/test/integration/default/activemq_spec.rb index 87d0cf2..74c1c36 100644 --- a/test/integration/default/activemq_spec.rb +++ b/test/integration/default/activemq_spec.rb @@ -2,10 +2,10 @@ its('exit_status') { should eq 0 } end -describe command("/opt/apache-activemq-5.14.4/bin/activemq producer") do +describe command('/opt/apache-activemq-5.14.4/bin/activemq producer') do its('stdout') { should match(/Produced: 1000 messages/) } end -describe command("/opt/apache-activemq-5.14.4/bin/activemq consumer") do +describe command('/opt/apache-activemq-5.14.4/bin/activemq consumer') do its('stdout') { should match(/Consumed: 1000 messages/) } end