Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SHACK-143] set the omnibus kitchen config to perform the omnibus build during converge #74

Merged
merged 2 commits into from
Apr 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 12 additions & 20 deletions omnibus/.kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,26 @@ driver:
provisioner:
name: chef_zero

# only run one of these at a time if you are interested in using the
# omnibus package produced; the build process begins by cleaning up
# prior built artifacts in pkg/ which is shared across VMs
platforms:
- name: centos-7.1
run_list: yum-epel::default
- name: centos-6.6
run_list: yum-epel::default
- name: centos-5.11
run_list: yum-epel::default
- name: debian-7.8
run_list: apt::default
- name: debian-6.0.10
run_list: apt::default
- name: freebsd-10.1
run_list: freebsd::portsnap
- name: freebsd-9.3
run_list:
- freebsd::portsnap
- freebsd::pkgng
- name: centos-7
- name: centos-6
- name: debian-9
- name: debian-8
- name: debian-7
- name: ubuntu-16.04
- name: ubuntu-14.04
run_list: apt::default
- name: ubuntu-12.04
run_list: apt::default

suites:
- name: default
run_list: omnibus::default
run_list: chef-workstation-builder::default
attributes:
omnibus:
build_user: vagrant
build_user_group: vagrant
build_user_password: vagrant
build_user_home: /home/vagrant
build_dir: /home/vagrant/chef-workstation/omnibus
install_dir: /opt/chef-workstation
9 changes: 2 additions & 7 deletions omnibus/Berksfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
source "https://supermarket.chef.io"

cookbook "omnibus"
cookbook "chef-workstation-builder",
path: File.expand_path("cookbooks/chef-workstation-builder", File.dirname(__FILE__))

# Uncomment to use the latest version of the Omnibus cookbook from GitHub
# cookbook 'omnibus', github: 'opscode-cookbooks/omnibus'

group :integration do
cookbook "apt", "~> 2.8"
cookbook "freebsd", "~> 0.3"
cookbook "yum-epel", "~> 0.6"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
default['chef-workstation-builder']['log_level'] = 'info'
default['chef-workstation-builder']['live_stream'] = true
11 changes: 11 additions & 0 deletions omnibus/cookbooks/chef-workstation-builder/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name 'chef-workstation-builder'
maintainer 'shackers'
maintainer_email 'shackers@chef.io'
license 'Apache-2.0'
description 'Builds a Chef Workstation package'
long_description 'Builds a Chef Workstation package'
version '1.0.0'

depends 'omnibus'
depends 'apt', '~> 2.8'
depends 'yum-epel', '~> 0.6'
24 changes: 24 additions & 0 deletions omnibus/cookbooks/chef-workstation-builder/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ensure packages available up-to-date
case node['platform_family']
when 'debian'
include_recipe 'apt::default'
when 'rhel'
include_recipe 'yum-epel::default'
end

include_recipe 'omnibus::default'

execute 'fix bundler directory permissions' do
command "chown -R #{node['omnibus']['build_user']} #{node['omnibus']['build_user_home']}/.bundle"
only_if { Dir.exist? "#{node['omnibus']['build_user_home']}/.bundle" }
end

omnibus_build 'chef-workstation' do
environment 'HOME' => node['omnibus']['build_user_home']
project_dir node['omnibus']['build_dir']
log_level node['chef-workstation-builder']['log_level'].to_sym
live_stream node['chef-workstation-builder']['live_stream']
config_overrides(
append_timestamp: true
)
end