diff --git a/.gitignore b/.gitignore index 0ef15c993..b7a3079d9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ vendor/bundle pkg/* .vagrant .kitchen +.kitchen.local.yml bin/* files/chef-server-cookbooks/cache/ files/msi/ChefClient-Config.wxi diff --git a/.kitchen.local.yml.vmware.example b/.kitchen.local.yml.vmware.example new file mode 100644 index 000000000..c165fc4da --- /dev/null +++ b/.kitchen.local.yml.vmware.example @@ -0,0 +1,6 @@ +driver: + name: vagrant + provider: vmware_fusion + customize: + numvcpus: 2 + memsize: 2048 diff --git a/.kitchen.yml b/.kitchen.yml index 225d45ff9..679ba4f80 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -1,18 +1,23 @@ -# NOTE: this runs the omnibus cookbook, but doens't mount filesystems or -# run omnibus yet. Use 'kichen converge' to setup the virt and install -# omnibus cookbooks and then be able to login to it +# +# NOTE: this runs the omnibus cookbook, but does not actually run Omnibus. Use +# 'kichen converge' to setup the virtual machine and then `kitchen login` to +# SSH into the machine and run Omnibus. +# driver: name: vagrant + forward_agent: yes customize: - memory: 2048 cpus: 4 + memory: 4096 synced_folders: - - ['.', '/home/vagrant/omnibus-chef', type: 'rsync'] + - ['.', '/home/vagrant/omnibus-chef'] + - ['../omnibus', '/home/vagrant/omnibus'] + - ['../omnibus-software', '/home/vagrant/omnibus-software'] provisioner: name: chef_zero - require_chef_omnibus: true + require_chef_omnibus: 11.12.4 platforms: - name: centos-5.10 @@ -39,25 +44,60 @@ platforms: run_list: apt::default - name: ubuntu-14.04 run_list: apt::default + # The following boxes are shared via VagrantCloud. Until kitchen-vagrant + # is updated you'll need to add the box manually: + # + # vagrant box add chef/windows-8.1-professional + # + # Please note this may require a `vagrant login` if the box is private. + # + # The following boxes are VMware only also. You can enable VMware Fusion + # as the default provider by copying `.kitchen.local.yml.vmware.example` + # over to `.kitchen.local.yml`. + # + - name: macosx-10.8 + driver: + box: chef/macosx-10.8 # private + - name: macosx-10.9 + driver: + box: chef/macosx-10.9 # private + - name: windows-7-professional + provisioner: + name: windows_chef_zero + driver: + box: chef/windows-7-professional # private + - name: windows-8.1-professional + provisioner: + name: windows_chef_zero + driver: + box: chef/windows-8.1-professional # private + - name: windows-2008r2-standard + provisioner: + name: windows_chef_zero + driver: + box: chef/windows-server-2008r2-standard # private suites: - name: chef + run_list: omnibus::default attributes: omnibus: - build_user: vagrant + build_user: vagrant + build_dir: /home/vagrant/chef install_dir: /opt/chef - run_list: omnibus::default - name: chefdk + run_list: omnibus::default attributes: omnibus: - build_user: vagrant + build_user: vagrant + build_dir: /home/vagrant/chefdk install_dir: /opt/chefdk - run_list: omnibus::default - name: chef-container - attributes: - omnibus: - build_user: vagrant - install_dir: /opt/chef run_list: - omnibus::default - docker::default + attributes: + omnibus: + build_user: vagrant + build_dir: /home/vagrant/chef-container + install_dir: /opt/chef-container diff --git a/Berksfile b/Berksfile index bee1eaec6..2fc1b77b4 100644 --- a/Berksfile +++ b/Berksfile @@ -4,7 +4,7 @@ cookbook 'omnibus' cookbook 'docker', github: 'tduffield/chef-docker' # Uncomment to use the latest version of the Omnibus cookbook from GitHub -#cookbook 'omnibus', github: 'opscode-cookbooks/omnibus' +# cookbook 'omnibus', github: 'opscode-cookbooks/omnibus' group :integration do cookbook 'apt', '~> 2.3' diff --git a/Berksfile.lock b/Berksfile.lock index d2fd1042e..7efee458b 100644 --- a/Berksfile.lock +++ b/Berksfile.lock @@ -15,7 +15,7 @@ GRAPH apt (>= 0.0.0) modules (>= 0.0.0) build-essential (2.0.4) - chef-sugar (2.0.0) + chef-sugar (2.2.0) chef_handler (1.1.6) device-mapper (0.1.0) apt (>= 0.0.0) @@ -50,7 +50,7 @@ GRAPH dpkg_autostart (~> 0.1.10) modules (0.2.0) ohai (2.0.1) - omnibus (2.2.0) + omnibus (2.3.0) 7-zip (~> 1.0) build-essential (~> 2.0) chef-sugar (~> 2.0) diff --git a/Gemfile b/Gemfile index 7a06dd587..6e06f5845 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,18 @@ source 'https://rubygems.org' -gem 'omnibus-software', :github => 'opscode/omnibus-software', - :branch => 'omnibus/3.2-stable' +gem 'omnibus-software', github: 'opscode/omnibus-software' +gem 'omnibus', github: 'opscode/omnibus' -gem 'omnibus', :github => 'opscode/omnibus-ruby', - :branch => '3.0-stable' +# This development group is installed by default when you run `bundle install`, +# but if you are using Omnibus in a CI-based infrastructure, you do not need +# the Test Kitchen-based build lab. You can skip these unnecessary dependencies +# by running `bundle install --without development` to speed up build times. +group :development do + # Use Berkshelf for resolving cookbook dependencies + gem 'berkshelf', '~> 3.0' + + # Use Test Kitchen with Vagrant for converging the build environment + gem 'test-kitchen', '~> 1.2' + gem 'kitchen-vagrant', '~> 0.15' + gem 'windows_chef_zero', '~> 2.0' +end diff --git a/Gemfile.lock b/Gemfile.lock index 58f57c4db..56b8ada6e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,10 @@ GIT - remote: git://github.com/opscode/omnibus-ruby.git - revision: fba19a79516f4decdcebeaf10dfe4739c44fa39c - branch: 3.0-stable + remote: git://github.com/opscode/omnibus.git + revision: e1dd9cde1d21f2aae06a4cdef98e36c852f8d143 specs: - omnibus (3.2.1) - chef-sugar (~> 1.2) - fpm (~> 0.4) + omnibus (4.0.0.beta.1) + chef-sugar (~> 2.2) + cleanroom (~> 1.0) mixlib-shellout (~> 1.4) ohai (~> 7.2) thor (~> 0.18) @@ -13,50 +12,81 @@ GIT GIT remote: git://github.com/opscode/omnibus-software.git - revision: 21aa33b43750d13e462a8f4f360699e588d448ba - branch: omnibus/3.2-stable + revision: 17482b914f4ee182e5ce95a9e978bd7d4b143906 specs: - omnibus-software (3.0.0) + omnibus-software (4.0.0) GEM remote: https://rubygems.org/ specs: addressable (2.3.6) - arr-pm (0.0.9) - cabin (> 0) - backports (3.6.0) - cabin (0.6.1) - chef-sugar (1.3.0) - childprocess (0.5.3) - ffi (~> 1.0, >= 1.0.11) - clamp (0.6.3) + berkshelf (3.1.5) + addressable (~> 2.3.4) + berkshelf-api-client (~> 1.2) + buff-config (~> 1.0) + buff-extensions (~> 1.0) + buff-shell_out (~> 0.1) + celluloid (~> 0.16.0.pre) + celluloid-io (~> 0.16.0.pre) + faraday (~> 0.9.0) + minitar (~> 0.5.4) + octokit (~> 3.0) + retryable (~> 1.3.3) + ridley (~> 4.0) + solve (~> 1.1) + thor (~> 0.18) + berkshelf-api-client (1.2.0) + faraday (~> 0.9.0) + buff-config (1.0.1) + buff-extensions (~> 1.0) + varia_model (~> 0.4) + buff-extensions (1.0.0) + buff-ignore (1.1.1) + buff-ruby_engine (0.1.0) + buff-shell_out (0.2.0) + buff-ruby_engine (~> 0.1.0) + celluloid (0.16.0) + timers (~> 4.0.0) + celluloid-io (0.16.0) + celluloid (>= 0.16.0) + nio4r (>= 1.0.0) + chef-sugar (2.2.0) + cleanroom (1.0.0) + dep-selector-libgecode (1.0.2) + dep_selector (1.0.3) + dep-selector-libgecode (~> 1.0) + ffi (~> 1.9) + erubis (2.7.0) + faraday (0.9.0) + multipart-post (>= 1.2, < 3) ffi (1.9.3) - ffi-yajl (1.0.2) + ffi-yajl (1.1.0) ffi (~> 1.5) libyajl2 (~> 1.0) - fpm (0.4.42) - arr-pm (~> 0.0.8) - backports (>= 2.6.2) - cabin (>= 0.6.0) - childprocess - clamp (~> 0.6) - ftw (~> 0.0.30) - json (>= 1.7.7) - ftw (0.0.39) - addressable - backports (>= 2.6.2) - cabin (> 0) - http_parser.rb (= 0.5.3) - http_parser.rb (0.5.3) + hashie (2.1.2) + hitimes (1.2.2) ipaddress (0.8.0) json (1.8.1) + kitchen-vagrant (0.15.0) + test-kitchen (~> 1.0) libyajl2 (1.0.1) mime-types (1.25.1) + minitar (0.5.4) + mixlib-authentication (1.3.0) + mixlib-log mixlib-cli (1.5.0) mixlib-config (2.1.0) mixlib-log (1.6.0) mixlib-shellout (1.4.0) - ohai (7.2.4) + multipart-post (2.0.0) + net-http-persistent (2.9.4) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (2.9.1) + nio4r (1.0.1) + octokit (3.3.1) + sawyer (~> 0.5.3) + ohai (7.4.0) ffi (~> 1.9) ffi-yajl (~> 1.0) ipaddress @@ -67,15 +97,58 @@ GEM mixlib-shellout (~> 1.2) systemu (~> 2.6.4) wmi-lite (~> 1.0) + retryable (1.3.6) + ridley (4.0.0) + addressable + buff-config (~> 1.0) + buff-extensions (~> 1.0) + buff-ignore (~> 1.1) + buff-shell_out (~> 0.1) + celluloid (~> 0.16.0.pre) + celluloid-io (~> 0.16.0.pre) + erubis + faraday (~> 0.9.0) + hashie (>= 2.0.2, < 3.0.0) + json (>= 1.7.7) + mixlib-authentication (>= 1.3.0) + net-http-persistent (>= 2.8) + retryable + semverse (~> 1.1) + varia_model (~> 0.4) + safe_yaml (1.0.3) + sawyer (0.5.5) + addressable (~> 2.3.5) + faraday (~> 0.8, < 0.10) + semverse (1.2.1) + solve (1.2.1) + dep_selector (~> 1.0) + semverse (~> 1.1) systemu (2.6.4) + test-kitchen (1.2.1) + mixlib-shellout (~> 1.2) + net-scp (~> 1.1) + net-ssh (~> 2.7) + safe_yaml (~> 1.0) + thor (~> 0.18) thor (0.19.1) + timers (4.0.0) + hitimes uber-s3 (0.2.4) mime-types (~> 1.17) + varia_model (0.4.0) + buff-extensions (~> 1.0) + hashie (>= 2.0.2, < 3.0.0) + windows_chef_zero (2.0.0) + test-kitchen (>= 1.2.1) wmi-lite (1.0.0) PLATFORMS ruby DEPENDENCIES + berkshelf (~> 3.0) + kitchen-vagrant (~> 0.15) omnibus! omnibus-software! + test-kitchen (~> 1.2) + windows_chef_zero (~> 2.0) diff --git a/README.md b/README.md index 4c21c6829..e30311991 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,35 @@ -# Chef Omnibus project +Client Tools Omnibus project +============================ +This project creates full-stack platform-specific packages for the following projects: -This project creates full-stack platform-specific packages for `chef`! +* Chef +* ChefDK +* Chef Container +* AngryChef -__PLEASE NOTE__ - The `chef-server` Omnibus project has been moved to: -https://github.com/opscode/omnibus-chef-server - -## Installation - -We'll assume you have Ruby 1.9+ and Bundler installed. First ensure all -required gems are installed and ready to use: +Installation +------------ +You must have a sane Ruby 1.9+ environment with Bundler installed. Ensure all +the required gems are installed: ```shell -$ bundle install --binstubs +$ bundle install --without development ``` -## Usage - +Usage +----- ### Build -You create a platform-specific package using the `build` command: +You create a platform-specific package using the `build project` command: ```shell -$ bin/omnibus build chef +$ bundle exec omnibus build ``` The platform/architecture type of the package created will match the platform -where the `build` command is invoked. So running this command on say a -MacBook Pro will generate a Mac OS X specific package. After the build -completes packages will be available in `pkg/`. +where the `build project` command is invoked. For example, running this command +on a MacBook Pro will generate a Mac OS X package. After the build completes +packages will be available in the `pkg/` folder. ### Clean @@ -35,29 +37,25 @@ You can clean up all temporary files generated during the build process with the `clean` command: ```shell -$ bin/omnibus clean +$ bundle exec omnibus clean ``` Adding the `--purge` purge option removes __ALL__ files generated during the -build including the project install directory (`/opt/opscode`) and +build including the project install directory (`/opt/chef`) and the package cache directory (`/var/cache/omnibus/pkg`): ```shell -$ bin/omnibus clean --purge +$ bundle exec omnibus clean --purge ``` -### Cache - -Lists source packages that are required but not yet cached: - -```shell -$ bin/omnibus cache missing -``` +### Publish -Populate the S3 Cache: +Omnibus has a built-in mechanism for releasing to a variety of "backends", such +as Amazon S3 and Artifactory. You must set the proper credentials in your `omnibus.rb` +config file or specify them via the command line. ```shell -$ bin/omnibus cache populate +$ bundle exec omnibus publish path/to/*.deb --backend s3 ``` ### Help @@ -66,28 +64,13 @@ Full help for the Omnibus command line interface can be accessed with the `help` command: ```shell -$ bin/omnibus help +$ bundle exec omnibus help ``` -## Specifying a Chef version - -By default, the package you build will be based on master branch HEAD of the -[opscode/chef](https://github.com/opscode/chef) git repository. You can build -packages for a specific version of Chef by overriding the version of chef in -Chef project definition. - -```ruby -# config/projects/chef.rb -override :chef, version: "11.10.0" -``` - -The value of version can be any valid git reference (e.g., tag, -branch name, or SHA). - Kitchen-based Build Environment ------------------------------- -Every Omnibus project ships will a project-specific [Berksfile](http://berkshelf.com/) -that will allow you to build your omnibus projects on all of the projects listed +Every Omnibus project ships will a project-specific +[Berksfile](http://berkshelf.com/) that will allow you to build your omnibus projects on all of the projects listed in the `.kitchen.yml`. You can add/remove additional platforms as needed by changing the list found in the `.kitchen.yml` `platforms` YAML stanza. @@ -97,50 +80,36 @@ the [omnibus cookbook](https://github.com/opscode-cookbooks/omnibus) to setup your desired platform and execute the build steps listed above. The default build environment requires Test Kitchen and VirtualBox for local -development. If you don't have Test Kitchen installed on your workstation we -recommend installing the -[latest version of ChefDK package for your platform](http://www.getchef.com/downloads/chef-dk/mac/). -Test Kitchen also exposes the ability to provision instances using various cloud -providers like AWS, DigitalOcean, or OpenStack. For more information, please see -the [Test Kitchen documentation](http://kitchen.ci). +development. Test Kitchen also exposes the ability to provision instances using +various cloud providers like AWS, DigitalOcean, or OpenStack. For more +information, please see the [Test Kitchen documentation](http://kitchen.ci). Once you have tweaked your `.kitchen.yml` (or `.kitchen.local.yml`) to your liking, you can bring up an individual build environment using the `kitchen` command. ```shell -$ kitchen converge -ubuntu-12.04 +$ bundle exec kitchen converge -ubuntu-1204 ``` Then login to the instance and build the project as described in the Usage section: ```shell -$ kitchen login ubuntu-12.04 -[vagrant@ubuntu...] $ cd omnbius-chef -[vagrant@ubuntu...] $ bundle install --binstubs +$ bundle exec kitchen login -ubuntu-1204 +[vagrant@ubuntu...] $ cd omnibus-chef +[vagrant@ubuntu...] $ bundle install --without development # Don't install dev tools! [vagrant@ubuntu...] $ ... -[vagrant@ubuntu...] $ bundle exec omnibus build -``` - -If you are building the Chef project you will need to purge the Chef package -that was used to provision the VM: - -```shell -[vagrant@ubuntu...] $ sudo rm -rf /opt/chef -[vagrant@ubuntu...] $ sudo mkdir -p /opt/chef -[vagrant@ubuntu...] $ sudo chown vagrant /opt/chef +[vagrant@ubuntu...] $ bundle exec omnibus build ``` For a complete list of all commands and platforms, run `kitchen list` or `kitchen help`. -## License - -See the LICENSE file for details. - -Copyright (c) 2012 Chef Software, Inc. -License: Apache License, Version 2.0 +License +------- +```text +Copyright 2012-2014 Chef Software, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -153,3 +122,4 @@ 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/RPM_SIGNING.md b/RPM_SIGNING.md deleted file mode 100644 index 358ca5b26..000000000 --- a/RPM_SIGNING.md +++ /dev/null @@ -1,19 +0,0 @@ -# Overview -RPMs are now automatically signed for every build. -* RPMs are signed using GPG. -* The GPG key is the same as for apt.opscode.com -* The cannonical store of the GPG key is teampass -* The gpg key is installed by jenkins-support::gpg_key recipe -* rpm tries to force you to use a password, the `sign-rpm` script works - around this. - - -# How RPMs Get Signed: -## Extracting GPG Key from gpg Keyring: - - gpg --export -a 'Opscode Omnibus Esq' > OmnibusGPG - -## Importing GPG Key into RPM: - - sudo rpm --import OmnibusGPG - diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 1015fccb4..000000000 --- a/Vagrantfile +++ /dev/null @@ -1,148 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -require "vagrant" - -if Vagrant::VERSION.to_f < 1.5 - raise "The Omnibus Build Lab only supports Vagrant >= 1.5.0" -end - -host_project_path = File.expand_path("..", __FILE__) -guest_project_path = "/home/vagrant/#{File.basename(host_project_path)}" -project_name = 'chef' -host_name = "#{project_name}-omnibus-build-lab" -bootstrap_chef_version = '11.12.4' - -Vagrant.configure('2') do |config| - - %w{ - centos-5.10 - centos-6.5 - freebsd-8.3 - freebsd-9.1 - smartos - ubuntu-10.04 - ubuntu-11.04 - ubuntu-12.04 - }.each_with_index do |platform, index| - - config.vm.define platform do |c| - - chef_run_list = [] - - case platform - - #################################################################### - # SMARTOS-SPECIFIC CONFIG - #################################################################### - when 'smartos' - use_nfs = false - - c.vm.box = "smartos-base1310-64-virtualbox-20130806" - c.vm.box_url = "http://dlc-int.openindiana.org/aszeszo/vagrant/smartos-base1310-64-virtualbox-20130806.box" - - # bootstrap chef - c.vm.provision :shell, :inline => <<-SMARTOS_SETUP - which ruby || pkgin -Fy install ruby193 - which gcc || pkgin -Fy install gcc47 - which make || pkgin -Fy install gmake - - gem list chef -i -v #{bootstrap_chef_version} || \ - gem install chef --version #{bootstrap_chef_version} --bindir=/opt/local/bin/ --no-ri --no-rdoc - SMARTOS_SETUP - - #################################################################### - # FREEBSD-SPECIFIC CONFIG - #################################################################### - when /^freebsd/ - use_nfs = true - - # FreeBSD's mount_nfs does not like paths over 88 characters - # http://lists.freebsd.org/pipermail/freebsd-hackers/2012-April/038547.html - ENV['BERKSHELF_PATH'] = File.join('/tmp') - - major_version = platform.split(/freebsd-(.*)\..*/).last - - c.vm.guest = :freebsd - c.vm.box = platform - c.vm.box_url = "http://dyn-vm.s3.amazonaws.com/vagrant/#{platform}_chef-11.8.0.box" - c.vm.network :private_network, :ip => "33.33.33.#{50 + index}" - - c.vm.provision :shell, :inline => <<-FREEBSD_SETUP - sed -i '' -E 's%^([^#].*):setenv=%\1:setenv=PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-#{major_version}-stable/Latest,%' /etc/login.conf - FREEBSD_SETUP - - #################################################################### - # LINUX-SPECIFIC CONFIG - #################################################################### - else - use_nfs = false - - c.vm.box = "opscode-#{platform}" - c.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_#{platform}_chef-provisionerless.box" - c.omnibus.chef_version = bootstrap_chef_version - - c.vm.provider :virtualbox do |vb| - # Give enough horsepower to build without taking all day. - vb.customize [ - 'modifyvm', :id, - '--memory', '1536', - '--cpus', '2' - ] - end - - chef_run_list << 'recipe[apt::default]' - end # case - - #################################################################### - # CONFIG SHARED ACROSS ALL PLATFORMS - #################################################################### - - config.berkshelf.enabled = true - config.ssh.forward_agent = true - - config.vm.synced_folder '.', '/vagrant', :id => 'vagrant-root', :nfs => use_nfs - config.vm.synced_folder host_project_path, guest_project_path, :nfs => use_nfs - - # Uncomment for DEV MODE - # config.vm.synced_folder File.expand_path('../../omnibus-ruby', __FILE__), '/home/vagrant/omnibus-ruby', :nfs => use_nfs - # config.vm.synced_folder File.expand_path('../../omnibus-software', __FILE__), '/home/vagrant/omnibus-software', :nfs => use_nfs - - chef_run_list << 'recipe[omnibus::default]' - - # prepare VM to be an Omnibus builder - c.vm.provision :chef_solo do |chef| - chef.synced_folder_type = "nfs" if use_nfs - chef.json = { - 'omnibus' => { - 'build_user' => 'vagrant', - 'build_dir' => guest_project_path, - 'install_dir' => "/opt/#{project_name}" - } - } - - chef.run_list = chef_run_list - end - - # We have to nuke any chef omnibus packages (used during provisioning) before - # we build new chef omnibus packages! - c.vm.provision :shell, :privileged => true,:inline => <<-REMOVE_OMNIBUS - if command -v dpkg &>/dev/null; then - dpkg -P #{project_name} || true - elif command -v rpm &>/dev/null; then - rpm -ev #{project_name} || true - fi - rm -rf /opt/#{project_name} || true - REMOVE_OMNIBUS - - c.vm.provision :shell, :privileged => false, :inline => <<-OMNIBUS_BUILD - sudo mkdir -p /opt/#{project_name} - sudo chown vagrant /opt/#{project_name} - cd #{guest_project_path} - bundle install --path=/home/vagrant/.bundler - bundle exec omnibus build #{project_name} - OMNIBUS_BUILD - - end # config.vm.define.platform - end # each_with_index -end # Vagrant.configure diff --git a/config/projects/angrychef.rb b/config/projects/angrychef.rb index 139a270ed..42f790464 100644 --- a/config/projects/angrychef.rb +++ b/config/projects/angrychef.rb @@ -1,6 +1,5 @@ # -# Copyright:: Copyright (c) 2012 Chef Software, Inc. -# License:: Apache License, Version 2.0 +# Copyright 2012-2014 Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,13 +14,15 @@ # limitations under the License. # +# # This is a clone of chef that we can install on build and test machines # without interfering with the regular build/test. +# name "angrychef" friendly_name "Angry Chef Client" maintainer "Chef Software, Inc." -homepage "http://www.getchef.com" +homepage "https://www.getchef.com" build_iteration 1 build_version do @@ -32,11 +33,28 @@ output_format :semver end -install_dir "/opt/angrychef" +if windows? + # NOTE: Ruby DevKit fundamentally CANNOT be installed into "Program Files" + # Native gems will use gcc which will barf on files with spaces, + # which is only fixable if everyone in the world fixes their Makefiles + install_dir "#{default_root}/opscode/#{name}" +else + install_dir "#{default_root}/#{name}" +end -resources_path File.join(files_path, "chef") -mac_pkg_identifier "com.getchef.pkg.angrychef" +resources_path "#{Omnibus::Config.project_root}/files/chef" dependency "preparation" dependency "chef" dependency "version-manifest" + +package :rpm do + signing_passphrase ENV['OMNIBUS_RPM_SIGNING_PASSPHRASE'] +end + +package :pkg do + identifier "com.getchef.pkg.angrychef" + signing_identity "Developer ID Installer: Opscode Inc. (9NBR9JL2R2)" +end + +compress :dmg diff --git a/config/projects/chef-container.rb b/config/projects/chef-container.rb index 0d8c13a29..cdf7d49ed 100644 --- a/config/projects/chef-container.rb +++ b/config/projects/chef-container.rb @@ -1,6 +1,5 @@ # -# Copyright:: Copyright (c) 2012-2014 Chef Software, Inc. -# License:: Apache License, Version 2.0 +# Copyright 2014 Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +17,7 @@ name "chef-container" friendly_name "Chef Container" maintainer "Chef Software, Inc" -homepage "http://www.getchef.com" +homepage "https://www.getchef.com" build_iteration 1 build_version do @@ -29,10 +28,7 @@ output_format :semver end -install_dir "/opt/chef" - -resources_path File.join(files_path, "chef") -mac_pkg_identifier "com.getchef.pkg.chef-container" +install_dir "#{default_root}/chef" # use the same rubygems as the chef project override :rubygems, version: "1.8.29" @@ -44,3 +40,14 @@ dependency "chef" dependency "chef-init" dependency "version-manifest" + +package :rpm do + signing_passphrase ENV['OMNIBUS_RPM_SIGNING_PASSPHRASE'] +end + +package :pkg do + identifier "com.getchef.pkg.chef-container" + signing_identity "Developer ID Installer: Opscode Inc. (9NBR9JL2R2)" +end + +compress :dmg diff --git a/config/projects/chef-windows.rb b/config/projects/chef-windows.rb deleted file mode 100644 index 14b7f9fe8..000000000 --- a/config/projects/chef-windows.rb +++ /dev/null @@ -1,73 +0,0 @@ -# -# Copyright:: Copyright (c) 2012 Chef Software, Inc. -# License:: Apache License, Version 2.0 -# -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# 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. -# - -name "chef-windows" -friendly_name "Chef Client" -maintainer "Chef Software, Inc." -homepage "http://www.getchef.com" - -# NOTE: Ruby DevKit fundamentally CANNOT be installed into "Program Files" -# Native gems will use gcc which will barf on files with spaces, -# which is only fixable if everyone in the world fixes their Makefiles -install_dir "c:/opscode/chef" - -build_iteration 1 -build_version do - # Use chef to determine the build version - source :git, from_dependency: 'chef-windows' - - # Output a SemVer compliant version string - output_format :semver -end - -package_name "chef-client" - -override :bundler, version: "1.7.0" -override :ruby, version: "2.1.2" -override :rubygems, version: "2.2.1" - -dependency "preparation" -dependency "chef-windows" - -resources_path File.join(files_path, "chef") - -msi_parameters do - # Find path in which chef gem is installed to. - # Note that install_dir is something like: c:/opscode/chef - search_pattern = "#{install_dir}/**/gems/chef-[0-9]*" - chef_gem_path = Dir.glob(search_pattern).find do |path| - File.directory?(path) - end - - if chef_gem_path.nil? - raise "Could not find a chef gem in `#{search_pattern}'!" - end - - # Convert the chef gem path to a relative path based on install_dir - relative_path = Pathname.new(chef_gem_path) - .relative_path_from(Pathname.new(install_dir)) - .to_s - - # Return the result as a hash - { - # We are going to use this path in the startup command of chef - # service. So we need to change file seperators to make windows - # happy. - chef_gem_path: relative_path.gsub(File::SEPARATOR, File::ALT_SEPARATOR), - upgrade_code: 'D607A85C-BDFA-4F08-83ED-2ECB4DCD6BC5', - } -end diff --git a/config/projects/chef.rb b/config/projects/chef.rb index 2934224e7..4418444a9 100644 --- a/config/projects/chef.rb +++ b/config/projects/chef.rb @@ -1,6 +1,5 @@ # -# Copyright:: Copyright (c) 2012 Chef Software, Inc. -# License:: Apache License, Version 2.0 +# Copyright 2012-2014 Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +17,7 @@ name "chef" friendly_name "Chef Client" maintainer "Chef Software, Inc." -homepage "http://www.getchef.com" +homepage "https://www.getchef.com" build_iteration 1 build_version do @@ -29,15 +28,58 @@ output_format :semver end -install_dir "/opt/chef" - -resources_path File.join(files_path, "chef") -mac_pkg_identifier "com.getchef.pkg.chef" +if windows? + # NOTE: Ruby DevKit fundamentally CANNOT be installed into "Program Files" + # Native gems will use gcc which will barf on files with spaces, + # which is only fixable if everyone in the world fixes their Makefiles + install_dir "#{default_root}/opscode/#{name}" + package_name "chef-client" +else + install_dir "#{default_root}/#{name}" +end -override :bundler, version: "1.7.0" -override :ruby, version: "2.1.2" -override :rubygems, version: "2.2.1" +override :bundler, version: "1.7.2" +# TODO: bump this to 2.1.2 when we can sort out the Solaris compile issues +override :ruby, version: "1.9.3-p547" +override :'ruby-windows', version: "2.0.0-p451" +override :rubygems, version: "2.4.1" dependency "preparation" dependency "chef" dependency "version-manifest" + +package :rpm do + signing_passphrase ENV['OMNIBUS_RPM_SIGNING_PASSPHRASE'] +end + +package :pkg do + identifier "com.getchef.pkg.chef" + signing_identity "Developer ID Installer: Opscode Inc. (9NBR9JL2R2)" +end +compress :dmg + +package :msi do + upgrade_code "D607A85C-BDFA-4F08-83ED-2ECB4DCD6BC5" + + ####################################################################### + # Locate the Chef gem's path relative to the installation directory + ####################################################################### + install_path = Pathname.new(install_dir) + + # Find path in which the Chef gem is installed + search_pattern = "#{install_path}/**/gems/chef-[0-9]*" + chef_gem_path = Pathname.glob(search_pattern).find { |path| path.directory? } + + if chef_gem_path.nil? + raise "Could not find a chef gem in `#{search_pattern}'!" + else + relative_path = chef_gem_path.relative_path_from(install_path) + end + + parameters( + # We are going to use this path in the startup command of chef + # service. So we need to change file seperators to make windows + # happy. + 'ChefGemPath' => windows_safe_path(relative_path.to_s), + ) +end diff --git a/config/projects/chef11-windows.rb b/config/projects/chef11-windows.rb deleted file mode 100644 index b4d611a1d..000000000 --- a/config/projects/chef11-windows.rb +++ /dev/null @@ -1,74 +0,0 @@ -# -# Copyright:: Copyright (c) 2014 Chef Software, Inc. -# License:: Apache License, Version 2.0 -# -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# 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. -# - -name "chef11-windows" -friendly_name "Chef Client" -maintainer "Chef Software, Inc." -homepage "http://www.getchef.com" - -# NOTE: Ruby DevKit fundamentally CANNOT be installed into "Program Files" -# Native gems will use gcc which will barf on files with spaces, -# which is only fixable if everyone in the world fixes their Makefiles -install_dir "c:/opscode/chef" - -build_iteration 1 -build_version do - # Use chef to determine the build version - source :git, from_dependency: 'chef-windows' - - # Output a SemVer compliant version string - output_format :semver -end - -package_name "chef-client" - -override :chef, version: "11-stable" -override :bundler, version: "1.5.2" -override :ruby, version: "1.9.3-p547" -override :rubygems, version: "1.8.29" - -dependency "preparation" -dependency "chef-windows" - -resources_path File.join(files_path, "chef") - -msi_parameters do - # Find path in which chef gem is installed to. - # Note that install_dir is something like: c:/opscode/chef - search_pattern = "#{install_dir}/**/gems/chef-[0-9]*" - chef_gem_path = Dir.glob(search_pattern).find do |path| - File.directory?(path) - end - - if chef_gem_path.nil? - raise "Could not find a chef gem in `#{search_pattern}'!" - end - - # Convert the chef gem path to a relative path based on install_dir - relative_path = Pathname.new(chef_gem_path) - .relative_path_from(Pathname.new(install_dir)) - .to_s - - # Return the result as a hash - { - # We are going to use this path in the startup command of chef - # service. So we need to change file seperators to make windows - # happy. - chef_gem_path: relative_path.gsub(File::SEPARATOR, File::ALT_SEPARATOR), - upgrade_code: 'D607A85C-BDFA-4F08-83ED-2ECB4DCD6BC5', - } -end diff --git a/config/projects/chef11.rb b/config/projects/chef11.rb deleted file mode 100644 index 5752aa085..000000000 --- a/config/projects/chef11.rb +++ /dev/null @@ -1,44 +0,0 @@ -# -# Copyright:: Copyright (c) 2014 Chef Software, Inc. -# License:: Apache License, Version 2.0 -# -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# 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. -# - -name "chef11" -friendly_name "Chef Client" -maintainer "Chef Software, Inc." -homepage "http://www.getchef.com" - -build_iteration 1 -build_version do - # Use chef to determine the build version - source :git, from_dependency: 'chef' - - # Output a SemVer compliant version string - output_format :semver -end - -install_dir "/opt/chef" - -resources_path File.join(files_path, "chef") -mac_pkg_identifier "com.getchef.pkg.chef" - -override :chef, version: "11-stable" -override :bundler, version: "1.5.2" -override :ruby, version: "1.9.3-p547" -override :rubygems, version: "1.8.29" - -dependency "preparation" -dependency "chef" -dependency "version-manifest" diff --git a/config/projects/chefdk-windows.rb b/config/projects/chefdk-windows.rb deleted file mode 100644 index 31cc71de1..000000000 --- a/config/projects/chefdk-windows.rb +++ /dev/null @@ -1,67 +0,0 @@ -# -# Copyright:: Copyright (c) 2012 Chef Software, Inc. -# License:: Apache License, Version 2.0 -# -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# 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. -# - -name "chefdk-windows" -friendly_name "Chef Development Kit" -maintainer "Chef Software, Inc." -homepage "http://www.getchef.com" - -# NOTE: Ruby DevKit fundamentally CANNOT be installed into "Program Files" -# Native gems will use gcc which will barf on files with spaces, -# which is only fixable if everyone in the world fixes their Makefiles -install_dir "c:/opscode/chefdk" - -build_iteration 1 -build_version do - # Use chefdk to determine the build version - source :git, from_dependency: 'chefdk' - - # Output a SemVer compliant version string - output_format :semver -end - -package_name "chef-dk" - -override :berkshelf, version: "master" -override :bundler, version: "1.5.2" -override :libedit, version: "20130712-3.1" -override :libtool, version: "2.4.2" -override :libxml2, version: "2.9.1" -override :libxslt, version: "1.1.28" -override :nokogiri, version: "1.6.1" -override :ruby, version: "2.1.1" -override :'ruby-windows', version: "2.0.0-p451" -override :rubygems, version: "2.2.1" -override :yajl, version: "1.2.0" -override :zlib, version: "1.2.8" - -dependency "preparation" -dependency "ruby-windows" -dependency "ruby-windows-devkit" -dependency "chef-windows" -dependency "chefdk" -dependency "openssl-customization" -dependency "rubygems-customization" -dependency "version-manifest" - -resources_path File.join(files_path, "chefdk") - -msi_parameters do - { - upgrade_code: 'AB1D6FBD-F9DC-4395-BDAD-26C4541168E7', - } -end diff --git a/config/projects/chefdk.rb b/config/projects/chefdk.rb index e6b775add..8f6efdefb 100644 --- a/config/projects/chefdk.rb +++ b/config/projects/chefdk.rb @@ -1,6 +1,5 @@ # -# Copyright:: Copyright (c) 2012 Chef Software, Inc. -# License:: Apache License, Version 2.0 +# Copyright 2014 Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,40 +14,58 @@ # limitations under the License. # -name "chefdk" +name "chefdk" friendly_name "Chef Development Kit" maintainer "Chef Software, Inc." -homepage "http://www.getchef.com" - -install_dir "/opt/chefdk" +homepage "https://www.getchef.com" build_iteration 1 build_version do - # Use chefdk to determine the build version source :git, from_dependency: 'chefdk' - - # Output a SemVer compliant version string output_format :semver end -mac_pkg_identifier "com.getchef.pkg.chefdk" -resources_path File.join(files_path, "chefdk") - -override :berkshelf, version: "master" -override :bundler, version: "1.5.2" -override :libedit, version: "20130712-3.1" -override :libtool, version: "2.4.2" -override :libxml2, version: "2.9.1" -override :libxslt, version: "1.1.28" -override :ruby, version: "2.1.1" -override :rubygems, version: "2.2.1" -override :yajl, version: "1.2.0" -override :zlib, version: "1.2.8" -override :chef, version: "11.14.6" -override :"chef-windows", version: "11.16.0" -override :"test-kitchen", version: "v1.2.1" +if windows? + # NOTE: Ruby DevKit fundamentally CANNOT be installed into "Program Files" + # Native gems will use gcc which will barf on files with spaces, + # which is only fixable if everyone in the world fixes their Makefiles + install_dir "#{default_root}/opscode/#{name}" +else + install_dir "#{default_root}/#{name}" +end + +override :berkshelf, version: "master" +override :bundler, version: "1.7.2" +override :chef, version: "11.16.0" + +# TODO: Can we bump default versions in omnibus-software? +override :libedit, version: "20130712-3.1" +override :libtool, version: "2.4.2" +override :libxml2, version: "2.9.1" +override :libxslt, version: "1.1.28" + +override :ruby, version: "2.1.2" +override :'ruby-windows', version: "2.0.0-p451" +override :rubygems, version: "2.4.1" +override :'test-kitchen', version: "v1.2.1" +override :yajl, version: "1.2.0" +override :zlib, version: "1.2.8" dependency "preparation" dependency "chefdk" -dependency "rubygems-customization" dependency "version-manifest" + +package :rpm do + signing_passphrase ENV['OMNIBUS_RPM_SIGNING_PASSPHRASE'] +end + +package :pkg do + identifier "com.getchef.pkg.chefdk" + signing_identity "Developer ID Installer: Opscode Inc. (9NBR9JL2R2)" +end + +package :msi do + upgrade_code "AB1D6FBD-F9DC-4395-BDAD-26C4541168E7" +end + +compress :dmg diff --git a/config/software/chef-init.rb b/config/software/chef-init.rb index 7838f0f75..ce959f5e3 100644 --- a/config/software/chef-init.rb +++ b/config/software/chef-init.rb @@ -1,6 +1,5 @@ # -# Copyright:: Copyright (c) 2012-2014 Chef Software, Inc. -# License:: Apache License, Version 2.0 +# Copyright 2012-2014 Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,19 +17,21 @@ name "chef-init" default_version "master" -source :git => "https://github.com/opscode/chef-init" +source git: "https://github.com/opscode/chef-init" relative_path "chef-init" -dependency "runit" +dependency "bundler" dependency "chef" - -env = with_standard_compiler_flags(with_embedded_path) +dependency "runit" build do + env = with_standard_compiler_flags(with_embedded_path) + bundle "install", env: env - rake "build", env: env - gem "install pkg/chef-init*.gem " \ - "--bindir '#{install_dir}/bin' " \ - "--no-ri --no-rdoc", env: env + + gem "build chef-init.gemspec", env: env + gem "install chef-init*.gem" \ + " --bindir '#{install_dir}/bin'" \ + " --no-ri --no-rdoc", env: env end diff --git a/config/software/chef-vault.rb b/config/software/chef-vault.rb index a7fc5f2c4..f5ef17d24 100644 --- a/config/software/chef-vault.rb +++ b/config/software/chef-vault.rb @@ -24,20 +24,20 @@ if windows? dependency "ruby-windows" dependency "ruby-windows-devkit" - dependency "chef-windows" else dependency "ruby" dependency "rubygems" - dependency "chef" end +dependency "bundler" +dependency "chef" + build do env = with_standard_compiler_flags(with_embedded_path) bundle "install", env: env gem "build chef-vault.gemspec", env: env - gem "install chef-vault-*.gem" \ " --no-ri --no-rdoc", env: env end diff --git a/config/software/chef-windows.rb b/config/software/chef-windows.rb deleted file mode 100644 index 38067e5b8..000000000 --- a/config/software/chef-windows.rb +++ /dev/null @@ -1,84 +0,0 @@ -# -# Copyright 2012-2014 Chef Software, Inc. -# -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# 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. -# - -name "chef-windows" - -dependency "ruby-windows" #includes rubygems -dependency "libyaml-windows" -dependency "openssl-windows" -dependency "ruby-windows-devkit" -dependency "openssl-customization" -dependency "bundler" -dependency "cacerts" - -default_version "master" - -source :git => "git://github.com/opscode/chef" - -relative_path "chef" - -always_build (self.project.name == "chef-windows") - -build do - block do - if File.exist?("#{project_dir}/chef") - # We are on Chef 10 and need to adjust the relative path. In Chef 10, the - # Chef Client and Chef Server were in the same repo (like Rails), but in - # Chef 11, the server has been moved to its own project. - software.relative_path('chef/chef') - end - end - - # Normally we would symlink the required unix tools. - # However with the introduction of git-cache to speed up omnibus builds, - # we can't do that anymore since git on windows doesn't support symlinks. - # https://groups.google.com/forum/#!topic/msysgit/arTTH5GmHRk - # Therefore we copy the tools to the necessary places. - # We need tar for 'knife cookbook site install' to function correctly - { - 'tar.exe' => 'bsdtar.exe', - 'libarchive-2.dll' => 'libarchive-2.dll', - 'libexpat-1.dll' => 'libexpat-1.dll', - 'liblzma-1.dll' => 'liblzma-1.dll', - 'libbz2-2.dll' => 'libbz2-2.dll', - 'libz-1.dll' => 'libz-1.dll', - }.each do |target, to| - source = "#{install_dir}/embedded/mingw/bin/#{to}" - target = "#{install_dir}/bin/#{target}" - copy(source, target) - end - - rake "gem" - - gem "install pkg/chef*mingw32.gem" \ - " --bindir '#{install_dir}/bin'" \ - " --no-ri --no-rdoc" \ - " --verbose" - - # Depending on which shell is being used, the path environment variable can - # be "PATH" or "Path". If *both* are set, only one is honored. - path_key = ENV.keys.grep(/\Apath\Z/i).first - - bundle "install", env: { - path_key => [ - windows_safe_path(install_dir, 'embedded', 'bin'), - windows_safe_path(install_dir, 'embedded', 'mingw', 'bin'), - windows_safe_path('C:/Windows/system32'), - windows_safe_path('C:/Windows'), - windows_safe_path('C:/Windows/System32/Wbem'), - ].join(File::PATH_SEPARATOR) - } -end diff --git a/config/software/chef.rb b/config/software/chef.rb index cd93a3127..162cfad50 100644 --- a/config/software/chef.rb +++ b/config/software/chef.rb @@ -15,19 +15,29 @@ # name "chef" - -dependency "ruby" -dependency "rubygems" -dependency "libffi" -dependency "bundler" -dependency "appbundler" - default_version "master" -source :git => "git://github.com/opscode/chef" +source git: "git://github.com/opscode/chef" relative_path "chef" +if windows? + dependency "ruby-windows" # includes rubygems + dependency "libyaml-windows" + dependency "openssl-windows" + dependency "ruby-windows-devkit" + dependency "cacerts" +else + dependency "ruby" + dependency "rubygems" + dependency "libffi" +end + +dependency "openssl-customization" +dependency "bundler" +dependency "ohai" +dependency "appbundler" + build do env = with_standard_compiler_flags(with_embedded_path) @@ -46,19 +56,62 @@ def appbundle(app_path, bin_path) end end - # install the whole bundle first - bundle "install --without server docgen", env: env - rake "gem", env: env + if windows? + # Normally we would symlink the required unix tools. + # However with the introduction of git-cache to speed up omnibus builds, + # we can't do that anymore since git on windows doesn't support symlinks. + # https://groups.google.com/forum/#!topic/msysgit/arTTH5GmHRk + # Therefore we copy the tools to the necessary places. + # We need tar for 'knife cookbook site install' to function correctly + { + 'tar.exe' => 'bsdtar.exe', + 'libarchive-2.dll' => 'libarchive-2.dll', + 'libexpat-1.dll' => 'libexpat-1.dll', + 'liblzma-1.dll' => 'liblzma-1.dll', + 'libbz2-2.dll' => 'libbz2-2.dll', + 'libz-1.dll' => 'libz-1.dll', + }.each do |target, to| + copy "#{install_dir}/embedded/mingw/bin/#{to}", "#{install_dir}/bin/#{target}" + end - # Delete the windows gem - command "rm -f pkg/chef-*-x86-mingw32.gem" + gem "build chef-x86-mingw32.gemspec", env: env + gem "install chef*mingw32.gem" \ + " --bindir '#{install_dir}/bin'" \ + " --no-ri --no-rdoc" \ + " --verbose" + + # Depending on which shell is being used, the path environment variable can + # be "PATH" or "Path". If *both* are set, only one is honored. + path_key = ENV.keys.grep(/\Apath\Z/i).first + + bundle "install", env: { + path_key => [ + windows_safe_path(install_dir, 'embedded', 'bin'), + windows_safe_path(install_dir, 'embedded', 'mingw', 'bin'), + windows_safe_path('C:/Windows/system32'), + windows_safe_path('C:/Windows'), + windows_safe_path('C:/Windows/System32/Wbem'), + ].join(File::PATH_SEPARATOR) + } + + else + + # install the whole bundle first + bundle "install --without server docgen", env: env - # Don't use -n #{install_dir}/bin. Appbundler will take care of them later - gem "install pkg/chef-*.gem " \ - " --no-ri --no-rdoc", env: env + gem "build chef.gemspec", env: env + + # Delete the windows gem + delete "chef-*-x86-mingw32.gem" + + # Don't use -n #{install_dir}/bin. Appbundler will take care of them later + gem "install chef*.gem " \ + " --no-ri --no-rdoc", env: env + + end auxiliary_gems = {} - auxiliary_gems['ruby-shadow'] = '>= 0.0.0' unless Ohai['platform'] == 'aix' + auxiliary_gems['ruby-shadow'] = '>= 0.0.0' unless aix? || windows? auxiliary_gems.each do |name, version| gem "install #{name}" \ @@ -72,20 +125,20 @@ def appbundle(app_path, bin_path) unless project.name == "chefdk" mkdir("#{install_dir}/embedded/apps") - appbundler_apps = %w[chef] + appbundler_apps = %w(chef ohai) appbundler_apps.each do |app_name| - copy("#{source_dir}/#{app_name}", "#{install_dir}/embedded/apps/") + copy("#{Omnibus::Config.source_dir}/#{app_name}", "#{install_dir}/embedded/apps/") delete("#{install_dir}/embedded/apps/#{app_name}/.git") appbundle("#{install_dir}/embedded/apps/#{app_name}", "#{install_dir}/bin") end end # Clean up - delete("#{install_dir}/embedded/docs") - delete("#{install_dir}/embedded/share/man") - delete("#{install_dir}/embedded/share/doc") - delete("#{install_dir}/embedded/share/gtk-doc") - delete("#{install_dir}/embedded/ssl/man") - delete("#{install_dir}/embedded/man") - delete("#{install_dir}/embedded/info") + delete "#{install_dir}/embedded/docs" + delete "#{install_dir}/embedded/share/man" + delete "#{install_dir}/embedded/share/doc" + delete "#{install_dir}/embedded/share/gtk-doc" + delete "#{install_dir}/embedded/ssl/man" + delete "#{install_dir}/embedded/man" + delete "#{install_dir}/embedded/info" end diff --git a/config/software/chefdk.rb b/config/software/chefdk.rb index 358c30f7f..79105ad4c 100644 --- a/config/software/chefdk.rb +++ b/config/software/chefdk.rb @@ -17,57 +17,57 @@ name "chefdk" default_version "master" -source :git => "git://github.com/opscode/chef-dk" +source git: "git://github.com/opscode/chef-dk" relative_path "chef-dk" -if platform == 'windows' - dependency "chef-windows" -else - dependency "chef" -end - dependency "libffi" if debian? -dependency "test-kitchen" + +dependency "bundler" dependency "appbundler" dependency "berkshelf" -dependency "ohai" dependency "chef-vault" +dependency "ohai" +dependency "test-kitchen" +dependency "chef" +dependency "openssl-customization" +dependency "rubygems-customization" -build do - env = { - # rubocop pulls in nokogiri 1.5.11, so needs PKG_CONFIG_PATH and - # NOKOGIRI_USE_SYSTEM_LIBRARIES until rubocop stops doing that - "PKG_CONFIG_PATH" => "#{install_dir}/embedded/lib/pkgconfig", - "NOKOGIRI_USE_SYSTEM_LIBRARIES" => "true", - } - env = with_embedded_path(env) +# The devkit has to be installed after rubygems-customization so the +# file it installs gets patched. +dependency "ruby-windows-devkit" if windows? +build do def appbundle(app_path, bin_path) gemfile = File.join(app_path, "Gemfile.lock") env = with_embedded_path.merge("BUNDLE_GEMFILE" => gemfile) - command("#{install_dir}/embedded/bin/appbundler '#{app_path}' '#{bin_path}'", env: env) + command "#{install_dir}/embedded/bin/appbundler '#{app_path}' '#{bin_path}'", env: env end - bundle "install", env: env - rake "build", env: env + env = with_standard_compiler_flags(with_embedded_path).merge( + # Rubocop pulls in nokogiri 1.5.11, so needs PKG_CONFIG_PATH and + # NOKOGIRI_USE_SYSTEM_LIBRARIES until rubocop stops doing that + "PKG_CONFIG_PATH" => "#{install_dir}/embedded/lib/pkgconfig", + "NOKOGIRI_USE_SYSTEM_LIBRARIES" => "true", + ) - gem "install pkg/chef-dk*.gem" \ + bundle "install", env: env + gem "build chef-dk.gemspec", env: env + gem "install chef-dk*.gem" \ " --no-ri --no-rdoc" \ " --verbose", env: env - auxiliary_gems = {} - auxiliary_gems['foodcritic'] = '4.0.0' - auxiliary_gems['chefspec'] = '4.0.1' - auxiliary_gems['fauxhai'] = '2.2.0' - auxiliary_gems['rubocop'] = '0.18.1' - auxiliary_gems['knife-spork'] = '1.4.1' - auxiliary_gems['kitchen-vagrant'] = '0.15.0' - # Strainer build is hosed on windows - # auxiliary_gems['strainer'] = '3.3.0' - # Perform multiple gem installs to better isolate/debug failures - auxiliary_gems.each do |name, version| + { + 'foodcritic' => '4.0.0', + 'chefspec' => '4.0.1', + 'fauxhai' => '2.2.0', + 'rubocop' => '0.18.1', + 'knife-spork' => '1.4.1', + 'kitchen-vagrant' => '0.15.0', + # Strainer build is hosed on windows + # 'strainer' => '0.15.0', + }.each do |name, version| gem "install #{name}" \ " --version '#{version}'" \ " --no-user-install" \ @@ -76,12 +76,11 @@ def appbundle(app_path, bin_path) " --verbose", env: env end - mkdir("#{install_dir}/embedded/apps") + mkdir "#{install_dir}/embedded/apps" - appbundler_apps = %w[chef berkshelf test-kitchen chef-dk chef-vault ohai] - appbundler_apps.each do |app_name| - copy("#{source_dir}/#{app_name}", "#{install_dir}/embedded/apps/") - delete("#{install_dir}/embedded/apps/#{app_name}/.git") - appbundle("#{install_dir}/embedded/apps/#{app_name}", "#{install_dir}/bin") + %w(chef berkshelf test-kitchen chef-dk chef-vault ohai).each do |app_name| + copy "#{Omnibus::Config.source_dir}/#{app_name}", "#{install_dir}/embedded/apps/" + delete "#{install_dir}/embedded/apps/#{app_name}/.git" + appbundle "#{install_dir}/embedded/apps/#{app_name}", "#{install_dir}/bin" end end diff --git a/config/software/ohai.rb b/config/software/ohai.rb index 5a208049a..3f05b0ca5 100644 --- a/config/software/ohai.rb +++ b/config/software/ohai.rb @@ -16,30 +16,28 @@ # name "ohai" +default_version "master" + +source git: "git://github.com/opscode/ohai" + +relative_path "ohai" if windows? dependency "ruby-windows" dependency "ruby-windows-devkit" else dependency "ruby" - dependency "libffi" dependency "rubygems" end dependency "bundler" -default_version "master" - -source :git => "git://github.com/opscode/ohai" - -relative_path "ohai" - -env = with_embedded_path() -env = with_standard_compiler_flags(env) - build do - bundle "install --without development", :env => env - bundle "exec rake gem", :env => env + env = with_standard_compiler_flags(with_embedded_path) + + bundle "install --without development", env: env - gem "install pkg/ohai*.gem --no-rdoc --no-ri", :env => env + gem "build ohai.gemspec", env: env + gem "install ohai*.gem" \ + " --no-ri --no-rdoc", env: env end diff --git a/config/software/openssl-customization.rb b/config/software/openssl-customization.rb index 35df7e488..48ca525af 100644 --- a/config/software/openssl-customization.rb +++ b/config/software/openssl-customization.rb @@ -22,7 +22,9 @@ default_version "0.1.0" -if platform == 'windows' +source path: "#{project.files_path}/#{name}" + +if windows? dependency "ruby-windows" else dependency "ruby" @@ -30,34 +32,31 @@ end build do - if platform == "windows" - block do + if windows? + block "Add OpenSSL customization file" do # gets directories for RbConfig::CONFIG and sanitizes them. def get_sanitized_rbconfig(config) - config_cmd = %Q{#{install_dir}/embedded/bin/ruby -rrbconfig -e "puts RbConfig::CONFIG['#{config}']"} - config_cmd.gsub!('/', '\\') if platform == "windows" + ruby = windows_safe_path("#{install_dir}/embedded/bin/ruby") - config_dir = "" - Bundler.with_clean_env do - config_dir = %x{#{config_cmd}}.strip + config_dir = Bundler.with_clean_env do + command_output = %x|#{ruby} -rrbconfig -e "puts RbConfig::CONFIG['#{config}']"|.strip + windows_safe_path(command_output) end - raise "could not determine embedded ruby's RbConfig::CONFIG['#{config}']" if config_dir.empty? + if config_dir.nil? || config_dir.empty? + raise "could not determine embedded ruby's RbConfig::CONFIG['#{config}']" + end config_dir end - def embedded_ruby_site_dir - get_sanitized_rbconfig('sitelibdir') - end - - def embedded_ruby_lib_dir - get_sanitized_rbconfig('rubylibdir') - end + embedded_ruby_site_dir = get_sanitized_rbconfig('sitelibdir') + embedded_ruby_lib_dir = get_sanitized_rbconfig('rubylibdir') + source_ssl_env_hack = File.join(project_dir, "windows", "ssl_env_hack.rb") destination_ssl_env_hack = File.join(embedded_ruby_site_dir, "ssl_env_hack.rb") - source_ssl_env_hack = File.join(project.files_path, "openssl_customization", "windows", "ssl_env_hack.rb") - FileUtils.cp source_ssl_env_hack, destination_ssl_env_hack + + copy(source_ssl_env_hack, destination_ssl_env_hack) # Unfortunately there is no patch on windows, but luckily we only need to append a line to the openssl.rb # to pick up our script which find the CA bundle in omnibus installations and points SSL_CERT_FILE to it diff --git a/config/software/rubygems-customization.rb b/config/software/rubygems-customization.rb index c9883e585..644e6ac72 100644 --- a/config/software/rubygems-customization.rb +++ b/config/software/rubygems-customization.rb @@ -19,52 +19,35 @@ default_version "0.1.0" -if platform == 'windows' +source path: "#{project.files_path}/#{name}" + +if windows? dependency "ruby-windows" else dependency "ruby" dependency "rubygems" end - - -#/opt/chefdk/embedded/bin/ruby -e 'puts Gem.dir' -# => /opt/chefdk/embedded/lib/ruby/gems/2.1.0 -# -# /opt/chefdk/embedded/bin/ruby -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']" -# => /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0 - -# result should be /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/defaults/operating_system.rb - - build do - sitelibdir_cmd = %Q{#{install_dir}/embedded/bin/ruby -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']"} - - # TODO: use +windows_safe_path+ - sitelibdir_cmd.gsub!('/', '\\') if platform == "windows" - - block do - source_customization_file = if platform == 'windows' - File.join(project.files_path, "rubygems_customization", "windows", "operating_system.rb") + block "Add Rubygems customization file" do + source_customization_file = if windows? + "#{project_dir}/windows/operating_system.rb" else - File.join(project.files_path, "rubygems_customization", "default", "operating_system.rb") - end - embedded_ruby_site_dir = "" - Bundler.with_clean_env do - embedded_ruby_site_dir = %x{#{sitelibdir_cmd}}.strip + "#{project_dir}/default/operating_system.rb" end - raise "could not determine embedded ruby's site dir" if embedded_ruby_site_dir.empty? + site_ruby = Bundler.with_clean_env do + ruby = windows_safe_path("#{install_dir}/embedded/bin/ruby") + %x|#{ruby} -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']"|.strip + end - if sysdrive = ENV['SYSTEMDRIVE'] - match_drive = Regexp.new(Regexp.escape(sysdrive), Regexp::IGNORECASE) - embedded_ruby_site_dir.sub!(match_drive, '') + if site_ruby.nil? || site_ruby.empty? + raise "Could not determine embedded Ruby's site directory, aborting!" end - destination_dir = File.join(embedded_ruby_site_dir, 'rubygems', 'defaults') - destination = File.join(destination_dir, "operating_system.rb") + destination = "#{site_ruby}/rubygems/defaults" - FileUtils.mkdir_p destination_dir + FileUtils.mkdir_p destination FileUtils.cp source_customization_file, destination end end diff --git a/files/chef/mac_pkg/Resources/welcome.html.erb b/files/chef/mac_pkg/Resources/welcome.html.erb deleted file mode 100644 index ce1fa9219..000000000 --- a/files/chef/mac_pkg/Resources/welcome.html.erb +++ /dev/null @@ -1,5 +0,0 @@ - - This installer will help you install Chef Client version <%= version %>. - - - You will be guided through the steps necessary to install this software. diff --git a/files/chef/windows_msi/Resources/parameters.wxi.erb b/files/chef/windows_msi/Resources/parameters.wxi.erb deleted file mode 100644 index b83062f08..000000000 --- a/files/chef/windows_msi/Resources/parameters.wxi.erb +++ /dev/null @@ -1,16 +0,0 @@ - - - - " ?> - " ?> - - " ?> - - " ?> - - diff --git a/files/chefdk/mac_pkg/Resources/welcome.html.erb b/files/chefdk/mac_pkg/Resources/welcome.html.erb deleted file mode 100644 index 730d20403..000000000 --- a/files/chefdk/mac_pkg/Resources/welcome.html.erb +++ /dev/null @@ -1,5 +0,0 @@ - - This installer will help you install Chef Development Kit version <%= version %>. - - - You will be guided through the steps necessary to install this software. diff --git a/files/chefdk/windows_msi/Resources/parameters.wxi.erb b/files/chefdk/windows_msi/Resources/parameters.wxi.erb deleted file mode 100644 index 9602d302b..000000000 --- a/files/chefdk/windows_msi/Resources/parameters.wxi.erb +++ /dev/null @@ -1,15 +0,0 @@ - - - - " ?> - " ?> - - - " ?> - - diff --git a/files/openssl_customization/windows/ssl_env_hack.rb b/files/openssl-customization/windows/ssl_env_hack.rb similarity index 100% rename from files/openssl_customization/windows/ssl_env_hack.rb rename to files/openssl-customization/windows/ssl_env_hack.rb diff --git a/files/rubygems_customization/default/operating_system.rb b/files/rubygems-customization/default/operating_system.rb similarity index 100% rename from files/rubygems_customization/default/operating_system.rb rename to files/rubygems-customization/default/operating_system.rb diff --git a/files/rubygems_customization/windows/operating_system.rb b/files/rubygems-customization/windows/operating_system.rb similarity index 100% rename from files/rubygems_customization/windows/operating_system.rb rename to files/rubygems-customization/windows/operating_system.rb diff --git a/jenkins/build b/jenkins/build index 0104098fc..6968b3cc2 100755 --- a/jenkins/build +++ b/jenkins/build @@ -49,54 +49,9 @@ if [ ! -f build_timestamp ]; then echo "$BUILD_TAG / $BUILD_ID" > build_timestamp fi -mkdir -p jenkins/chef-solo/cache/remote_file - -PATH=/opt/ruby1.9/bin:/usr/local/bin:$PATH +PATH=/opt/ruby-2.1.2/bin:/opt/ruby1.9/bin:/usr/local/bin:$PATH export PATH -# if not_exists chef-solo; then - # sudo gem install chef --no-ri --no-rdoc -# fi - -# ensure bundler is installed -# if not_exists bundle; then - # sudo gem install bundler --no-ri --no-rdoc -# fi - -# TEMPORARY: can't install berks on AIX -if [ "x$os" != "xAIX" ]; then - # ensure berkshelf is installed - # if not_exists berks; then - # sudo gem install berkshelf --no-ri --no-rdoc - # fi - - # install omnibus cookbook and dependencies - # Disable berks install since we don't need it anymore - # berks install --path=vendor/cookbooks - - if [ -f "/etc/release" ] && [ -n "`cat /etc/release | grep -i solaris`" ]; then - dna=`pwd`/jenkins/dna-solaris2.json - else - dna=`pwd`/jenkins/dna.json - fi - # Omnibus build server prep tasks, including build ruby - # TEMPORARY: Temporarily disable chef-solo runs. - # Can be reverted when https://github.com/opscode-cookbooks/omnibus/pull/12 - # is merged and released. - # Note that currently this functionality is not needed since we are far away - # from rebuilding slaves using cookbooks in ci.opscode.us. - # sudo -i env PATH=$PATH chef-solo -c `pwd`/jenkins/solo.rb -j $dna -l debug - # END of temporary change. - # Fix root-owned perms left over from running chef-solo (cache turds, etc) - set +e - if [ "x$os" = "xAIX" ]; then - sudo chown -R root `pwd` - else - sudo chown -R jenkins-node `pwd` || sudo chown -R jenkins `pwd` - fi - set -e -fi - if [ "x$os" = "xAIX" ]; then # AIX is hateful and requires a bunch of root stuff to build BFF packages sudo rm -rf /.info || true @@ -138,10 +93,6 @@ else sudo chown -R jenkins-node "/var/cache/omnibus" || sudo chown -R jenkins "/var/cache/omnibus" fi -# Aaand.. new ruby -PATH=/usr/local/bin:$PATH -export PATH - # horrible hack for solaris 9 to get ffi to compile in the bundle if [ -f "/etc/release" ]; then # solaris /bin/sh needs the stupid || true or set -x bombs here @@ -154,19 +105,12 @@ if [ -f "/etc/release" ]; then fi # docs do not install on solaris 9 -bundle install --without docs +bundle install --without development if [ "$RELEASE_BUILD" = "true" ]; then - bundle exec omnibus build $OMNIBUS_PROJECT_NAME -l debug --no-timestamp + bundle exec omnibus build $OMNIBUS_PROJECT_NAME -l internal --override append_timestamp:false else - bundle exec omnibus build $OMNIBUS_PROJECT_NAME -l debug -fi - -# Sign the package on some platforms: -if [ "x$os" != "xAIX" ]; then - if exists rpm; then - sudo -i `pwd`/jenkins/sign-rpm "foo" `pwd`/pkg/*rpm - fi + bundle exec omnibus build $OMNIBUS_PROJECT_NAME -l internal fi # Dump the build-generated version so the Omnitruck release script uses the diff --git a/jenkins/build.bat b/jenkins/build.bat index 7a3011824..bbcda327b 100644 --- a/jenkins/build.bat +++ b/jenkins/build.bat @@ -7,41 +7,26 @@ if "%OMNIBUS_PROJECT_NAME%"=="" ( EXIT /B 1 ) -rem # IF NOT EXIST jenkins\chef-solo\cache mkdir jenkins\chef-solo\cache - IF "%CLEAN%"=="true" ( rmdir /Q /S c:\opscode rmdir /Q /S c:\omnibus-ruby rmdir /Q /S .\pkg ) -call bundle install || GOTO :error +set PATH=C:\Ruby193\bin;%PATH% +set SSL_CERT_FILE=C:\Ruby193\ssl\certs\cacert.pem -rem # ensure berkshelf is installed -where /q berks -IF NOT %ERRORLEVEL% == 0 ( - call gem install berkshelf --no-ri --no-rdoc -) +call bundle install --without development || GOTO :error -rem # install omnibus cookbook and dependencies -rem # Disable berks install since we don't need it anymore -rem # call berks install --path=vendor/cookbooks +IF "%RELEASE_BUILD%"=="true" ( -rem # TEMPORARY: Temporarily disable chef-solo runs. -rem # Can be reverted when https://github.com/opscode-cookbooks/omnibus/pull/12 -rem # is merged and released. -rem # Note that currently this functionality is not needed since we are far away -rem # from rebuilding slaves using cookbooks in ci.opscode.us. -rem # call chef-solo -c .\jenkins\solo.rb -j .\jenkins\dna-windows.json -l debug || GOTO :error + call bundle exec omnibus build %OMNIBUS_PROJECT_NAME% -l internal --override append_timestamp:false || GOTO :error -rem # we're guaranteed to have the correct ruby installed into C:\Ruby193 from chef-solo cookbooks -rem # bundle install from here now too -set PATH=C:\Ruby193\bin;%PATH% -rem # ensure the installed certificate authority is loaded -set SSL_CERT_FILE=C:\Ruby193\ssl\certs\cacert.pem -call bundle install || GOTO :error +) ELSE ( -call bundle exec omnibus build %OMNIBUS_PROJECT_NAME%-windows -l debug || GOTO :error + call bundle exec omnibus build %OMNIBUS_PROJECT_NAME% -l internal || GOTO :error + +) GOTO :EOF diff --git a/jenkins/client-test b/jenkins/client-test index d5f97d9b1..3060c3741 100755 --- a/jenkins/client-test +++ b/jenkins/client-test @@ -140,11 +140,6 @@ if [ ! -f "/opt/chef/bin/ohai" ]; then exit 1 fi -if [ ! -f "/opt/chef/bin/erubis" ]; then - echo "/opt/chef/bin/erubis binary was not installed correctly, chef depends on this!" - exit 1 -fi - # we test using the specs packaged in the gem cd /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-[0-9]* diff --git a/jenkins/client-test.bat b/jenkins/client-test.bat index a5f827369..b701fed70 100644 --- a/jenkins/client-test.bat +++ b/jenkins/client-test.bat @@ -35,7 +35,6 @@ IF NOT EXIST chef-client GOTO :error IF NOT EXIST chef-solo GOTO :error IF NOT EXIST knife GOTO :error IF NOT EXIST ohai GOTO :error -IF NOT EXIST erubis GOTO :error rem # uninstall chef call msiexec /qb /x %TMP%\install.msi || GOTO :error diff --git a/jenkins/sign-rpm b/jenkins/sign-rpm deleted file mode 100755 index 19519f2ce..000000000 --- a/jenkins/sign-rpm +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env ruby - -unless password = ARGV[0] and package = ARGV[1] - STDERR.puts "Usage: sign-rpm PASSWORD PACKAGE" - exit 1 -end - -require 'pty' - -rpm_cmd = "rpm --addsign #{package}" - -puts rpm_cmd -PTY.spawn(rpm_cmd) do |r,w,pid| - prompt = r.read(19) - - # match the expected prompt exactly, since that's the only way we know if - # something went wrong. - unless prompt == "Enter pass phrase: " - STDERR.puts "unexpected output from `#{rpm_cmd}`: '#{prompt}'" - Process.kill(:KILL, pid) - exit 1 - end - - STDOUT.puts prompt - w.write("#{password}\n") - - # Keep printing output unti the command exits - loop do - begin - line = r.gets - puts line - if line =~ /failed/ - STDERR.puts "RPM signing failure" - exit 1 - end - rescue Errno::EIO - break - end - end -end - diff --git a/omnibus.rb b/omnibus.rb index 158d23708..7bace126b 100644 --- a/omnibus.rb +++ b/omnibus.rb @@ -1,9 +1,47 @@ -# s3_access_key "something" -# s3_secret_key "something" +# +# This file is used to configure the Omnibus projects in this repo. It contains +# some minimal configuration examples for working with Omnibus. For a full list +# of configurable options, please see the documentation for +omnibus/config.rb+. +# -s3_bucket "opscode-omnibus-cache" +# Build internally +# ------------------------------ +# By default, Omnibus uses system folders (like +/var+ and +/opt+) to build and +# cache components. If you would to build everything internally, you can +# uncomment the following options. This will prevent the need for root +# permissions in most cases. +# +# Uncomment this line to change the default base directory to "local" +# ------------------------------------------------------------------- +# base_dir './local' +# +# Alternatively you can tune the individual values +# ------------------------------------------------ +# cache_dir './local/omnibus/cache' +# git_cache_dir './local/omnibus/cache/git_cache' +# source_dir './local/omnibus/src' +# build_dir './local/omnibus/build' +# package_dir './local/omnibus/pkg' +# package_tmp './local/omnibus/pkg-tmp' + +# Disable git caching +# ------------------------------ +# use_git_caching false + +# Enable S3 asset caching +# ------------------------------ use_s3_caching true -solaris_compiler "gcc" -build_dmg true -sign_pkg true -signing_identity "Developer ID Installer: Opscode Inc. (9NBR9JL2R2)" +s3_access_key ENV['AWS_ACCESS_KEY_ID'] +s3_secret_key ENV['AWS_SECRET_ACCESS_KEY'] +s3_bucket 'opscode-omnibus-cache' + +# Customize compiler bits +# ------------------------------ +solaris_compiler 'gcc' +build_retries 3 +fetcher_read_timeout 120 + +# Load additional software +# ------------------------------ +# software_gems ['omnibus-software', 'my-company-software'] +# local_software_dirs ['/path/to/local/software'] diff --git a/omnibus.rb.example b/omnibus.rb.example deleted file mode 100644 index 659cddef7..000000000 --- a/omnibus.rb.example +++ /dev/null @@ -1,14 +0,0 @@ -# TODO: Remove this file when opscode-ci starts using omnibus.rb -# This file is currently being used in omnibus build pipelines only. -# Once opscode-ci cookbook is updated to use omnibus.rb this file -# should be removed. - -# s3_access_key "something" -# s3_secret_key "something" - -s3_bucket "opscode-omnibus-cache" -use_s3_caching true -solaris_compiler "gcc" -build_dmg true -sign_pkg true -signing_identity "Developer ID Installer: Opscode Inc. (9NBR9JL2R2)" diff --git a/package-scripts/angrychef/aix/opscode.angrychef.client.template b/package-scripts/angrychef/aix/opscode.angrychef.client.template deleted file mode 100644 index 6d83ac725..000000000 --- a/package-scripts/angrychef/aix/opscode.angrychef.client.template +++ /dev/null @@ -1,19 +0,0 @@ -Package Name: angrychef -Package VRMF: TBS -Update: N -Fileset - Fileset Name: angrychef - Fileset VRMF: TBS - Fileset Description: Opscode Angry Chef Client - USRLIBLPPFiles - Configuration Script: /opt/angrychef/bin/postinstall.sh - Unconfiguration Script: /opt/angrychef/bin/unpostinstall.sh - EOUSRLIBLPPFiles - Bosboot required: N - License agreement acceptance required: N - Include license files in this package: N - Requisites: - ROOT Part: N - ROOTFiles - EOROOTFiles - USRFiles diff --git a/package-scripts/angrychef/aix/opscode.angrychef.client.template.last b/package-scripts/angrychef/aix/opscode.angrychef.client.template.last deleted file mode 100644 index a18af5f2c..000000000 --- a/package-scripts/angrychef/aix/opscode.angrychef.client.template.last +++ /dev/null @@ -1,2 +0,0 @@ -EOUSRFiles -EOFileset diff --git a/package-scripts/angrychef/aix/postinstall.sh b/package-scripts/angrychef/aix/postinstall.sh deleted file mode 100644 index 49df24bb1..000000000 --- a/package-scripts/angrychef/aix/postinstall.sh +++ /dev/null @@ -1,5 +0,0 @@ -ln -sn /opt/angrychef/bin/chef-client /usr/bin/chef-client -ln -sn /opt/angrychef/bin/chef-solo /usr/bin/chef-solo -ln -sn /opt/angrychef/bin/knife /usr/bin/knife -ln -sn /opt/angrychef/bin/ohai /usr/bin/ohai -ln -sn /opt/angrychef/bin/shef /usr/bin/shef diff --git a/package-scripts/angrychef/aix/unpostinstall.sh b/package-scripts/angrychef/aix/unpostinstall.sh deleted file mode 100644 index 9e1094f91..000000000 --- a/package-scripts/angrychef/aix/unpostinstall.sh +++ /dev/null @@ -1,6 +0,0 @@ -rm -f /usr/bin/chef-client -rm -f /usr/bin/chef-solo -rm -f /usr/bin/knife -rm -f /usr/bin/ohai -rm -f /usr/bin/shef - diff --git a/package-scripts/angrychef/makeselfinst b/package-scripts/angrychef/makeselfinst deleted file mode 100755 index ae09581a3..000000000 --- a/package-scripts/angrychef/makeselfinst +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh -# WARNING: REQUIRES /bin/sh -# -# - must run on /bin/sh on solaris 9 -# - must run on /bin/sh on AIX 6.x -# - if you think you are a bash wizard, you probably do not understand -# this programming language. do not touch. -# - if you are under 40, get peer review from your elders. -# -# Install a full Opscode Client -# - -PROGNAME=`basename $0` -INSTALLER_DIR=`dirname $0` -DEST_DIR=/opt/angrychef -CONFIG_DIR=/etc/chef -USAGE="usage: $0 [-v validation_key] ([-o organization] || [-u url])" - -error_exit() -{ - echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - exit 1 -} - -is_smartos() -{ - uname -v | grep "^joyent" 2>&1 >/dev/null -} - -if is_smartos; then - PREFIX="/opt/local" -else - PREFIX="/usr" -fi - -validation_key= -organization= -chef_url= - -while getopts o:u:v: opt -do - case "$opt" in - v) validation_key="${OPTARG}";; - o) organization="${OPTARG}"; chef_url="https://api.opscode.com/organizations/${OPTARG}";; - u) chef_url="${OPTARG}";; - \?) # unknown flag - echo >&2 ${USAGE} - exit 1;; - esac -done -shift `expr ${OPTIND} - 1` - -rm -rf $DEST_DIR/* || error_exit "Cannot remove contents of $DEST_DIR" -mkdir -p $DEST_DIR || error_exit "Cannot create $DEST_DIR" -cp -R $INSTALLER_DIR $DEST_DIR || error_exit "Cannot install to $DEST_DIR" -rm -f $DEST_DIR/$PROGNAME - -if [ "" != "$chef_url" ]; then - mkdir -p ${CONFIG_DIR} || error_exit "Cannot create ${CONFIG_DIR}!" - ( - cat <<'EOP' -log_level :info -log_location STDOUT -EOP - ) > ${CONFIG_DIR}/client.rb - if [ "" != "$chef_url" ]; then - echo "chef_server_url '${chef_url}'" >> ${CONFIG_DIR}/client.rb - fi - if [ "" != "$organization" ]; then - echo "validation_client_name '${organization}-validator'" >> ${CONFIG_DIR}/client.rb - fi - chmod 644 ${CONFIG_DIR}/client.rb -fi - -if [ "" != "$validation_key" ]; then - cp ${validation_key} ${CONFIG_DIR}/validation.pem || error_exit "Cannot copy the validation key!" - chmod 600 ${CONFIG_DIR}/validation.pem -fi - -ln -sf $DEST_DIR/bin/chef-client $PREFIX/bin || error_exit "Cannot link chef-client to $PREFIX/bin" -ln -sf $DEST_DIR/bin/chef-solo $PREFIX/bin || error_exit "Cannot link chef-solo to $PREFIX/bin" -ln -sf $DEST_DIR/bin/chef-apply $PREFIX/bin || error_exit "Cannot link chef-apply to $PREFIX/bin" -ln -sf $DEST_DIR/bin/chef-shell $PREFIX/bin || error_exit "Cannot link chef-shell to $PREFIX/bin" -ln -sf $DEST_DIR/bin/knife $PREFIX/bin || error_exit "Cannot link knife to $PREFIX/bin" -ln -sf $DEST_DIR/bin/shef $PREFIX/bin || error_exit "Cannot link shef to $PREFIX/bin" -ln -sf $DEST_DIR/bin/ohai $PREFIX/bin || error_exit "Cannot link ohai to $PREFIX/bin" - -echo "Thank you for installing Chef!" - -exit 0 diff --git a/package-scripts/angrychef/postinstall b/package-scripts/angrychef/postinstall deleted file mode 100755 index 46726d97f..000000000 --- a/package-scripts/angrychef/postinstall +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -# -# Install a full Opscode Client -# - -PROGNAME=`basename $0` -INSTALLER_DIR=/opt/angrychef -CONFIG_DIR=/etc/chef -USAGE="usage: $0 [-v validation_key] ([-o organization] || [-u url])" - -error_exit() -{ - echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - exit 1 -} - -is_smartos() -{ - uname -v | grep ^joyent 2>&1>/dev/null -} - -if is_smartos; then - PREFIX="/opt/local" -else - PREFIX="/usr" -fi - -validation_key= -organization= -chef_url= - -while getopts o:u:v: opt -do - case "$opt" in - v) validation_key="${OPTARG}";; - o) organization="${OPTARG}"; chef_url="https://api.opscode.com/organizations/${OPTARG}";; - u) chef_url="${OPTARG}";; - \?) # unknown flag - echo >&2 ${USAGE} - exit 1;; - esac -done -shift `expr ${OPTIND} - 1` - -if [ "" != "$chef_url" ]; then - mkdir -p ${CONFIG_DIR} || error_exit "Cannot create ${CONFIG_DIR}!" - ( - cat <<'EOP' -log_level :info -log_location STDOUT -EOP - ) > ${CONFIG_DIR}/client.rb - if [ "" != "$chef_url" ]; then - echo "chef_server_url '${chef_url}'" >> ${CONFIG_DIR}/client.rb - fi - if [ "" != "$organization" ]; then - echo "validation_client_name '${organization}-validator'" >> ${CONFIG_DIR}/client.rb - fi - chmod 644 ${CONFIG_DIR}/client.rb -fi - -if [ "" != "$validation_key" ]; then - cp ${validation_key} ${CONFIG_DIR}/validation.pem || error_exit "Cannot copy the validation key!" - chmod 600 ${CONFIG_DIR}/validation.pem -fi - -# rm -f before ln -sf is required for solaris 9 -rm -f $PREFIX/bin/chef-client -rm -f $PREFIX/bin/chef-solo -rm -f $PREFIX/bin/knife -rm -f $PREFIX/bin/shef -rm -f $PREFIX/bin/ohai - -ln -sf $INSTALLER_DIR/bin/chef-client $PREFIX/bin || error_exit "Cannot link chef-client to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/chef-solo $PREFIX/bin || error_exit "Cannot link chef-solo to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/chef-apply $PREFIX/bin || error_exit "Cannot link chef-apply to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/chef-shell $PREFIX/bin || error_exit "Cannot link chef-shell to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/knife $PREFIX/bin || error_exit "Cannot link knife to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/shef $PREFIX/bin || error_exit "Cannot link shef to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/ohai $PREFIX/bin || error_exit "Cannot link ohai to $PREFIX/bin" - -echo "Thank you for installing Chef!" - -exit 0 diff --git a/package-scripts/chef-container/makeselfinst b/package-scripts/chef-container/makeselfinst deleted file mode 100755 index 3945a2d84..000000000 --- a/package-scripts/chef-container/makeselfinst +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -# WARNING: REQUIRES /bin/sh -# -# - must run on /bin/sh on solaris 9 -# - must run on /bin/sh on AIX 6.x -# - if you think you are a bash wizard, you probably do not understand -# this programming language. do not touch. -# - if you are under 40, get peer review from your elders. -# -# Install a full Opscode Client -# - -PROGNAME=`basename $0` -INSTALLER_DIR=`dirname $0` -DEST_DIR=/opt/chef -CONFIG_DIR=/etc/chef -USAGE="usage: $0 [-v validation_key] ([-o organization] || [-u url])" - -error_exit() -{ - echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - exit 1 -} - -is_smartos() -{ - uname -v | grep "^joyent" 2>&1 >/dev/null -} - -if is_smartos; then - PREFIX="/opt/local" -else - PREFIX="/usr" -fi - -validation_key= -organization= -chef_url= - -while getopts o:u:v: opt -do - case "$opt" in - v) validation_key="${OPTARG}";; - o) organization="${OPTARG}"; chef_url="https://api.opscode.com/organizations/${OPTARG}";; - u) chef_url="${OPTARG}";; - \?) # unknown flag - echo >&2 ${USAGE} - exit 1;; - esac -done -shift `expr ${OPTIND} - 1` - -rm -rf $DEST_DIR/* || error_exit "Cannot remove contents of $DEST_DIR" -mkdir -p $DEST_DIR || error_exit "Cannot create $DEST_DIR" -cp -R $INSTALLER_DIR $DEST_DIR || error_exit "Cannot install to $DEST_DIR" -rm -f $DEST_DIR/$PROGNAME - -if [ "" != "$chef_url" ]; then - mkdir -p ${CONFIG_DIR} || error_exit "Cannot create ${CONFIG_DIR}!" - ( - cat <<'EOP' -log_level :info -log_location STDOUT -EOP - ) > ${CONFIG_DIR}/client.rb - if [ "" != "$chef_url" ]; then - echo "chef_server_url '${chef_url}'" >> ${CONFIG_DIR}/client.rb - fi - if [ "" != "$organization" ]; then - echo "validation_client_name '${organization}-validator'" >> ${CONFIG_DIR}/client.rb - fi - chmod 644 ${CONFIG_DIR}/client.rb -fi - -if [ "" != "$validation_key" ]; then - cp ${validation_key} ${CONFIG_DIR}/validation.pem || error_exit "Cannot copy the validation key!" - chmod 600 ${CONFIG_DIR}/validation.pem -fi - -ln -sf $DEST_DIR/bin/chef-init $PREFIX/bin || error_exit "Cannot link chef-init to $PREFIX/bin" -ln -sf $DEST_DIR/bin/chef-client $PREFIX/bin || error_exit "Cannot link chef-client to $PREFIX/bin" -ln -sf $DEST_DIR/bin/chef-solo $PREFIX/bin || error_exit "Cannot link chef-solo to $PREFIX/bin" -ln -sf $DEST_DIR/bin/chef-apply $PREFIX/bin || error_exit "Cannot link chef-apply to $PREFIX/bin" -ln -sf $DEST_DIR/bin/chef-shell $PREFIX/bin || error_exit "Cannot link chef-shell to $PREFIX/bin" -ln -sf $DEST_DIR/bin/knife $PREFIX/bin || error_exit "Cannot link knife to $PREFIX/bin" -ln -sf $DEST_DIR/bin/shef $PREFIX/bin || error_exit "Cannot link shef to $PREFIX/bin" -ln -sf $DEST_DIR/bin/ohai $PREFIX/bin || error_exit "Cannot link ohai to $PREFIX/bin" - -echo "Thank you for installing Chef Container!" - -exit 0 diff --git a/package-scripts/chef-container/postinstall b/package-scripts/chef-container/postinstall deleted file mode 100755 index a7c51a81e..000000000 --- a/package-scripts/chef-container/postinstall +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# -# Install a full Opscode Client -# - -PROGNAME=`basename $0` -INSTALLER_DIR=/opt/chef -CONFIG_DIR=/etc/chef -USAGE="usage: $0 [-v validation_key] ([-o organization] || [-u url])" - -error_exit() -{ - echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - exit 1 -} - -is_smartos() -{ - uname -v | grep ^joyent 2>&1>/dev/null -} - -if is_smartos; then - PREFIX="/opt/local" -else - PREFIX="/usr" -fi - -validation_key= -organization= -chef_url= - -while getopts o:u:v: opt -do - case "$opt" in - v) validation_key="${OPTARG}";; - o) organization="${OPTARG}"; chef_url="https://api.opscode.com/organizations/${OPTARG}";; - u) chef_url="${OPTARG}";; - \?) # unknown flag - echo >&2 ${USAGE} - exit 1;; - esac -done -shift `expr ${OPTIND} - 1` - -if [ "" != "$chef_url" ]; then - mkdir -p ${CONFIG_DIR} || error_exit "Cannot create ${CONFIG_DIR}!" - ( - cat <<'EOP' -log_level :info -log_location STDOUT -EOP - ) > ${CONFIG_DIR}/client.rb - if [ "" != "$chef_url" ]; then - echo "chef_server_url '${chef_url}'" >> ${CONFIG_DIR}/client.rb - fi - if [ "" != "$organization" ]; then - echo "validation_client_name '${organization}-validator'" >> ${CONFIG_DIR}/client.rb - fi - chmod 644 ${CONFIG_DIR}/client.rb -fi - -if [ "" != "$validation_key" ]; then - cp ${validation_key} ${CONFIG_DIR}/validation.pem || error_exit "Cannot copy the validation key!" - chmod 600 ${CONFIG_DIR}/validation.pem -fi - -chef_binaries="chef-init chef-client chef-solo chef-apply chef-shell knife shef ohai" - -# rm -f before ln -sf is required for solaris 9 -for binary in $chef_binaries; do - rm -f $PREFIX/bin/$binary -end - -for binary in $chef_binaries; do - ln -sf $INSTALLER_DIR/bin/$binary $PREFIX/bin || error_exit "Cannt link $binary to $PREFIX/bin" -done - -echo "Thank you for installing Chef Container!" - -exit 0 diff --git a/package-scripts/chef/aix/opscode.chef.client.template b/package-scripts/chef/aix/opscode.chef.client.template deleted file mode 100644 index 5251c20ae..000000000 --- a/package-scripts/chef/aix/opscode.chef.client.template +++ /dev/null @@ -1,19 +0,0 @@ -Package Name: chef -Package VRMF: TBS -Update: N -Fileset - Fileset Name: chef - Fileset VRMF: TBS - Fileset Description: Opscode Chef Client - USRLIBLPPFiles - Configuration Script: /opt/chef/bin/postinstall.sh - Unconfiguration Script: /opt/chef/bin/unpostinstall.sh - EOUSRLIBLPPFiles - Bosboot required: N - License agreement acceptance required: N - Include license files in this package: N - Requisites: - ROOT Part: N - ROOTFiles - EOROOTFiles - USRFiles diff --git a/package-scripts/chef/aix/opscode.chef.client.template.last b/package-scripts/chef/aix/opscode.chef.client.template.last deleted file mode 100644 index a18af5f2c..000000000 --- a/package-scripts/chef/aix/opscode.chef.client.template.last +++ /dev/null @@ -1,2 +0,0 @@ -EOUSRFiles -EOFileset diff --git a/package-scripts/chef/aix/postinstall.sh b/package-scripts/chef/aix/postinstall.sh deleted file mode 100644 index 3bab2a79d..000000000 --- a/package-scripts/chef/aix/postinstall.sh +++ /dev/null @@ -1,6 +0,0 @@ -ln -sn /opt/chef/bin/chef-client /usr/bin/chef-client -ln -sn /opt/chef/bin/chef-solo /usr/bin/chef-solo -ln -sn /opt/chef/bin/knife /usr/bin/knife -ln -sn /opt/chef/bin/ohai /usr/bin/ohai -ln -sn /opt/chef/bin/shef /usr/bin/shef - diff --git a/package-scripts/chef/aix/unpostinstall.sh b/package-scripts/chef/aix/unpostinstall.sh deleted file mode 100644 index 9e1094f91..000000000 --- a/package-scripts/chef/aix/unpostinstall.sh +++ /dev/null @@ -1,6 +0,0 @@ -rm -f /usr/bin/chef-client -rm -f /usr/bin/chef-solo -rm -f /usr/bin/knife -rm -f /usr/bin/ohai -rm -f /usr/bin/shef - diff --git a/package-scripts/chef/makeselfinst b/package-scripts/chef/makeselfinst deleted file mode 100755 index 4989cff38..000000000 --- a/package-scripts/chef/makeselfinst +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh -# WARNING: REQUIRES /bin/sh -# -# - must run on /bin/sh on solaris 9 -# - must run on /bin/sh on AIX 6.x -# - if you think you are a bash wizard, you probably do not understand -# this programming language. do not touch. -# - if you are under 40, get peer review from your elders. -# -# Install a full Opscode Client -# - -PROGNAME=`basename $0` -INSTALLER_DIR=`dirname $0` -DEST_DIR=/opt/chef -CONFIG_DIR=/etc/chef -USAGE="usage: $0 [-v validation_key] ([-o organization] || [-u url])" - -error_exit() -{ - echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - exit 1 -} - -is_smartos() -{ - uname -v | grep "^joyent" 2>&1 >/dev/null -} - -if is_smartos; then - PREFIX="/opt/local" -else - PREFIX="/usr" -fi - -validation_key= -organization= -chef_url= - -while getopts o:u:v: opt -do - case "$opt" in - v) validation_key="${OPTARG}";; - o) organization="${OPTARG}"; chef_url="https://api.opscode.com/organizations/${OPTARG}";; - u) chef_url="${OPTARG}";; - \?) # unknown flag - echo >&2 ${USAGE} - exit 1;; - esac -done -shift `expr ${OPTIND} - 1` - -rm -rf $DEST_DIR/* || error_exit "Cannot remove contents of $DEST_DIR" -mkdir -p $DEST_DIR || error_exit "Cannot create $DEST_DIR" -cp -R $INSTALLER_DIR $DEST_DIR || error_exit "Cannot install to $DEST_DIR" -rm -f $DEST_DIR/$PROGNAME - -if [ "" != "$chef_url" ]; then - mkdir -p ${CONFIG_DIR} || error_exit "Cannot create ${CONFIG_DIR}!" - ( - cat <<'EOP' -log_level :info -log_location STDOUT -EOP - ) > ${CONFIG_DIR}/client.rb - if [ "" != "$chef_url" ]; then - echo "chef_server_url '${chef_url}'" >> ${CONFIG_DIR}/client.rb - fi - if [ "" != "$organization" ]; then - echo "validation_client_name '${organization}-validator'" >> ${CONFIG_DIR}/client.rb - fi - chmod 644 ${CONFIG_DIR}/client.rb -fi - -if [ "" != "$validation_key" ]; then - cp ${validation_key} ${CONFIG_DIR}/validation.pem || error_exit "Cannot copy the validation key!" - chmod 600 ${CONFIG_DIR}/validation.pem -fi - -ln -sf $DEST_DIR/bin/chef-client $PREFIX/bin || error_exit "Cannot link chef-client to $PREFIX/bin" -ln -sf $DEST_DIR/bin/chef-solo $PREFIX/bin || error_exit "Cannot link chef-solo to $PREFIX/bin" -ln -sf $DEST_DIR/bin/chef-apply $PREFIX/bin || error_exit "Cannot link chef-apply to $PREFIX/bin" -ln -sf $DEST_DIR/bin/chef-shell $PREFIX/bin || error_exit "Cannot link chef-shell to $PREFIX/bin" -ln -sf $DEST_DIR/bin/knife $PREFIX/bin || error_exit "Cannot link knife to $PREFIX/bin" -ln -sf $DEST_DIR/bin/shef $PREFIX/bin || error_exit "Cannot link shef to $PREFIX/bin" -ln -sf $DEST_DIR/bin/ohai $PREFIX/bin || error_exit "Cannot link ohai to $PREFIX/bin" - -echo "Thank you for installing Chef!" - -exit 0 diff --git a/package-scripts/chef/postinstall b/package-scripts/chef/postinstall deleted file mode 100755 index b9556a5cd..000000000 --- a/package-scripts/chef/postinstall +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -# -# Install a full Opscode Client -# - -PROGNAME=`basename $0` -INSTALLER_DIR=/opt/chef -CONFIG_DIR=/etc/chef -USAGE="usage: $0 [-v validation_key] ([-o organization] || [-u url])" - -error_exit() -{ - echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - exit 1 -} - -is_smartos() -{ - uname -v | grep ^joyent 2>&1>/dev/null -} - -if is_smartos; then - PREFIX="/opt/local" -else - PREFIX="/usr" -fi - -validation_key= -organization= -chef_url= - -while getopts o:u:v: opt -do - case "$opt" in - v) validation_key="${OPTARG}";; - o) organization="${OPTARG}"; chef_url="https://api.opscode.com/organizations/${OPTARG}";; - u) chef_url="${OPTARG}";; - \?) # unknown flag - echo >&2 ${USAGE} - exit 1;; - esac -done -shift `expr ${OPTIND} - 1` - -if [ "" != "$chef_url" ]; then - mkdir -p ${CONFIG_DIR} || error_exit "Cannot create ${CONFIG_DIR}!" - ( - cat <<'EOP' -log_level :info -log_location STDOUT -EOP - ) > ${CONFIG_DIR}/client.rb - if [ "" != "$chef_url" ]; then - echo "chef_server_url '${chef_url}'" >> ${CONFIG_DIR}/client.rb - fi - if [ "" != "$organization" ]; then - echo "validation_client_name '${organization}-validator'" >> ${CONFIG_DIR}/client.rb - fi - chmod 644 ${CONFIG_DIR}/client.rb -fi - -if [ "" != "$validation_key" ]; then - cp ${validation_key} ${CONFIG_DIR}/validation.pem || error_exit "Cannot copy the validation key!" - chmod 600 ${CONFIG_DIR}/validation.pem -fi - -# rm -f before ln -sf is required for solaris 9 -rm -f $PREFIX/bin/chef-client -rm -f $PREFIX/bin/chef-solo -rm -f $PREFIX/bin/knife -rm -f $PREFIX/bin/shef -rm -f $PREFIX/bin/ohai - -ln -sf $INSTALLER_DIR/bin/chef-client $PREFIX/bin || error_exit "Cannot link chef-client to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/chef-solo $PREFIX/bin || error_exit "Cannot link chef-solo to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/chef-apply $PREFIX/bin || error_exit "Cannot link chef-apply to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/chef-shell $PREFIX/bin || error_exit "Cannot link chef-shell to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/knife $PREFIX/bin || error_exit "Cannot link knife to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/shef $PREFIX/bin || error_exit "Cannot link shef to $PREFIX/bin" -ln -sf $INSTALLER_DIR/bin/ohai $PREFIX/bin || error_exit "Cannot link ohai to $PREFIX/bin" - -echo "Thank you for installing Chef!" - -exit 0 diff --git a/package-scripts/chefdk/postinstall b/package-scripts/chefdk/postinstall deleted file mode 100755 index ef73ba756..000000000 --- a/package-scripts/chefdk/postinstall +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# WARNING: REQUIRES /bin/sh -# -# Post install configuration for Chef Development Kit -# - -PROGNAME=`basename $0` -INSTALLER_DIR=/opt/chefdk -CONFIG_DIR=/etc/chef -USAGE="usage: $0" - -error_exit() -{ - echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - exit 1 -} - -is_smartos() -{ - uname -v | grep "^joyent" 2>&1 >/dev/null -} - -if is_smartos; then - PREFIX="/opt/local" -else - PREFIX="/usr" -fi - -# We test for the presence of /usr/bin/chef-client to know if this script succeeds, -# so chef-client must appear as the last item here. -binaries="chef chef-solo chef-apply chef-shell knife shef ohai berks chef-zero fauxhai foodcritic kitchen rubocop strain strainer chef-client" - -# rm -f before ln -sf is required for solaris 9 -for binary in $binaries; do - rm -f $PREFIX/bin/$binary -done - -for binary in $binaries; do - ln -sf $INSTALLER_DIR/bin/$binary $PREFIX/bin || error_exit "Cannot link $binary to $PREFIX/bin" -done - -echo "Thank you for installing Chef Development Kit!" - -exit 0 diff --git a/files/chef/mac_dmg/Resources/background.png b/resources/chef/dmg/background.png similarity index 100% rename from files/chef/mac_dmg/Resources/background.png rename to resources/chef/dmg/background.png diff --git a/files/chef/mac_dmg/Resources/icon.png b/resources/chef/dmg/icon.png similarity index 100% rename from files/chef/mac_dmg/Resources/icon.png rename to resources/chef/dmg/icon.png diff --git a/files/chef/windows_msi/Resources/assets/LICENSE.rtf b/resources/chef/msi/assets/LICENSE.rtf similarity index 100% rename from files/chef/windows_msi/Resources/assets/LICENSE.rtf rename to resources/chef/msi/assets/LICENSE.rtf diff --git a/files/chef/windows_msi/Resources/assets/banner_background.bmp b/resources/chef/msi/assets/banner_background.bmp similarity index 100% rename from files/chef/windows_msi/Resources/assets/banner_background.bmp rename to resources/chef/msi/assets/banner_background.bmp diff --git a/files/chef/windows_msi/Resources/assets/dialog_background.bmp b/resources/chef/msi/assets/dialog_background.bmp similarity index 100% rename from files/chef/windows_msi/Resources/assets/dialog_background.bmp rename to resources/chef/msi/assets/dialog_background.bmp diff --git a/files/chef/windows_msi/Resources/assets/oc.ico b/resources/chef/msi/assets/oc.ico similarity index 100% rename from files/chef/windows_msi/Resources/assets/oc.ico rename to resources/chef/msi/assets/oc.ico diff --git a/files/chef/windows_msi/Resources/assets/oc_16x16.ico b/resources/chef/msi/assets/oc_16x16.ico similarity index 100% rename from files/chef/windows_msi/Resources/assets/oc_16x16.ico rename to resources/chef/msi/assets/oc_16x16.ico diff --git a/files/chef/windows_msi/Resources/assets/oc_32x32.ico b/resources/chef/msi/assets/oc_32x32.ico similarity index 100% rename from files/chef/windows_msi/Resources/assets/oc_32x32.ico rename to resources/chef/msi/assets/oc_32x32.ico diff --git a/files/chef/windows_msi/Resources/localization-en-us.wxl.erb b/resources/chef/msi/localization-en-us.wxl.erb similarity index 81% rename from files/chef/windows_msi/Resources/localization-en-us.wxl.erb rename to resources/chef/msi/localization-en-us.wxl.erb index ee0b5aa82..f0acd63a1 100644 --- a/files/chef/windows_msi/Resources/localization-en-us.wxl.erb +++ b/resources/chef/msi/localization-en-us.wxl.erb @@ -18,8 +18,8 @@ - Chef Client Service - Runs Chef Client on regular, configurable intervals. - Chef Client - Chef Client Service + <%= friendly_name %> Service + Runs <%= friendly_name %> on regular, configurable intervals. + <%= friendly_name %> + <%= friendly_name %> Service diff --git a/resources/chef/msi/parameters.wxi.erb b/resources/chef/msi/parameters.wxi.erb new file mode 100644 index 000000000..febd1738e --- /dev/null +++ b/resources/chef/msi/parameters.wxi.erb @@ -0,0 +1,9 @@ + + + " ?> + " ?> + " ?> +<% parameters.each do |key, value| -%> + ="<%= value %>" ?> +<% end -%> + diff --git a/files/chef/windows_msi/Resources/source.wxs b/resources/chef/msi/source.wxs.erb similarity index 100% rename from files/chef/windows_msi/Resources/source.wxs rename to resources/chef/msi/source.wxs.erb diff --git a/files/chef/mac_pkg/Resources/background.png b/resources/chef/pkg/background.png similarity index 100% rename from files/chef/mac_pkg/Resources/background.png rename to resources/chef/pkg/background.png diff --git a/files/chef/mac_pkg/Resources/license.html.erb b/resources/chef/pkg/license.html.erb similarity index 100% rename from files/chef/mac_pkg/Resources/license.html.erb rename to resources/chef/pkg/license.html.erb diff --git a/resources/chef/pkg/welcome.html.erb b/resources/chef/pkg/welcome.html.erb new file mode 100644 index 000000000..04a02fb22 --- /dev/null +++ b/resources/chef/pkg/welcome.html.erb @@ -0,0 +1,5 @@ + + This installer will help you install <%= friendly_name %> version <%= build_version %>. + + + You will be guided through the steps necessary to install this software. diff --git a/files/chefdk/mac_dmg/Resources/background.png b/resources/chefdk/dmg/background.png similarity index 100% rename from files/chefdk/mac_dmg/Resources/background.png rename to resources/chefdk/dmg/background.png diff --git a/files/chefdk/mac_dmg/Resources/icon.png b/resources/chefdk/dmg/icon.png similarity index 100% rename from files/chefdk/mac_dmg/Resources/icon.png rename to resources/chefdk/dmg/icon.png diff --git a/files/chefdk/windows_msi/Resources/assets/LICENSE.rtf b/resources/chefdk/msi/assets/LICENSE.rtf similarity index 100% rename from files/chefdk/windows_msi/Resources/assets/LICENSE.rtf rename to resources/chefdk/msi/assets/LICENSE.rtf diff --git a/files/chefdk/windows_msi/Resources/assets/banner_background.bmp b/resources/chefdk/msi/assets/banner_background.bmp similarity index 100% rename from files/chefdk/windows_msi/Resources/assets/banner_background.bmp rename to resources/chefdk/msi/assets/banner_background.bmp diff --git a/files/chefdk/windows_msi/Resources/assets/dialog_background.bmp b/resources/chefdk/msi/assets/dialog_background.bmp similarity index 100% rename from files/chefdk/windows_msi/Resources/assets/dialog_background.bmp rename to resources/chefdk/msi/assets/dialog_background.bmp diff --git a/files/chefdk/windows_msi/Resources/assets/oc.ico b/resources/chefdk/msi/assets/oc.ico similarity index 100% rename from files/chefdk/windows_msi/Resources/assets/oc.ico rename to resources/chefdk/msi/assets/oc.ico diff --git a/files/chefdk/windows_msi/Resources/assets/oc_16x16.ico b/resources/chefdk/msi/assets/oc_16x16.ico similarity index 100% rename from files/chefdk/windows_msi/Resources/assets/oc_16x16.ico rename to resources/chefdk/msi/assets/oc_16x16.ico diff --git a/files/chefdk/windows_msi/Resources/assets/oc_32x32.ico b/resources/chefdk/msi/assets/oc_32x32.ico similarity index 100% rename from files/chefdk/windows_msi/Resources/assets/oc_32x32.ico rename to resources/chefdk/msi/assets/oc_32x32.ico diff --git a/files/chefdk/windows_msi/Resources/localization-en-us.wxl.erb b/resources/chefdk/msi/localization-en-us.wxl.erb similarity index 100% rename from files/chefdk/windows_msi/Resources/localization-en-us.wxl.erb rename to resources/chefdk/msi/localization-en-us.wxl.erb diff --git a/resources/chefdk/msi/parameters.wxi.erb b/resources/chefdk/msi/parameters.wxi.erb new file mode 100644 index 000000000..febd1738e --- /dev/null +++ b/resources/chefdk/msi/parameters.wxi.erb @@ -0,0 +1,9 @@ + + + " ?> + " ?> + " ?> +<% parameters.each do |key, value| -%> + ="<%= value %>" ?> +<% end -%> + diff --git a/files/chefdk/windows_msi/Resources/source.wxs b/resources/chefdk/msi/source.wxs.erb similarity index 100% rename from files/chefdk/windows_msi/Resources/source.wxs rename to resources/chefdk/msi/source.wxs.erb diff --git a/files/chefdk/mac_pkg/Resources/background.png b/resources/chefdk/pkg/background.png similarity index 100% rename from files/chefdk/mac_pkg/Resources/background.png rename to resources/chefdk/pkg/background.png diff --git a/files/chefdk/mac_pkg/Resources/license.html.erb b/resources/chefdk/pkg/license.html.erb similarity index 100% rename from files/chefdk/mac_pkg/Resources/license.html.erb rename to resources/chefdk/pkg/license.html.erb diff --git a/resources/chefdk/pkg/welcome.html.erb b/resources/chefdk/pkg/welcome.html.erb new file mode 100644 index 000000000..04a02fb22 --- /dev/null +++ b/resources/chefdk/pkg/welcome.html.erb @@ -0,0 +1,5 @@ + + This installer will help you install <%= friendly_name %> version <%= build_version %>. + + + You will be guided through the steps necessary to install this software. diff --git a/todo.txt b/todo.txt deleted file mode 100644 index 38075a285..000000000 --- a/todo.txt +++ /dev/null @@ -1,24 +0,0 @@ -Operating systems - -* Debian Stable 32 -* Debian Stable 64 -* CentOS 5 32 -* CentOS 5 64 -* CentOS 6 32 -* CentOS 6 64 -* Fedora 16 32 -* Fedora 16 64 -* Ubuntu 10.04 32 -* Ubuntu 10.04 64 -* Ubuntu 11.10 32 -* Ubuntu 11.10 64 -* Ubuntu 12.04 32 -* Ubuntu 12.04 64 -* Solaris 10 Sparc -* Solaris 10 x86 -* Windows -* Mac OS X -* FreeBSD 32 -* FreeBSD 64 -* SLES 32 -* SLES 64