Skip to content

Commit

Permalink
Enable installation of chef and chefdk from unstable channel.
Browse files Browse the repository at this point in the history
  • Loading branch information
Serdar Sutay committed Dec 22, 2015
1 parent 27cb830 commit c7eadd9
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ suites:
run_list:
- recipe[test::chefdk]

# This test requires access to Chef's internal network
<% if ENV['ARTIFACTORY_USERNAME'] %>
- name: chef_unstable
run_list:
- recipe[test::unstable]
<% end %>

- name: push_client
# we don't yet have push client packages for trusty, only precise
excludes: [ 'ubuntu-14.04', 'macosx-10.10', 'windows-server-2012r2-standard' ]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ By default, `chef_ingredient` will install using Chef's public package repositor
- `ctl_command`: The "ctl" command, e.g., `chef-server-ctl`. This should be automatically detected by the library helper method `chef_ctl_command`, but may need to be specified if something changes, like a new add-on is made available.
- `options`: Options passed to the `package` resource used for installation.
- `version`: Package version to install. Can be specified in various semver-alike ways: `12.0.4`, `12.0.3-rc.3`, and also `:latest`/`'latest'`. Do not use this property when specifying `package_source`. Default is `:latest`, which will install the latest package from the repository.
- `channel`: Channel to install the products from. It can be `:stable` (default) or `:current`.
- `channel`: Channel to install the products from. It can be `:stable` (default), `:current` or `:unstable`.
- `package_source`: Full path to a location where the package is located. If present, this file is used for installing the package. Default `nil`.
- `timeout`: The amount of time (in seconds) to wait to fetch the installer before timing out. Default: default timeout of the Chef package resource - `900` seconds.

Expand Down
2 changes: 1 addition & 1 deletion libraries/chef_ingredient_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ChefIngredient < Chef::Resource::LWRPBase

# Attributes for determining what version to install from which channel
attribute :version, kind_of: [String, Symbol], default: :latest
attribute :channel, kind_of: Symbol, default: :stable, equal_to: [:current, :stable]
attribute :channel, kind_of: Symbol, default: :stable, equal_to: [:current, :stable, :unstable]

# Attribute to install package from local file
attribute :package_source, kind_of: String, default: nil
Expand Down
2 changes: 1 addition & 1 deletion libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def ensure_mixlib_versioning_gem_installed!
#
def ensure_mixlib_install_gem_installed!
node.run_state[:mixlib_install_gem_installed] ||= begin # ~FC001
install_gem_from_rubygems('mixlib-install', '0.8.0.alpha.2')
install_gem_from_rubygems('mixlib-install', '0.8.0.alpha.3')

require 'mixlib/install'
require 'mixlib/install/product'
Expand Down
22 changes: 22 additions & 0 deletions test/fixtures/cookbooks/test/recipes/unstable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This recipe tests the :unstable channel.
# This channel is only accessible from Chef's internal
# network and contains untested builds of Chef products.
#
# Make sure you set below environment variables for
# tests to work correctly.
#

env 'ARTIFACTORY_USERNAME' do
value '[email protected]'
end

env 'ARTIFACTORY_PASSWORD' do
value 'XXXXXXXXXXXXX'
end

chef_ingredient 'chef' do
action :upgrade
channel :unstable
version :latest
end

0 comments on commit c7eadd9

Please sign in to comment.