diff options
author | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2016-01-08 13:22:45 -0800 |
---|---|---|
committer | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2016-01-08 13:22:45 -0800 |
commit | 5a0031d962402221b580df270e8802b71d5ea1f0 (patch) | |
tree | c57c56e8115c04e14f40ecad2b83c2d8f0f99fcf /omnibus | |
parent | c9d7e017de225db3e8b8610dc7e2f41242dbe730 (diff) | |
parent | 286c306edfb9c5b90a6c1f382defb9efd1580e96 (diff) | |
download | chef-5a0031d962402221b580df270e8802b71d5ea1f0.tar.gz |
Import all of omnibus-chef under the omnibus directory
Diffstat (limited to 'omnibus')
100 files changed, 6234 insertions, 0 deletions
diff --git a/omnibus/.gitignore b/omnibus/.gitignore new file mode 100644 index 0000000000..b7a3079d95 --- /dev/null +++ b/omnibus/.gitignore @@ -0,0 +1,15 @@ +*.gem +.bundle +vendor/bundle +pkg/* +.vagrant +.kitchen +.kitchen.local.yml +bin/* +files/chef-server-cookbooks/cache/ +files/msi/ChefClient-Config.wxi +cookbooks +vendor/cookbooks +build_timestamp +ldd.out +jenkins/chef-solo diff --git a/omnibus/.kitchen.local.yml.vmware.example b/omnibus/.kitchen.local.yml.vmware.example new file mode 100644 index 0000000000..c165fc4da4 --- /dev/null +++ b/omnibus/.kitchen.local.yml.vmware.example @@ -0,0 +1,6 @@ +driver: + name: vagrant + provider: vmware_fusion + customize: + numvcpus: 2 + memsize: 2048 diff --git a/omnibus/.kitchen.yml b/omnibus/.kitchen.yml new file mode 100644 index 0000000000..6139599685 --- /dev/null +++ b/omnibus/.kitchen.yml @@ -0,0 +1,122 @@ +# +# 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: + cpus: 4 + memory: 4096 + synced_folders: + - ['.', '/home/vagrant/omnibus-chef'] + - ['../omnibus', '/home/vagrant/omnibus'] + - ['../omnibus-software', '/home/vagrant/omnibus-software'] + +provisioner: + name: chef_zero + require_chef_omnibus: true # Always install the latest version of Chef + +platforms: + - name: centos-5.10 + run_list: yum-epel::default + - name: centos-6.5 + run_list: yum-epel::default + - name: centos-7.0 + run_list: yum-epel::default + - name: debian-7.2.0 + run_list: apt::default + - name: debian-7.4 + run_list: apt::default + - name: debian-6.0.8 + run_list: apt::default + - name: freebsd-9.2 + run_list: + - freebsd::portsnap + - freebsd::pkgng + - name: freebsd-10.0 + run_list: freebsd::portsnap + - name: ubuntu-10.04 + run_list: apt::default + - name: ubuntu-12.04 + run_list: apt::default + - name: ubuntu-12.10 + run_list: apt::default + - name: ubuntu-13.04 + run_list: apt::default + - name: ubuntu-13.10 + run_list: apt::default + - name: ubuntu-14.04 + run_list: apt::default + # The following (private) boxes are shared via Atlas and are only + # available to users working for Chef. Sorry, it's about software licensing. + # + # Chef-internal users, you will need to: + # 1. Create an Atlas account: https://atlas.hashicorp.com/ + # 2. Ping the Release Services room with your Atlas account name + # to be added to the relevant team in Atlas, + # 3. Do `vagrant login` with your Atlas creds so that you can download + # the private boxes. + # + # The Mac OS X 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: macosx-10.10 + driver: + box: chef/macosx-10.10 # private + - name: windows-7-professional + driver: + box: chef/windows-7-professional # private + - name: windows-8.1-professional + driver: + box: chef/windows-8.1-professional # private + - name: windows-2008r2-standard + driver: + box: chef/windows-server-2008r2-standard # private + +attribute_defaults: &attribute_defaults + build_user: vagrant + build_user_group: vagrant + build_user_password: vagrant + +suites: + - name: angrychef + attributes: + omnibus: + <<: *attribute_defaults + install_dir: /opt/angrychef + run_list: + - omnibus::default + - name: chef + provisioner: + chef_omnibus_install_options: -P angrychef + chef_omnibus_root: /opt/angrychef + attributes: + omnibus: + <<: *attribute_defaults + install_dir: /opt/chef + run_list: + - omnibus::default + - name: chefdk + attributes: + omnibus: + <<: *attribute_defaults + install_dir: /opt/chefdk + run_list: + - omnibus::default + - name: push-jobs-client + attributes: + omnibus: + <<: *attribute_defaults + install_dir: /opt/push-jobs-client + run_list: + - omnibus::default diff --git a/omnibus/Berksfile b/omnibus/Berksfile new file mode 100644 index 0000000000..acf0fa7389 --- /dev/null +++ b/omnibus/Berksfile @@ -0,0 +1,12 @@ +source 'https://api.berkshelf.com' + +cookbook 'omnibus' + +# Uncomment to use the latest version of the Omnibus cookbook from GitHub +# cookbook 'omnibus', github: 'opscode-cookbooks/omnibus' + +group :integration do + cookbook 'apt', '~> 2.3' + cookbook 'freebsd', '~> 0.1' + cookbook 'yum-epel', '~> 0.3' +end diff --git a/omnibus/Berksfile.lock b/omnibus/Berksfile.lock new file mode 100644 index 0000000000..975ab05c90 --- /dev/null +++ b/omnibus/Berksfile.lock @@ -0,0 +1,30 @@ +DEPENDENCIES + apt (~> 2.3) + freebsd (~> 0.1) + omnibus + yum-epel (~> 0.3) + +GRAPH + 7-zip (1.0.2) + windows (>= 1.2.2) + apt (2.7.0) + build-essential (2.2.3) + chef-sugar (3.1.0) + chef_handler (1.1.9) + freebsd (0.3.0) + homebrew (1.12.0) + build-essential (>= 2.1.2) + omnibus (2.6.7) + 7-zip (~> 1.0) + build-essential (~> 2.0) + chef-sugar (~> 3.0) + homebrew (~> 1.9) + windows (~> 1.30) + wix (~> 1.1) + windows (1.37.0) + chef_handler (>= 0.0.0) + wix (1.1.0) + windows (>= 1.2.2) + yum (3.6.0) + yum-epel (0.6.0) + yum (~> 3.0) diff --git a/omnibus/Gemfile b/omnibus/Gemfile new file mode 100644 index 0000000000..ad415d576a --- /dev/null +++ b/omnibus/Gemfile @@ -0,0 +1,18 @@ +source 'https://rubygems.org' + +gem 'omnibus', github: 'chef/omnibus' +gem 'omnibus-software', github: 'chef/omnibus-software' + +# 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.4.0' + gem 'kitchen-vagrant', '~> 0.19.0' + gem 'winrm-transport', '~> 1.0' +end diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock new file mode 100644 index 0000000000..4b959a6bd8 --- /dev/null +++ b/omnibus/Gemfile.lock @@ -0,0 +1,203 @@ +GIT + remote: git://github.com/chef/omnibus-software.git + revision: 6f395a4eaf9dea8f74d1bbb822829f7380f50672 + specs: + omnibus-software (4.0.0) + +GIT + remote: git://github.com/chef/omnibus.git + revision: b6422a3f9678a6f5cc145c9b0a488409ac0af73c + specs: + omnibus (5.0.0) + aws-sdk (~> 2) + chef-sugar (~> 3.0) + cleanroom (~> 1.0) + mixlib-shellout (~> 2.0) + mixlib-versioning + ohai (~> 8.0) + ruby-progressbar (~> 1.7) + thor (~> 0.18) + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.3.8) + aws-sdk (2.2.9) + aws-sdk-resources (= 2.2.9) + aws-sdk-core (2.2.9) + jmespath (~> 1.0) + aws-sdk-resources (2.2.9) + aws-sdk-core (= 2.2.9) + berkshelf (3.2.4) + 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) + celluloid-io (~> 0.16.1) + cleanroom (~> 1.0) + faraday (~> 0.9.0) + minitar (~> 0.5.4) + octokit (~> 3.0) + retryable (~> 2.0) + ridley (~> 4.0) + solve (~> 1.1) + thor (~> 0.19) + berkshelf-api-client (1.2.1) + 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) + builder (3.2.2) + celluloid (0.16.0) + timers (~> 4.0.0) + celluloid-io (0.16.2) + celluloid (>= 0.16.0) + nio4r (>= 1.1.0) + chef-config (12.6.0) + mixlib-config (~> 2.0) + mixlib-shellout (~> 2.0) + chef-sugar (3.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.1) + multipart-post (>= 1.2, < 3) + ffi (1.9.10) + ffi (1.9.10-x86-mingw32) + ffi-yajl (2.2.3) + libyajl2 (~> 1.2) + gssapi (1.2.0) + ffi (>= 1.0.1) + gyoku (1.3.1) + builder (>= 2.1.2) + hashie (2.1.2) + hitimes (1.2.2) + hitimes (1.2.2-x86-mingw32) + httpclient (2.6.0.1) + ipaddress (0.8.2) + jmespath (1.1.3) + json (1.8.3) + kitchen-vagrant (0.19.0) + test-kitchen (~> 1.4) + libyajl2 (1.2.0) + little-plugger (1.1.3) + logging (1.8.2) + little-plugger (>= 1.1.3) + multi_json (>= 1.8.4) + minitar (0.5.4) + mixlib-authentication (1.3.0) + mixlib-log + mixlib-cli (1.5.0) + mixlib-config (2.2.1) + mixlib-log (1.6.0) + mixlib-shellout (2.2.5) + mixlib-shellout (2.2.5-universal-mingw32) + win32-process (~> 0.8.2) + wmi-lite (~> 1.0) + mixlib-versioning (1.1.0) + multi_json (1.11.2) + 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.2) + nio4r (1.1.1) + nori (2.6.0) + octokit (3.8.0) + sawyer (~> 0.6.0, >= 0.5.3) + ohai (8.8.1) + chef-config (>= 12.5.0.alpha.1, < 13) + ffi (~> 1.9) + ffi-yajl (~> 2.2) + ipaddress + mixlib-cli + mixlib-config (~> 2.0) + mixlib-log + mixlib-shellout (~> 2.0) + rake (~> 10.1) + systemu (~> 2.6.4) + wmi-lite (~> 1.0) + rake (10.4.2) + retryable (2.0.1) + ridley (4.2.0) + addressable + buff-config (~> 1.0) + buff-extensions (~> 1.0) + buff-ignore (~> 1.1) + buff-shell_out (~> 0.1) + celluloid (~> 0.16.0) + celluloid-io (~> 0.16.1) + 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 (~> 2.0) + semverse (~> 1.1) + varia_model (~> 0.4) + ruby-progressbar (1.7.5) + rubyntlm (0.4.0) + rubyzip (1.1.7) + safe_yaml (1.0.4) + sawyer (0.6.0) + 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.5) + test-kitchen (1.4.2) + mixlib-shellout (>= 1.2, < 3.0) + net-scp (~> 1.1) + net-ssh (~> 2.7, < 2.10) + safe_yaml (~> 1.0) + thor (~> 0.18) + thor (0.19.1) + timers (4.0.1) + hitimes + uuidtools (2.1.5) + varia_model (0.4.0) + buff-extensions (~> 1.0) + hashie (>= 2.0.2, < 3.0.0) + win32-process (0.8.3) + ffi (>= 1.0.0) + winrm (1.3.3) + builder (>= 2.1.2) + gssapi (~> 1.2) + gyoku (~> 1.0) + httpclient (~> 2.2, >= 2.2.0.2) + logging (~> 1.6, >= 1.6.1) + nori (~> 2.0) + rubyntlm (~> 0.4.0) + uuidtools (~> 2.1.2) + winrm-transport (1.0.1) + rubyzip (~> 1.1, >= 1.1.7) + winrm (~> 1.3) + wmi-lite (1.0.0) + +PLATFORMS + ruby + x86-mingw32 + +DEPENDENCIES + berkshelf (~> 3.0) + kitchen-vagrant (~> 0.19.0) + omnibus! + omnibus-software! + test-kitchen (~> 1.4.0) + winrm-transport (~> 1.0) + +BUNDLED WITH + 1.11.2 diff --git a/omnibus/LICENSE b/omnibus/LICENSE new file mode 100644 index 0000000000..11069edd79 --- /dev/null +++ b/omnibus/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +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. diff --git a/omnibus/README.md b/omnibus/README.md new file mode 100644 index 0000000000..091d4deebd --- /dev/null +++ b/omnibus/README.md @@ -0,0 +1,145 @@ +Client Tools Omnibus project +============================ +This project creates full-stack platform-specific packages for the following projects: + +* AngryChef +* Chef +* ChefDK +* Push Jobs Client + +Installation +------------ +You must have a sane Ruby 1.9+ environment with Bundler installed. Ensure all +the required gems are installed: + +```shell +$ bundle install --without development +``` + +Usage +----- +### Build + +You create a platform-specific package using the `build project` command: + +```shell +$ bundle exec omnibus build <PROJECT> +``` + +The platform/architecture type of the package created will match the platform +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 + +You can clean up all temporary files generated during the build process with +the `clean` command: + +```shell +$ bundle exec omnibus clean <PROJECT> +``` + +Adding the `--purge` purge option removes __ALL__ files generated during the +build including the project install directory (`/opt/chef`) and +the package cache directory (`/var/cache/omnibus/pkg`): + +```shell +$ bundle exec omnibus clean <PROJECT> --purge +``` + +### Publish + +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 +$ bundle exec omnibus publish path/to/*.deb --backend s3 +``` + +### Help + +Full help for the Omnibus command line interface can be accessed with the +`help` command: + +```shell +$ bundle exec omnibus help +``` + +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 +in the `.kitchen.yml`. You can add/remove additional platforms as needed by +changing the list found in the `.kitchen.yml` `platforms` YAML stanza. + +This build environment is designed to get you up-and-running quickly. However, +there is nothing that restricts you to building on other platforms. Simply use +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. 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 +$ bundle exec kitchen converge <PROJECT>-ubuntu-1204 +``` + +Then login to the instance and build the project as described in the Usage +section: + +```shell +$ bundle exec kitchen login <PROJECT>-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 <PROJECT> -l internal +``` + +You can also login to Windows instances but will have to manually call the +`load-omnibus-toolchain.bat` script which initializes the build environment. +Please note the mounted code directory is also at `C:\home\vagrant\omnibus-chef` +as opposed to `C:\Users\vagrant\omnibus-chef`. + +```shell +$ bundle exec kitchen login <PROJECT>-windows-81-professional +Last login: Sat Sep 13 10:19:04 2014 from 172.16.27.1 +Microsoft Windows [Version 6.3.9600] +(c) 2013 Microsoft Corporation. All rights reserved. + +C:\Users\vagrant>load-omnibus-toolchain.bat + +C:\Users\vagrant>cd C:\home\vagrant\omnibus-chef + +C:\home\vagrant\omnibus-chef>bundle install --without development + +C:\home\vagrant\omnibus-chef>bundle exec omnibus build <PROJECT> -l internal +``` + +For a complete list of all commands and platforms, run `kitchen list` or +`kitchen help`. + +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. +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. +``` diff --git a/omnibus/config/projects/angrychef.rb b/omnibus/config/projects/angrychef.rb new file mode 100644 index 0000000000..c585c73040 --- /dev/null +++ b/omnibus/config/projects/angrychef.rb @@ -0,0 +1,41 @@ +# +# Copyright 2012-2015 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. +# + +# +# This is a clone of the Chef project that we can install on the Chef build and +# test machines. As such this project definition is just a thin wrapper around +# `config/project/chef.rb`. +# +chef_project_contents = IO.read(File.expand_path('../chef.rb', __FILE__)) +self.instance_eval chef_project_contents + +name "angrychef" +friendly_name "Angry Chef Client" + +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 "angrychef" +else + install_dir "#{default_root}/#{name}" +end + +resources_path "#{resources_path}/../chef" + +msi_upgrade_code = "D7FDDC1A-7668-404E-AD2F-61F875632A9C" +project_location_dir = "angrychef" diff --git a/omnibus/config/projects/chef-fips.rb b/omnibus/config/projects/chef-fips.rb new file mode 100644 index 0000000000..32bbbc9c48 --- /dev/null +++ b/omnibus/config/projects/chef-fips.rb @@ -0,0 +1,48 @@ +# +# Copyright 2012-2015 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. +# + +# +# This is the chef client build with FIPS mode enabled. +# It's a stub for now and produces identical results +# +chef_project_contents = IO.read(File.expand_path('../chef.rb', __FILE__)) +self.instance_eval chef_project_contents + +name "chef-fips" +friendly_name "Chef Client with FIPS OpenSSL" + +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-fips" +else + install_dir "#{default_root}/#{name}" +end + +# Global FIPS override flag. +override :fips, enabled: true +override :'ruby-windows', version: "2.0.0-p647" + +override :chef, version: "jdm/1.3-fips" +override :ohai, version: "master" + +msi_upgrade_code = "819F5DB3-B818-4358-BB2B-54B8171D0A26" +project_location_dir = "chef-fips" + +# Use chef's scripts for everything. +resources_path "#{resources_path}/../chef" diff --git a/omnibus/config/projects/chef.rb b/omnibus/config/projects/chef.rb new file mode 100644 index 0000000000..c1d1dd2c40 --- /dev/null +++ b/omnibus/config/projects/chef.rb @@ -0,0 +1,86 @@ +# +# 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" +friendly_name "Chef Client" +maintainer "Chef Software, Inc. <maintainers@chef.io>" +homepage "https://www.chef.io" + +build_iteration 1 +build_version '12.6.0' + +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.10.6" +override :ruby, version: "2.1.6" + +override :'ruby-windows', version: "2.0.0-p645" +# Leave dev-kit pinned to 4.5 because 4.7 is 20MB larger and we don't want +# to unnecessarily make the client any fatter. +if windows_arch_i386? + override :'ruby-windows-devkit', version: "4.5.2-20111229-1559" +end + +###### +# This points to jay's patched version for now to avoid a security +# vulnerability and to allow pry to get installed on windows builds. +# See the software definition for details. +if windows? + override :rubygems, version: "jdm/2.4.8-patched" +else + override :rubygems, version: "2.4.8" +end + +# Chef Release version pinning +override :chef, version: 'master' +override :ohai, version: 'master' + + +dependency "preparation" +dependency "chef" +dependency "shebang-cleanup" +dependency "version-manifest" +dependency "openssl-customization" + +package :rpm do + signing_passphrase ENV['OMNIBUS_RPM_SIGNING_PASSPHRASE'] +end + +proj_to_work_around_cleanroom = self +package :pkg do + identifier "com.getchef.pkg.#{proj_to_work_around_cleanroom.name}" + signing_identity "Developer ID Installer: Chef Software, Inc. (EU3VF8YLX2)" +end +compress :dmg + +msi_upgrade_code = "D607A85C-BDFA-4F08-83ED-2ECB4DCD6BC5" +project_location_dir = name +package :msi do + fast_msi true + upgrade_code msi_upgrade_code + wix_candle_extension 'WixUtilExtension' + signing_identity "F74E1A68005E8A9C465C3D2FF7B41F3988F0EA09", machine_store: true + parameters ChefLogDllPath: windows_safe_path(gem_path("chef-[0-9]*-mingw32/ext/win32-eventlog/chef-log.dll")), + ProjectLocationDir: project_location_dir +end diff --git a/omnibus/config/projects/chefdk.rb b/omnibus/config/projects/chefdk.rb new file mode 100644 index 0000000000..9981773711 --- /dev/null +++ b/omnibus/config/projects/chefdk.rb @@ -0,0 +1,119 @@ +# +# 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. +# 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" +friendly_name "Chef Development Kit" +maintainer "Chef Software, Inc. <maintainers@chef.io>" +homepage "https://www.chef.io" + +build_iteration 1 +build_version '0.10.0' + +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 + +# Uncomment to pin the chef version +override :chef, version: "master" +override :ohai, version: "master" +override :chefdk, version: "master" +override :inspec, version: "master" +override :'kitchen-inspec', version: "v0.10.0" +# We should do a gem release of berkshelf and TK +# before releasing chefdk. +override :berkshelf, version: "master" +override :'test-kitchen', version: "v1.5.0.rc.1" + +override :'knife-windows', version: "v1.1.1" +override :'knife-spork', version: "1.5.0" +override :fauxhai, version: "v3.0.1" +override :chefspec, version: "v4.5.0" + +override :bundler, version: "1.10.6" +override :'chef-vault', version: "v2.6.1" + +# 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.6" +###### +# Ruby 2.1/2.2 has an error on Windows - HTTPS gem downloads aren't working +# https://bugs.ruby-lang.org/issues/11033 +# Going to leave 2.1.5 for now since there is a workaround +override :'ruby-windows', version: "2.1.6" +override :'ruby-windows-devkit', version: "4.7.2-20130224" +###### + +###### +# This points to jay's patched version for now to avoid a security +# vulnerability and to allow pry to get installed on windows builds. +# See the software definition for details. +if windows? + override :rubygems, version: "jdm/2.4.8-patched" +else + override :rubygems, version: "2.4.8" +end + +override :rubocop, version: "v0.35.1" + +override :'kitchen-vagrant', version: "v0.19.0" +override :'winrm-transport', version: "v1.0.3" +override :yajl, version: "1.2.1" +override :zlib, version: "1.2.8" + +# NOTE: the base chef-provisioning gem is a dependency of chef-dk (the app). +# Manage the chef-provisioning version via chef-dk.gemspec. +override :'chef-provisioning-aws', version: "v1.7.0" +override :'chef-provisioning-azure', version: "v0.4.0" +override :'chef-provisioning-fog', version: "v0.15.0" +override :'chef-provisioning-vagrant', version: "v0.10.0" + +dependency "preparation" +dependency "chefdk" +dependency "chef-provisioning-aws" +dependency "chef-provisioning-fog" +dependency "chef-provisioning-vagrant" +dependency "chef-provisioning-azure" +dependency "rubygems-customization" +dependency "shebang-cleanup" +dependency "version-manifest" +dependency "openssl-customization" + +package :rpm do + signing_passphrase ENV['OMNIBUS_RPM_SIGNING_PASSPHRASE'] +end + +package :pkg do + identifier "com.getchef.pkg.chefdk" + signing_identity "Developer ID Installer: Chef Software, Inc. (EU3VF8YLX2)" +end + +package :msi do + fast_msi true + upgrade_code "AB1D6FBD-F9DC-4395-BDAD-26C4541168E7" + signing_identity "F74E1A68005E8A9C465C3D2FF7B41F3988F0EA09", machine_store: true + wix_light_extension "WixUtilExtension" +end + +compress :dmg diff --git a/omnibus/config/projects/push-jobs-client.rb b/omnibus/config/projects/push-jobs-client.rb new file mode 100644 index 0000000000..a6606c14b4 --- /dev/null +++ b/omnibus/config/projects/push-jobs-client.rb @@ -0,0 +1,86 @@ +# +# 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 "push-jobs-client" +friendly_name "Push Jobs Client" +maintainer "Chef Software, Inc. <maintainers@chef.io>" +homepage "https://www.chef.io" + +# Ensure we install over the top of the previous package name +replace "opscode-push-jobs-client" +conflict "opscode-push-jobs-client" + +build_iteration 1 +build_version "2.0.0-alpha.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 :bundler, version: "1.7.12" +# Uncomment to pin the chef version +#override :chef, version: "12.2.1" +override :ruby, version: "2.1.6" +###### +# Ruby 2.1/2.2 has an error on Windows - HTTPS gem downloads aren't working +# https://bugs.ruby-lang.org/issues/11033 +# Going to leave 2.1.5 for now since there is a workaround +override :'ruby-windows', version: "2.1.5" +override :'ruby-windows-devkit', version: "4.7.2-20130224-1151" +#override :'ruby-windows', version: "2.0.0-p451" +###### + +# Short term fix to keep from breaking old client build process +override :libzmq, version: "4.0.5" + +###### +# rubygems 2.4.5 is not working on windows. +# See https://github.com/rubygems/rubygems/issues/1120 +# Once this is fixed, we can bump the version +override :rubygems, version: "2.4.4" +###### + +dependency "preparation" +dependency "opscode-pushy-client" +dependency "version-manifest" + +package :rpm do + signing_passphrase ENV['OMNIBUS_RPM_SIGNING_PASSPHRASE'] +end + +package :pkg do + identifier "com.getchef.pkg.push-jobs-client" + signing_identity "Developer ID Installer: Chef Software, Inc. (EU3VF8YLX2)" +end +compress :dmg + +package :msi do + # Upgrade code for Chef MSI + upgrade_code "D607A85C-BDFA-4F08-83ED-2ECB4DCD6BC5" + signing_identity "F74E1A68005E8A9C465C3D2FF7B41F3988F0EA09", machine_store: true + + 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. + 'PushJobsGemPath' => windows_safe_path(gem_path("opscode-pushy-client-[0-9]*")), + ) +end diff --git a/omnibus/config/software/chef-init.rb b/omnibus/config/software/chef-init.rb new file mode 100644 index 0000000000..a599abe10a --- /dev/null +++ b/omnibus/config/software/chef-init.rb @@ -0,0 +1,38 @@ +# +# 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-init" +default_version "master" + +source git: "https://github.com/opscode/chef-init" + +relative_path "chef-init" + +dependency "bundler" +dependency "chef" +dependency "runit" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + bundle "install", env: env + + gem "build chef-init.gemspec", env: env + gem "install chef-init*.gem" \ + " --no-ri --no-rdoc", env: env + + appbundle 'chef-init' +end diff --git a/omnibus/config/software/chefdk-env-customization.rb b/omnibus/config/software/chefdk-env-customization.rb new file mode 100644 index 0000000000..fe36072574 --- /dev/null +++ b/omnibus/config/software/chefdk-env-customization.rb @@ -0,0 +1,41 @@ +# +# Copyright:: Copyright (c) 2015 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. +# + +# This is a windows only dependency + +name "chefdk-env-customization" + +source path: "#{project.files_path}/#{name}" + +dependency "ruby-windows" + +build do + block "Add chefdk_env_customization file" do + source_customization_file = "#{project_dir}/windows/chefdk_env_customization.rb" + + 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 site_ruby.nil? || site_ruby.empty? + raise "Could not determine embedded Ruby's site directory, aborting!" + end + + FileUtils.cp source_customization_file, site_ruby + end +end diff --git a/omnibus/config/software/chefdk.rb b/omnibus/config/software/chefdk.rb new file mode 100644 index 0000000000..4f4938953a --- /dev/null +++ b/omnibus/config/software/chefdk.rb @@ -0,0 +1,76 @@ +# +# 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 "chefdk" +default_version "master" + +source git: "git://github.com/chef/chef-dk.git" + +relative_path "chef-dk" + +if windows? + dependency "ruby-windows" + dependency "ruby-windows-devkit" +else + dependency "libffi" if debian? + dependency "ruby" +end + +dependency "rubygems" +dependency "bundler" +dependency "appbundler" +dependency "chef" +dependency "berkshelf" +dependency "chef-vault" +dependency "foodcritic" +dependency "ohai" +dependency "inspec" +dependency "rubocop" +dependency "test-kitchen" +dependency "kitchen-inspec" +dependency "kitchen-vagrant" +# This is a TK dependency but isn't declared in that software definition +# because it is an optional dependency but we want to give it to ChefDK users +dependency "winrm-transport" +dependency "openssl-customization" +dependency "knife-windows" +dependency "knife-spork" +dependency "fauxhai" +dependency "chefspec" + +dependency "chefdk-env-customization" if windows? + +build do + 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", + ) + + bundle "install", env: env + gem "build chef-dk.gemspec", env: env + gem "install chef-dk*.gem" \ + " --no-ri --no-rdoc" \ + " --verbose", env: env + + appbundle 'berkshelf' + appbundle 'chefdk' + appbundle 'chef-vault' + appbundle 'foodcritic' + appbundle 'rubocop' + appbundle 'test-kitchen' +end diff --git a/omnibus/config/software/openssl-customization.rb b/omnibus/config/software/openssl-customization.rb new file mode 100644 index 0000000000..8af23e12fd --- /dev/null +++ b/omnibus/config/software/openssl-customization.rb @@ -0,0 +1,95 @@ +# +# 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. +# + +# This software makes sure that SSL_CERT_FILE environment variable is pointed +# to the bundled CA certificates that ship with omnibus. With this, Chef +# tools can be used with https URLs out of the box. +name "openssl-customization" + +source path: "#{project.files_path}/#{name}" + +if windows? + dependency "ruby-windows" +else + dependency "ruby" + dependency "rubygems" +end + +fips_enabled = (project.overrides[:fips] && project.overrides[:fips][:enabled]) || false + +build do + block "Add OpenSSL customization file" do + # gets directories for RbConfig::CONFIG and sanitizes them. + def get_sanitized_rbconfig(config) + ruby = windows_safe_path("#{install_dir}/embedded/bin/ruby") + + config_dir = Bundler.with_clean_env do + command_output = %x|#{ruby} -rrbconfig -e "puts RbConfig::CONFIG['#{config}']"|.strip + windows_safe_path(command_output) + end + + if config_dir.nil? || config_dir.empty? + raise "could not determine embedded ruby's RbConfig::CONFIG['#{config}']" + end + + config_dir + end + + fips_additions = [ + "OpenSSL.fips_mode = true", + "require 'digest'", + "require 'digest/sha1'", + "Digest::SHA1 = OpenSSL::Digest::SHA1", + + "require 'digest/md5'", + "# We're going to use the ruby md5 implementation for now", + "# This will be removed once all our MD5 uses are removed", + "OpenSSL::Digest::MD5 = Digest::MD5", + ].join("\n") + + if windows? + 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") + + 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 + # if it's not already set + source_openssl_rb = File.join(embedded_ruby_lib_dir, "openssl.rb") + File.open(source_openssl_rb, "r+") do |f| + unpatched_openssl_rb = f.read + f.rewind + f.write("\nrequire 'ssl_env_hack'\n") + f.write(unpatched_openssl_rb) + f.write(fips_additions) if fips_enabled + end + else + embedded_ruby_lib_dir = get_sanitized_rbconfig('rubylibdir') + source_openssl_rb = File.join(embedded_ruby_lib_dir, "openssl.rb") + File.open(source_openssl_rb, "r+") do |f| + unpatched_openssl_rb = f.read + f.rewind + f.write(unpatched_openssl_rb) + f.write(fips_additions) if fips_enabled + end + end + end +end diff --git a/omnibus/config/software/opscode-pushy-client.rb b/omnibus/config/software/opscode-pushy-client.rb new file mode 100644 index 0000000000..bb85d0960b --- /dev/null +++ b/omnibus/config/software/opscode-pushy-client.rb @@ -0,0 +1,54 @@ +# +# Copyright:: Copyright (c) 2013 Opscode, 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 "opscode-pushy-client" + +default_version "master" + +source git: "git://github.com/opscode/opscode-pushy-client" + +relative_path "opscode-pushy-client" + +dependency "rubygems" +dependency "bundler" +dependency "appbundler" +dependency "chef" +dependency "openssl-customization" + +if windows? + dependency "libzmq4x-windows" +else + dependency "libzmq" +end + +build do + env = with_standard_compiler_flags(with_embedded_path) + + zmq_lib_dir = if windows? + "#{install_dir}/embedded/bin" + else + "#{install_dir}/embedded/lib" + end + + bundle "install", env: env + gem "build opscode-pushy-client.gemspec", env: env + gem "install opscode-pushy-client*.gem" \ + " --no-ri --no-rdoc" \ + " --verbose", env: env + + appbundle 'opscode-pushy-client' +end diff --git a/omnibus/config/software/rubygems-customization.rb b/omnibus/config/software/rubygems-customization.rb new file mode 100644 index 0000000000..2d65657569 --- /dev/null +++ b/omnibus/config/software/rubygems-customization.rb @@ -0,0 +1,52 @@ +# +# 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 "rubygems-customization" + +source path: "#{project.files_path}/#{name}" + +if windows? + dependency "ruby-windows" +else + dependency "ruby" +end + +dependency "rubygems" + +build do + block "Add Rubygems customization file" do + source_customization_file = if windows? + "#{project_dir}/windows/operating_system.rb" + else + "#{project_dir}/default/operating_system.rb" + end + + 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 site_ruby.nil? || site_ruby.empty? + raise "Could not determine embedded Ruby's site directory, aborting!" + end + + destination = "#{site_ruby}/rubygems/defaults" + + FileUtils.mkdir_p destination + FileUtils.cp source_customization_file, destination + end +end diff --git a/omnibus/config/software/shebang-cleanup.rb b/omnibus/config/software/shebang-cleanup.rb new file mode 100644 index 0000000000..9f10f694e5 --- /dev/null +++ b/omnibus/config/software/shebang-cleanup.rb @@ -0,0 +1,92 @@ +# +# 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. +# + +# +# Use this software definition to fix the shebangs of binaries under embedded/bin +# to point to the embedded ruby. +# + +name "shebang-cleanup" + +default_version "0.0.2" + +build do + if windows? + block "Update batch files to point at embedded ruby" do + load_gemspec = if Gem::VERSION >= '2' + require 'rubygems/package' + Gem::Package.method(:new) + else + require 'rubygems/format' + Gem::Format.method(:from_file_by_path) + end + Dir["#{install_dir.gsub(/\\/, '/')}/embedded/lib/ruby/gems/**/cache/*.gem"].each do |gem_file| + load_gemspec.call(gem_file).spec.executables.each do |bin| + if File.exists?("#{install_dir}/bin/#{bin}") + File.open("#{install_dir}/bin/#{bin}.bat", "w") do |f| + f.puts <<-EOF +@ECHO OFF +"%~dp0\\..\\embedded\\bin\\ruby.exe" "%~dpn0" %* + EOF + end + end + if File.exists?("#{install_dir}/embedded/bin/#{bin}") + File.open("#{install_dir}/embedded/bin/#{bin}.bat", "w") do |f| + f.puts <<-EOF +@ECHO OFF +"%~dp0\\ruby.exe" "%~dpn0" %* + EOF + end + end + end + end + + # Fix gem.bat + File.open("#{install_dir}/embedded/bin/gem.bat", "w") do |f| + f.puts <<-EOF +@ECHO OFF +"%~dp0\\ruby.exe" "%~dpn0" %* + EOF + end + end + else + block "Update shebangs to point to embedded Ruby" do + # Fix the shebang for binaries with shebangs that have: + # #!/usr/bin/env ruby + Dir.glob("#{install_dir}/embedded/bin/*") do |bin_file| + update_shebang = false + rest_of_the_file = "" + + File.open(bin_file) do |f| + shebang = f.readline + if shebang.start_with?("#!") && + shebang.include?("ruby") && + !shebang.include?("#{install_dir}/embedded/bin/ruby") + rest_of_the_file = f.read + update_shebang = true + end + end + + if update_shebang + File.open(bin_file, "w+") do |f| + f.puts("#!#{install_dir}/embedded/bin/ruby") + f.puts(rest_of_the_file) + end + end + end + end + end +end diff --git a/omnibus/files/chefdk-env-customization/windows/chefdk_env_customization.rb b/omnibus/files/chefdk-env-customization/windows/chefdk_env_customization.rb new file mode 100644 index 0000000000..34bbec4349 --- /dev/null +++ b/omnibus/files/chefdk-env-customization/windows/chefdk_env_customization.rb @@ -0,0 +1,54 @@ +## Environment hacks for running Ruby with ChefDK ## +# ENV['HOME'] is not set by default on Windows. We need to set this to +# something sensible since a lot of Ruby code depends on it. It is important +# for this directory to exist and be available, so we are introducing logic +# here to pick a working HOME +# +# You can find this file in the repo at https://github.com/chef/omnibus-chef + +if !ENV['HOME'] || !File.exists?(ENV['HOME']) + old_home = ENV['HOME'] + found = false + alternate_homes = [] + alternate_homes << "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}" if ENV['HOMEDRIVE'] + alternate_homes << "#{ENV['USERPROFILE']}" if ENV['USERPROFILE'] + + alternate_homes.each do |path| + if File.exists?(path) + ENV['HOME'] = path + found = true + break + end + end + + STDERR.puts <<-EOF +The HOME (#{old_home}) environment variable was not set, or was set to +an inaccessible location. Because this can prevent you from running many +of the programs included with ChefDK, we will attempt to find another +suitable location. + + EOF + + if found + STDERR.puts <<-EOF +Falling back to using #{ENV['HOME']} as the home directory. If you would like +to use another directory as HOME, please set the HOME environment variable. + EOF + else + STDERR.puts <<-EOF +Could not find a suitable HOME directory. Tried: +#{alternate_homes.join("\n")} + +Some Ruby binaries may not function correctly. You can set the HOME +environment variable to a directory that exists to try to solve this. + EOF + end + + STDERR.puts <<-EOF + +If you would not like ChefDK to try to fix the HOME environment variable, +check the CHEFDK_ENV_FIX environment variable. Setting this value to 0 +prevent this modification to your HOME environment variable. + + EOF +end diff --git a/omnibus/files/mapfiles/solaris b/omnibus/files/mapfiles/solaris new file mode 100644 index 0000000000..b33e54dcae --- /dev/null +++ b/omnibus/files/mapfiles/solaris @@ -0,0 +1,19 @@ +$mapfile_version 2 +DEPEND_VERSIONS libnsl.so { + ALLOW = SUNW_1.1; + ALLOW = SUNWprivate_1.1; +}; +DEPEND_VERSIONS libsocket.so { + ALLOW = SUNW_1.4; + ALLOW = SUNWprivate_1.1; +}; +DEPEND_VERSIONS libdl.so { + ALLOW = SUNW_1.22.1; + ALLOW = SUNW_1.4; + ALLOW = SUNWprivate_1.1; +}; +DEPEND_VERSIONS libc.so { + ALLOW = SUNW_1.22.1; + ALLOW = SUNW_1.4; + ALLOW = SUNWprivate_1.1; +}; diff --git a/omnibus/files/openssl-customization/windows/ssl_env_hack.rb b/omnibus/files/openssl-customization/windows/ssl_env_hack.rb new file mode 100644 index 0000000000..221854437e --- /dev/null +++ b/omnibus/files/openssl-customization/windows/ssl_env_hack.rb @@ -0,0 +1,34 @@ +# +# 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. +# + +# This script sets the SSL_CERT_FILE environment variable to the CA cert bundle +# that ships with omnibus packages of Chef and Chef DK. If this environment +# variable is already configured, this script is a no-op. +# +# This is required to make Chef tools use https URLs out of the box. + +unless ENV.key?("SSL_CERT_FILE") + base_dirs = File.dirname(__FILE__).split(File::SEPARATOR) + + (base_dirs.length - 1).downto(0) do |i| + candidate_ca_bundle = File.join(base_dirs[0..i] + [ "ssl/certs/cacert.pem" ]) + if File.exist?(candidate_ca_bundle) + ENV["SSL_CERT_FILE"] = candidate_ca_bundle + break + end + end +end diff --git a/omnibus/files/rubygems-customization/default/operating_system.rb b/omnibus/files/rubygems-customization/default/operating_system.rb new file mode 100644 index 0000000000..993e182fe3 --- /dev/null +++ b/omnibus/files/rubygems-customization/default/operating_system.rb @@ -0,0 +1,27 @@ +## Rubygems Customization ## +# Customize rubygems install behavior and locations to keep user gems isolated +# from the stuff we bundle with omnibus and any other ruby installations on the +# system. + +# Always install and update new gems in "user install mode" +Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS["install"] = "--user --no-document" +Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS["update"] = "--user --no-document" + +module Gem + + ## + # Override user_dir to live inside of ~/.chefdk + + class << self + # Remove method before redefining so we avoid a ruby warning + remove_method :user_dir + + def user_dir + parts = [Gem.user_home, '.chefdk', 'gem', ruby_engine] + parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty? + File.join parts + end + end + +end + diff --git a/omnibus/files/rubygems-customization/windows/operating_system.rb b/omnibus/files/rubygems-customization/windows/operating_system.rb new file mode 100644 index 0000000000..301b70c4a6 --- /dev/null +++ b/omnibus/files/rubygems-customization/windows/operating_system.rb @@ -0,0 +1,73 @@ +## Rubygems Customization ## +# Customize rubygems install behavior and locations to keep user gems isolated +# from the stuff we bundle with omnibus and any other ruby installations on the +# system. + +# Always install and update new gems in "user install mode" +Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS["install"] = "--user" +Gem::ConfigFile::OPERATING_SYSTEM_DEFAULTS["update"] = "--user" + +# We will inject our hacks in if the user will allow it. +begin + if (ENV['CHEFDK_ENV_FIX'] || '0').to_i != 0 + require 'chefdk_env_customization' + end +rescue + nil +end + +module Gem + + ## + # Override user_dir to live inside of ~/.chefdk + + def self.user_dir + chefdk_home_set = !([nil, ''].include? ENV['CHEFDK_HOME']) + # We call expand_path here because it converts \ -> / + # Rubygems seems to require that we not use \ + default_home = File.join(File.expand_path(ENV['LOCALAPPDATA']), 'chefdk') + + chefdk_home = if chefdk_home_set + ENV['CHEFDK_HOME'] + else + old_home = File.join(Gem.user_home, '.chefdk') + if File.exists?(old_home) + Gem.ui.alert_warning <<-EOF + + ChefDK now defaults to using #{default_home} instead of #{old_home}. + Since #{old_home} exists on your machine, ChefDK will continue + to make use of it. Please set the environment variable CHEFDK_HOME + to #{old_home} to remove this warning. This warning will be removed + in the next major version bump of ChefDK. + EOF + old_home + else + default_home + end + end + + # Prevents multiple warnings + ENV['CHEFDK_HOME'] = chefdk_home + + parts = [chefdk_home, 'gem', ruby_engine] + parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty? + File.join parts + end + +end + +# :DK-BEG: override 'gem install' to enable RubyInstaller DevKit usage +Gem.pre_install do |gem_installer| + unless gem_installer.spec.extensions.empty? + unless ENV['PATH'].include?('C:\\opscode\\chefdk\\embedded\\mingw\\bin') then + Gem.ui.say 'Temporarily enhancing PATH to include DevKit...' if Gem.configuration.verbose + ENV['PATH'] = 'C:\\opscode\\chefdk\\embedded\\bin;C:\\opscode\\chefdk\\embedded\\mingw\\bin;' + ENV['PATH'] + end + ENV['RI_DEVKIT'] = 'C:\\opscode\\chefdk\\embedded' + ENV['CC'] = 'gcc' + ENV['CXX'] = 'g++' + ENV['CPP'] = 'cpp' + end +end +# :DK-END: + diff --git a/omnibus/jenkins/Gemfile b/omnibus/jenkins/Gemfile new file mode 100644 index 0000000000..24984dcda8 --- /dev/null +++ b/omnibus/jenkins/Gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gem 'mixlib-shellout', '~> 1.4' +gem 'artifactory', '~> 2.1' +gem 'omnibus', '~> 3.0' diff --git a/omnibus/jenkins/Gemfile.lock b/omnibus/jenkins/Gemfile.lock new file mode 100644 index 0000000000..394fd0f4db --- /dev/null +++ b/omnibus/jenkins/Gemfile.lock @@ -0,0 +1,70 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.3.6) + arr-pm (0.0.9) + cabin (> 0) + artifactory (2.1.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) + ffi (1.9.3) + ffi-yajl (1.0.2) + 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) + ipaddress (0.8.0) + json (1.8.1) + libyajl2 (1.0.1) + mime-types (1.25.1) + mixlib-cli (1.5.0) + mixlib-config (2.1.0) + mixlib-log (1.6.0) + mixlib-shellout (1.4.0) + ohai (7.2.4) + ffi (~> 1.9) + ffi-yajl (~> 1.0) + ipaddress + mime-types (~> 1.16) + mixlib-cli + mixlib-config (~> 2.0) + mixlib-log + mixlib-shellout (~> 1.2) + systemu (~> 2.6.4) + wmi-lite (~> 1.0) + omnibus (3.2.1) + chef-sugar (~> 1.2) + fpm (~> 0.4) + mixlib-shellout (~> 1.4) + ohai (~> 7.2) + thor (~> 0.18) + uber-s3 + systemu (2.6.4) + thor (0.19.1) + uber-s3 (0.2.4) + mime-types (~> 1.17) + wmi-lite (1.0.0) + +PLATFORMS + ruby + +DEPENDENCIES + artifactory (~> 2.1) + mixlib-shellout (~> 1.4) + omnibus (~> 3.0) diff --git a/omnibus/jenkins/build b/omnibus/jenkins/build new file mode 100755 index 0000000000..4df8bbe657 --- /dev/null +++ b/omnibus/jenkins/build @@ -0,0 +1,122 @@ +#!/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. +# +# Build you some jenkins +# + +set -e +set -x + +os=`uname -s` + +# Return truthy (which is zero) if a command does not exist +# (this is deliberately inverted because /bin/sh on Solaris does not support "if ! exists" syntax) +not_exists() { + if command -v $1 >/dev/null 2>&1; then + return 1 + else + return 0 + fi +} + +exists() { + if command -v $1 >/dev/null 2>&1; then + return 0 + else + return 1 + fi +} + +# The key used to sign RPM packages is passphrase-less +OMNIBUS_RPM_SIGNING_PASSPHRASE=notset +export OMNIBUS_RPM_SIGNING_PASSPHRASE + +if [ "x$os" = "xAIX" ]; then + # need to unset LIBPATH on AIX (like LD_LIBRARY_PATH on Solaris, Jenkins sets this (wrongly) on AIX) + unset LIBPATH +fi + +if [ -z $OMNIBUS_PROJECT_NAME ]; then + echo "OMNIBUS_PROJECT_NAME environment variable is not set!" + exit 1 +fi + +# create the build timestamp file for fingerprinting if it doesn't exist (manual build execution) +if [ ! -f build_timestamp ]; then + date > build_timestamp + echo "$BUILD_TAG / $BUILD_ID" > build_timestamp +fi + +PATH=/opt/ruby-2.1.2/bin:/opt/ruby1.9/bin:/usr/local/bin:$PATH +export PATH + +if [ "x$os" = "xAIX" ]; then + # AIX is hateful and requires a bunch of root stuff to build BFF packages + sudo rm -rf /.info || true + sudo mkdir /.info || true + sudo chown root /.info || true + sudo rm -rf /tmp/bff || true + # deinstall the bff if it got installed, can't build if it is installed + sudo installp -u $OMNIBUS_PROJECT_NAME || true + # AIX needs /opt/freeware/bin and /usr/sbin + if [ -d "/opt/freeware/bin" ]; then + PATH=/opt/freeware/bin:$PATH:/usr/sbin + export PATH + fi +fi + +# clean up our target directory +sudo rm -rf "/opt/${OMNIBUS_PROJECT_NAME}" || true +sudo mkdir -p "/opt/${OMNIBUS_PROJECT_NAME}" +# and any old package cruft from prior builds +sudo rm -f pkg/* || true + +if [ "$CLEAN" = "true" ]; then + # nuke everything, including the git cache + sudo rm -rf /var/cache/omnibus/* || true +else + # we need to nuke these from old builds in order to reliably use + # the git caching + sudo rm -rf /var/cache/omnibus/pkg/* || true + sudo rm -rf /var/cache/omnibus/src/* || true + sudo rm -f /var/cache/omnibus/build/*/*.manifest || true +fi + +# always fix up permissions +if [ "x$os" = "xAIX" ]; then + sudo chown -R root "/opt/${OMNIBUS_PROJECT_NAME}" + sudo chown -R root "/var/cache/omnibus" +else + sudo chown -R jenkins-node "/opt/${OMNIBUS_PROJECT_NAME}" || sudo chown -R jenkins "/opt/${OMNIBUS_PROJECT_NAME}" + sudo chown -R jenkins-node "/var/cache/omnibus" || sudo chown -R jenkins "/var/cache/omnibus" +fi + +# 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 + release=`cat /etc/release | grep 'Solaris 9' || true` + if [ "x$release" != "x" ]; then + # magic CONFIGURE_ARGS to get CFLAGS through bundle/gem install + CONFIGURE_ARGS="--with-cflags='-U__STRICT_ANSI__'" + export CONFIGURE_ARGS + fi +fi + +# docs do not install on solaris 9 +bundle install --without development + +if [ "$RELEASE_BUILD" = "true" ]; then + bundle exec omnibus build $OMNIBUS_PROJECT_NAME -l internal --override append_timestamp:false +else + bundle exec omnibus build $OMNIBUS_PROJECT_NAME -l internal +fi + +# Dump the build-generated version so the Omnitruck release script uses the +# correct version string format. +echo "`awk -v p=$OMNIBUS_PROJECT_NAME '$1 == p {print $2}' /opt/${OMNIBUS_PROJECT_NAME}/version-manifest.txt`" > pkg/BUILD_VERSION diff --git a/omnibus/jenkins/build.bat b/omnibus/jenkins/build.bat new file mode 100644 index 0000000000..bbcda327b7 --- /dev/null +++ b/omnibus/jenkins/build.bat @@ -0,0 +1,36 @@ +SETLOCAL + +ECHO %OMNIBUS_PROJECT_NAME% + +if "%OMNIBUS_PROJECT_NAME%"=="" ( + ECHO "OMNIBUS_PROJECT_NAME environment variable is not set!" + EXIT /B 1 +) + +IF "%CLEAN%"=="true" ( + rmdir /Q /S c:\opscode + rmdir /Q /S c:\omnibus-ruby + rmdir /Q /S .\pkg +) + +set PATH=C:\Ruby193\bin;%PATH% +set SSL_CERT_FILE=C:\Ruby193\ssl\certs\cacert.pem + +call bundle install --without development || GOTO :error + +IF "%RELEASE_BUILD%"=="true" ( + + call bundle exec omnibus build %OMNIBUS_PROJECT_NAME% -l internal --override append_timestamp:false || GOTO :error + +) ELSE ( + + call bundle exec omnibus build %OMNIBUS_PROJECT_NAME% -l internal || GOTO :error + +) + +GOTO :EOF + +:error +ECHO Failed with error level %errorlevel% + +ENDLOCAL diff --git a/omnibus/jenkins/chef-platform-names.json b/omnibus/jenkins/chef-platform-names.json new file mode 100644 index 0000000000..e63e5f0a0e --- /dev/null +++ b/omnibus/jenkins/chef-platform-names.json @@ -0,0 +1,12 @@ +{ + "aix" : "AIX", + "el" : "Enterprise Linux", + "debian" : "Debian", + "freebsd" : "FreeBSD", + "mac_os_x" : "OS X", + "ubuntu" : "Ubuntu", + "solaris2" : "Solaris", + "sles" : "SUSE Enterprise", + "suse" : "openSUSE", + "windows" : "Windows" +} diff --git a/omnibus/jenkins/chef.json b/omnibus/jenkins/chef.json new file mode 100644 index 0000000000..ed7b81862c --- /dev/null +++ b/omnibus/jenkins/chef.json @@ -0,0 +1,260 @@ +{ + "build_os=centos-5,machine_architecture=x64,role=oss-builder": [ + [ + "el", + "5", + "x86_64" + ] + ], + "build_os=centos-5,machine_architecture=x86,role=oss-builder": [ + [ + "el", + "5", + "i686" + ] + ], + "build_os=centos-6,machine_architecture=x64,role=oss-builder": [ + [ + "el", + "6", + "x86_64" + ], + [ + "el", + "7", + "x86_64" + ] + ], + "build_os=centos-6,machine_architecture=x86,role=oss-builder": [ + [ + "el", + "6", + "i686" + ] + ], + "build_os=debian-6,machine_architecture=x64,role=oss-builder": [ + [ + "debian", + "6", + "x86_64" + ], + [ + "debian", + "7", + "x86_64" + ] + ], + "build_os=debian-6,machine_architecture=x86,role=oss-builder": [ + [ + "debian", + "6", + "i686" + ], + [ + "debian", + "7", + "i686" + ] + ], + "build_os=mac_os_x_10_6,machine_architecture=x64,role=oss-builder": [ + [ + "mac_os_x", + "10.6", + "x86_64" + ] + ], + "build_os=mac_os_x_10_7,machine_architecture=x64,role=oss-builder": [ + [ + "mac_os_x", + "10.7", + "x86_64" + ], + [ + "mac_os_x", + "10.8", + "x86_64" + ], + [ + "mac_os_x", + "10.9", + "x86_64" + ], + [ + "mac_os_x", + "10.10", + "x86_64" + ] + ], + "build_os=solaris-10,machine_architecture=intel,role=oss-builder": [ + [ + "solaris2", + "5.10", + "i386" + ], + [ + "solaris2", + "5.11", + "i386" + ] + ], + "build_os=solaris-9,machine_architecture=sparc,role=oss-builder": [ + [ + "solaris2", + "5.9", + "sparc" + ], + [ + "solaris2", + "5.10", + "sparc" + ], + [ + "solaris2", + "5.11", + "sparc" + ] + ], + "build_os=ubuntu-10-04,machine_architecture=x64,role=oss-builder": [ + [ + "ubuntu", + "10.04", + "x86_64" + ], + [ + "ubuntu", + "10.10", + "x86_64" + ] + ], + "build_os=ubuntu-10-04,machine_architecture=x86,role=oss-builder": [ + [ + "ubuntu", + "10.04", + "i686" + ], + [ + "ubuntu", + "10.10", + "i686" + ] + ], + "build_os=ubuntu-12-04,machine_architecture=x64,role=oss-builder": [ + [ + "ubuntu", + "12.04", + "x86_64" + ], + [ + "ubuntu", + "12.10", + "x86_64" + ] + ], + "build_os=ubuntu-13-04,machine_architecture=x64,role=oss-builder": [ + [ + "ubuntu", + "13.04", + "x86_64" + ], + [ + "ubuntu", + "13.10", + "x86_64" + ], + [ + "ubuntu", + "14.04", + "x86_64" + ] + ], + "build_os=ubuntu-12-04,machine_architecture=x86,role=oss-builder": [ + [ + "ubuntu", + "12.04", + "i686" + ], + [ + "ubuntu", + "12.10", + "i686" + ] + ], + "build_os=ubuntu-13-04,machine_architecture=x86,role=oss-builder": [ + [ + "ubuntu", + "13.04", + "i686" + ], + [ + "ubuntu", + "13.10", + "i686" + ], + [ + "ubuntu", + "14.04", + "i686" + ] + ], + "build_os=freebsd-9-1,machine_architecture=x64,role=oss-builder": [ + [ + "freebsd", + "9", + "amd64" + ] + ], + "build_os=freebsd-9-1,machine_architecture=x86,role=oss-builder": [ + [ + "freebsd", + "9", + "i386" + ] + ], + "build_os=windows-2008r2,machine_architecture=x64,role=oss-builder": [ + [ + "windows", + "2008r2", + "x86_64" + ], + [ + "windows", + "2003r2", + "i686" + ], + [ + "windows", + "2003r2", + "x86_64" + ], + [ + "windows", + "2008", + "x86_64" + ], + [ + "windows", + "2008", + "i686" + ], + [ + "windows", + "2012", + "x86_64" + ], + [ + "windows", + "2012r2", + "x86_64" + ], + [ + "windows", + "7", + "x86_64" + ], + [ + "windows", + "8", + "x86_64" + ] + ] +} diff --git a/omnibus/jenkins/client-test b/omnibus/jenkins/client-test new file mode 100755 index 0000000000..b06485c06e --- /dev/null +++ b/omnibus/jenkins/client-test @@ -0,0 +1,183 @@ +#!/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. +# +# Test you some omnibus client +# +set -e +set -x + +# SmartOS builds in /opt/local instead +is_smartos() { + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +else + PREFIX="/usr" +fi + +# copy off the timestamp for fingerprinting before we blow it away later +mv $BUILD_NUMBER/build_timestamp $WORKSPACE/ +cd $BUILD_NUMBER + +# determine install method via the package suffix +if test -n "`ls pkg/chef*.deb 2>/dev/null || true`"; then + package_file=`ls pkg/chef*.deb` + filetype="deb" +elif test -n "`ls pkg/chef*.rpm 2>/dev/null || true`"; then + package_file=`ls pkg/chef*.rpm` + filetype="rpm" +elif test -n "`ls pkg/chef*.solaris 2>/dev/null || true`"; then + package_file=`ls pkg/chef*.solaris` + filetype="solaris" +elif test -n "`ls pkg/chef*.bff 2>/dev/null || true`"; then + package_file=`ls pkg/chef*.bff` + filetype="bff" +elif test -n "`ls pkg/chef*.sh 2>/dev/null || true`"; then + package_file=`ls pkg/chef*.sh` + filetype="sh" +elif test -n "`ls pkg/chef*.pkg 2>/dev/null || true`"; then + package_file=`ls pkg/chef*.pkg` + filetype="pkg" +fi + +# remove the chef package / clobber the files +case "$filetype" in + "deb") + sudo dpkg -P chef || true + ;; + "rpm") + sudo rpm -ev chef || true + ;; + "solaris") + if sudo pkgrm -a /tmp/nocheck -n chef; then + : + else + echo "WARNING: CLEANING UP BROKEN POSTRM FROM PRIOR INSTALLATION!!!!!!!!!!!!!!!!!!!!!!" + sudo rm -f /var/sadm/pkg/chef/install/postremove || true + sudo pkgrm -a /tmp/nocheck -n chef || true + fi + ;; + "bff") + sudo installp -u chef || true + ;; + "pkg") + sudo rm -rf /opt/chef + sudo pkgutil --forget com.getchef.pkg.chef || true + ;; + "sh") + # intentionally left blank + ;; +esac + +sudo rm -rf /opt/chef/* + +# ensure symlinks are gone, so that failures to recreate them get caught +sudo rm -f $PREFIX/bin/chef-client || true +sudo rm -f $PREFIX/bin/chef-solo || true +sudo rm -f $PREFIX/bin/chef-apply || true +sudo rm -f $PREFIX/bin/chef-shell || true +sudo rm -f $PREFIX/bin/knife || true +sudo rm -f $PREFIX/bin/shef || true +sudo rm -f $PREFIX/bin/ohai || true + + +# install the new package +case "$filetype" in + "deb") sudo dpkg -i pkg/chef*.deb ;; + "rpm") sudo rpm -Uvh pkg/chef*.rpm ;; + "solaris") sudo pkgadd -n -d pkg/chef*.solaris -a /tmp/nocheck chef ;; + "bff") sudo installp -a -d pkg/chef*.bff chef;; + "sh") sudo ./pkg/chef*.sh ;; + "pkg") sudo /usr/sbin/installer -pkg pkg/chef*.pkg -target /;; +esac + +# sanity check that we're getting symlinks from the pre-install script +if [ ! -L "/usr/bin/chef-client" ]; then + echo "/usr/bin/chef-client symlink was not installed by pre-install script!" + exit 1 +fi + +if [ ! -L "/usr/bin/knife" ]; then + echo "/usr/bin/knife symlink was not installed by pre-install script!" + exit 1 +fi + +if [ ! -L "/usr/bin/chef-solo" ]; then + echo "/usr/bin/chef-solo symlink was not installed by pre-install script!" + exit 1 +fi + +if [ ! -L "/usr/bin/ohai" ]; then + echo "/usr/bin/ohai symlink was not installed by pre-install script!" + exit 1 +fi + +if [ ! -f "/opt/chef/bin/chef-client" ]; then + echo "/opt/chef/bin/chef-client binary was not installed correctly!" + exit 1 +fi + +if [ ! -f "/opt/chef/bin/knife" ]; then + echo "/opt/chef/bin/knife binary was not installed correctly!" + exit 1 +fi + +if [ ! -f "/opt/chef/bin/chef-solo" ]; then + echo "/opt/chef/bin/chef-solo binary was not installed correctly!" + exit 1 +fi + +if [ ! -f "/opt/chef/bin/ohai" ]; then + echo "/opt/chef/bin/ohai binary was not installed correctly!" + exit 1 +fi + +# test against the appbundle'd chef bundle +cd /opt/chef/embedded/apps/chef + +# test against the rspec and gems in the omnibus build +PATH=/opt/chef/bin:/opt/chef/embedded/bin:$PATH +export PATH + +# ffi-yajl must run in c-extension mode or we take perf hits, so we force it +# before running rspec so that we don't wind up testing the ffi mode +FORCE_FFI_YAJL=ext +export FORCE_FFI_YAJL + +# run against the Gemfile.lock in the appbundle'd directory +sudo env PATH=$PATH TERM=xterm bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o $WORKSPACE/test.xml -f documentation spec + +# clean up the workspace to save disk space +cd $WORKSPACE +rm -rf $BUILD_NUMBER + +# remove the package, break the build if the postrm fails +case "$filetype" in + "deb") + sudo dpkg -P chef + ;; + "rpm") + sudo rpm -ev chef + ;; + "solaris") + sudo pkgrm -a /tmp/nocheck -n chef + ;; + "bff") + sudo installp -u chef + ;; + "pkg") + sudo rm -rf /opt/chef + sudo pkgutil --forget com.getchef.pkg.chef || true + ;; + "sh") + # intentionally left blank + ;; +esac diff --git a/omnibus/jenkins/client-test.bat b/omnibus/jenkins/client-test.bat new file mode 100644 index 0000000000..31275b45d1 --- /dev/null +++ b/omnibus/jenkins/client-test.bat @@ -0,0 +1,62 @@ +SETLOCAL + +rem # copy off the timestamp for fingerprinting before we blow it away later +move %BUILD_NUMBER%\build_timestamp %WORKSPACE%\ + +rem # run the tests +cd %BUILD_NUMBER% + +rem # remove the chef package / clobber the files +rem # then install the new package +rmdir /S /Q C:\opscode +FOR %%i IN (pkg\chef*.msi) DO SET omnibus_package=%%i +SET omnibus_package=%WORKSPACE%\%BUILD_NUMBER%\%omnibus_package% + +call copy /Y "%omnibus_package%" %TMP%\install.msi || GOTO :error + +call msiexec INSTALLLOCATION=C:\opscode /qb /i %TMP%\install.msi || GOTO :error + +rem # use rspec and gems from omnibus +set PATH=C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;%PATH% + +rem # test against the appbundle'd chef bundle +cd c:\opscode\chef\embedded\apps\chef + +rem # ffi-yajl must run in c-extension mode or we take perf hits, so we force it +rem # before running rspec so that we don't wind up testing the ffi mode +set FORCE_FFI_YAJL=ext + +rem # run the tests -- exclude spec/stress on windows +rem # we do not bundle exec here in order to test against the gems in the omnibus package +call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/functional spec/unit || GOTO :error + +rem # check presence of essential binaries in correct places + +cd c:\opscode\chef\bin + +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 + +rem # uninstall chef +call msiexec /qb /x %TMP%\install.msi || GOTO :error + +rem # clean up the workspace to save disk space +cd %WORKSPACE% +rmdir /S /Q %BUILD_NUMBER% + +GOTO :EOF + +:error + +SET ERR_LEV=%errorlevel% + +ECHO Failed with error level %ERR_LEV% + +rem # uninstall chef +call msiexec /qb /x %TMP%\install.msi + +EXIT /B %ERR_LEV% + +ENDLOCAL diff --git a/omnibus/jenkins/dna-solaris2.json b/omnibus/jenkins/dna-solaris2.json new file mode 100644 index 0000000000..0603540139 --- /dev/null +++ b/omnibus/jenkins/dna-solaris2.json @@ -0,0 +1,10 @@ +{ + "omnibus": { + "build_user": "jenkins", + "install_dir": "/opt/chef", + "cache_dir": "/var/cache/omnibus" + }, + "run_list": [ + "recipe[omnibus]" + ] +} diff --git a/omnibus/jenkins/dna-windows.json b/omnibus/jenkins/dna-windows.json new file mode 100644 index 0000000000..448a798a77 --- /dev/null +++ b/omnibus/jenkins/dna-windows.json @@ -0,0 +1,10 @@ +{ + "omnibus": { + "build_user": "Administrator", + "install_dir": "c:\\opscode\\chef", + "cache_dir": "c:\\omnibus-cache" + }, + "run_list": [ + "recipe[omnibus]" + ] +} diff --git a/omnibus/jenkins/dna.json b/omnibus/jenkins/dna.json new file mode 100644 index 0000000000..dd2ed456d1 --- /dev/null +++ b/omnibus/jenkins/dna.json @@ -0,0 +1,10 @@ +{ + "omnibus": { + "build_user": "jenkins-node", + "install_dir": "/opt/chef", + "cache_dir": "/var/cache/omnibus" + }, + "run_list": [ + "recipe[omnibus]" + ] +} diff --git a/omnibus/jenkins/install-test b/omnibus/jenkins/install-test new file mode 100755 index 0000000000..6b963ee915 --- /dev/null +++ b/omnibus/jenkins/install-test @@ -0,0 +1,105 @@ +#!/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. + +set -e +set -x + +env + +# sleep unti omnitruck has updated itself +sleep $SLEEP_TIME + +# Check whether a command exists - returns 0 if it does, 1 if it does not +exists() { + if command -v $1 >/dev/null 2>&1; then + return 0 + else + return 1 + fi +} + +# SmartOS builds in /opt/local instead +is_smartos() { + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +else + PREFIX="/usr" +fi + +# remove the chef package / clobber the files +if exists dpkg; then + sudo dpkg -P chef || true +elif exists rpm; then + sudo rpm -ev chef || true +elif exists pkgadd; then + cat <<EOF > /tmp/nocheck +conflict=nocheck +action=nocheck +EOF + if sudo pkgrm -a /tmp/nocheck -n chef; then + : + else + echo "WARNING: a 'no package to deinstall' error is normal here" + echo "WARNING: attempting to fix busted postremove anyway because I'm dumb..." + echo "WARNING: if this is really a busted postremove you should fix that..." + echo "WARNING: (but that should have been caught in the client-test script)" + sudo rm -f /var/sadm/pkg/chef/install/postremove || true + sudo pkgrm -a /tmp/nocheck -n chef || true + echo "WARNING: a 'no package to deinstall error' is normal here" + fi +else # makeself installer + : +fi + +sudo rm -rf /opt/chef/* + +# ensure symlinks are gone, so that failures to recreate them get caught +sudo rm -f $PREFIX/bin/chef-client || true +sudo rm -f $PREFIX/bin/chef-solo || true +sudo rm -f $PREFIX/bin/chef-apply || true +sudo rm -f $PREFIX/bin/chef-shell || true +sudo rm -f $PREFIX/bin/knife || true +sudo rm -f $PREFIX/bin/shef || true +sudo rm -f $PREFIX/bin/ohai || true + +if exists curl; then + curl -L "${OMNITRUCK_BASE_URL}/chef/install.sh" | sudo bash -s -- -v $INSTALL_CHEF_VERSION +else + wget -qO- "${OMNITRUCK_BASE_URL}/chef/install.sh" | sudo bash -s -- -v $INSTALL_CHEF_VERSION +fi + +# sanity check that we're getting symlinks from the pre-install script +if [ ! -L "/usr/bin/chef-client" ]; then + echo "/usr/bin/chef-client symlink was not installed by pre-install script!" + exit 1 +fi + +if [ ! -L "/usr/bin/knife" ]; then + echo "/usr/bin/knife symlink was not installed by pre-install script!" + exit 1 +fi + +if [ ! -L "/usr/bin/chef-solo" ]; then + echo "/usr/bin/chef-solo symlink was not installed by pre-install script!" + exit 1 +fi + +if [ ! -L "/usr/bin/ohai" ]; then + echo "/usr/bin/ohai symlink was not installed by pre-install script!" + exit 1 +fi + +# bundle bust and make sure we invoke chef-client from the installed artifact +unset GEM_HOME +unset GEM_PATH +/opt/chef/bin/chef-client --version + diff --git a/omnibus/jenkins/install-test.bat b/omnibus/jenkins/install-test.bat new file mode 100644 index 0000000000..70599c26cd --- /dev/null +++ b/omnibus/jenkins/install-test.bat @@ -0,0 +1,84 @@ +SETLOCAL + +> wget.vbs ( +echo.url = WScript.Arguments.Named^("url"^) +echo.path = WScript.Arguments.Named^("path"^) +echo.proxy = null +echo.Set objXMLHTTP = CreateObject^("MSXML2.ServerXMLHTTP"^) +echo.Set wshShell = CreateObject^( "WScript.Shell" ^) +echo.Set objUserVariables = wshShell.Environment^("USER"^) +echo. +echo.'http proxy is optional +echo.'attempt to read from HTTP_PROXY env var first +echo.On Error Resume Next +echo. +echo.If NOT ^(objUserVariables^("HTTP_PROXY"^) = ""^) Then +echo.proxy = objUserVariables^("HTTP_PROXY"^) +echo. +echo.'fall back to named arg +echo.ElseIf NOT ^(WScript.Arguments.Named^("proxy"^) = ""^) Then +echo.proxy = WScript.Arguments.Named^("proxy"^) +echo.End If +echo. +echo.If NOT isNull^(proxy^) Then +echo.'setProxy method is only available on ServerXMLHTTP 6.0+ +echo.Set objXMLHTTP = CreateObject^("MSXML2.ServerXMLHTTP.6.0"^) +echo.objXMLHTTP.setProxy 2, proxy +echo.End If +echo. +echo.On Error Goto 0 +echo. +echo.objXMLHTTP.open "GET", url, false +echo.objXMLHTTP.send^(^) +echo.If objXMLHTTP.Status = 200 Then +echo.Set objADOStream = CreateObject^("ADODB.Stream"^) +echo.objADOStream.Open +echo.objADOStream.Type = 1 +echo.objADOStream.Write objXMLHTTP.ResponseBody +echo.objADOStream.Position = 0 +echo.Set objFSO = Createobject^("Scripting.FileSystemObject"^) +echo.If objFSO.Fileexists^(path^) Then objFSO.DeleteFile path +echo.Set objFSO = Nothing +echo.objADOStream.SaveToFile path +echo.objADOStream.Close +echo.Set objADOStream = Nothing +echo.End if +echo.Set objXMLHTTP = Nothing +) + +rem # XXX: uninstall any left over version, ignore errors +call msiexec /qb /x %TMP%\install.msi + +rem # remove the chef package / clobber the files +rmdir /S /Q C:\opscode + +rem # remove the old installer, if it exists, ignore errors +del /F /Q %TMP%\install.msi + +rem # sleep until omnitruck has updated itself +powershell -command "start-sleep %SLEEP_TIME%" + +rem # download the new chef installer +rem # right now we have one build, fake the platform resulution crap +cscript /nologo wget.vbs /url:"http://%OMNITRUCK_BASE_URL%/chef/download?p=windows&pv=2008r2&m=x86_64&v=%INSTALL_CHEF_VERSION%" /path:%TMP%\install.msi + + +call msiexec INSTALLLOCATION=C:\opscode /qb /i %TMP%\install.msi || GOTO :error + +call C:\opscode\chef\bin\chef-client --version || GOTO :error + +call msiexec /qb /x %TMP%\install.msi || GOTO :error + +GOTO :EOF + +:error + +SET ERR_LEV=%errorlevel% + +ECHO Failed with error level %ERR_LEV% + +call msiexec /qb /x %TMP%\install.msi + +EXIT /B %ERR_LEV% + +ENDLOCAL diff --git a/omnibus/jenkins/release.rb b/omnibus/jenkins/release.rb new file mode 100755 index 0000000000..7459bc99bd --- /dev/null +++ b/omnibus/jenkins/release.rb @@ -0,0 +1,728 @@ +#!/usr/bin/env ruby + +## release.rb ################################################################# +#------------------------------------------------------------------------------ +# This script runs from the root of a jenkins workspace where artifacts from +# the omnibus build matrix are collected. +# +# # Primary command line options: +# * `--project PROJECT`: Project to be released. This also controls where the +# script looks for config JSON. +# * `--bucket S3_BUCKET`: Name of the S3 bucket where artifacts are released +# to. +# +# Other options are available, run `release.rb --help`. +# +# # Config +# release.rb looks in the same directory where it's located for files named +# "$project.json" and "$project-platform-names.json". +# +# ## $project.json +# The project.json file controls the mapping of build platforms to release +# platforms so that a single build artifact can be reused on compatible +# platforms. See chef.json for an example. +# +# ## $project-platform-names.json +# The project-platform-names.json file maps short platform names to long ones. +# see chef-platform-names.json for an example. +# +# # Tests +# This file contains the script's tests. Tests are written in rspec. To run the +# tests, run rspec with this file as the argument, e.g., +# `rspec -cfs release.rb`. + +require 'optparse' +require 'digest' +require 'rubygems' +require 'json' +require 'mixlib/shellout' + +# required for Artifactory publishing +require 'artifactory' +require 'omnibus' +require 'tempfile' + +# Represnts the collection of artifacts on disk that we plan to upload. Handles +# finding the artifacts and dealing with the mapping between build platform and +# install platforms. +class ArtifactCollection + + class MissingArtifact < RuntimeError + end + + attr_reader :project + attr_reader :config + + def initialize(project, config) + @project = project + @config = config + end + + def platform_map_json + IO.read(File.expand_path("../#{project}.json", __FILE__)) + end + + def platform_map + JSON.parse(platform_map_json) + end + + def platform_name_map_path + File.expand_path("../#{project}-platform-names.json", __FILE__) + end + + def platform_name_map_json + IO.read(platform_name_map_path) + end + + def platform_name_map + JSON.parse(platform_name_map_json) + end + + def package_paths + @package_paths ||= Dir['**/pkg/*']. + sort. + reject {|path| path.include?("BUILD_VERSION") }. + reject {|path| path.include?("metadata.json") } + end + + def artifacts + artifacts = [] + missing_packages = [] + platform_map.each do |build_platform_spec, supported_platforms| + if path = package_paths.find { |p| p.include?(build_platform_spec) } + artifacts << Artifact.new(path, supported_platforms, config) + else + missing_packages << build_platform_spec + end + end + error_on_missing_pkgs!(missing_packages) + artifacts + end + + def error_on_missing_pkgs!(missing_packages) + unless missing_packages.empty? + if config[:ignore_missing_packages] + missing_packages.each do |pkg_config| + # TODO: this should go to $stderr + puts "WARN: Missing package for config: #{pkg_config}" + end + else + raise MissingArtifact, "Missing packages for config(s): '#{missing_packages.join("' '")}'" + end + end + end +end + +# Represents an individual package which has one or more supported platforms. +class Artifact + + attr_reader :path + attr_reader :platforms + attr_reader :config + + def initialize(path, platforms, config) + @path = path + @platforms = platforms + @config = config + end + + # Adds the package to +release_manifest+, which is a Hash. The result is in this form: + # "el" => { + # "5" => { "x86_64" => { "11.4.0-1" => "/el/5/x86_64/demoproject-11.4.0-1.el5.x86_64.rpm" } } + # } + # This method mutates the argument (hence the `!` at the end). The updated + # release manifest is returned. + def add_to_release_manifest!(release_manifest) + platforms.each do |distro, version, arch| + release_manifest[distro] ||= {} + release_manifest[distro][version] ||= {} + release_manifest[distro][version][arch] = { build_version => relpath } + # TODO: when adding checksums, the desired format is like this: + # build_support_json[platform][platform_version][machine_architecture][options[:version]]["relpath"] = build_location + end + release_manifest + end + + # Adds the package to +release_manifest+, which is a Hash. The result is in this form: + # "el" => { + # "5" => { + # "x86_64" => { + # "11.4.0-1" => { + # "relpath" => "/el/5/x86_64/demoproject-11.4.0-1.el5.x86_64.rpm", + # "md5" => "123f00d...", + # "sha256" => 456beef..." + # } + # } + # } + # } + # This method mutates the argument (hence the `!` at the end). The updated + # release manifest is returned. + def add_to_v2_release_manifest!(release_manifest) + platforms.each do |distro, version, arch| + pkg_info = { + "relpath" => relpath, + "md5" => md5, + "sha256" => sha256 + } + + release_manifest[distro] ||= {} + release_manifest[distro][version] ||= {} + release_manifest[distro][version][arch] = { build_version => pkg_info } + end + release_manifest + end + + def build_platform + platforms.first + end + + def build_version + config[:version] + end + + def relpath + # upload build to build platform directory + "/#{build_platform.join('/')}/#{path.split('/').last}" + end + + def md5 + @md5 ||= digest(Digest::MD5) + end + + def sha256 + @sha256 ||= digest(Digest::SHA256) + end + + private + + def digest(digest_class) + digest = digest_class.new + File.open(path) do |io| + while chunk = io.read(1024 * 8) + digest.update(chunk) + end + end + digest.hexdigest + end +end + +class ShipIt + attr_reader :argv + attr_reader :options + + def initialize(argv=[]) + @argv = argv + @options = {:package_s3_config_file => "~/.s3cfg"} + end + + def release_it + $stdout.sync = true + parse_options + artifact_collection = ArtifactCollection.new(options[:project], options) + artifacts = artifact_collection.artifacts + + v2_metadata = {} + + artifacts.each do |artifact| + artifact.add_to_v2_release_manifest!(v2_metadata) + upload_package(artifact.path, artifact.relpath) + + # Optionally publish to the new Artifactory infrastructure + if options[:publish_to_artifactory] + Omnibus.load_configuration(options[:omnibus_config]) + publish_to_artifactory(artifact) + end + + end + upload_v2_platform_name_map(artifact_collection.platform_name_map_path) + upload_v2_manifest(v2_metadata) + end + + def option_parser + @option_parser ||= OptionParser.new do |opts| + opts.banner = "Usage: #{$0} [options]" + + opts.on("-p", "--project PROJECT", "the project to release") do |project| + options[:project] = project + end + + opts.on("-v", "--version VERSION", "the version of the installer to release") do |version| + options[:version] = version + end + + opts.on("-b", "--bucket S3_BUCKET_NAME", "the name of the s3 bucket to release to") do |bucket| + options[:bucket] = bucket + end + + opts.on("-c", "--package-s3-config S3_CMD_CONFIG_FILE", "path to the s3cmd config file for packages bucket") do |config| + options[:package_s3_config_file] = config + end + + opts.on("-M", "--metadata-bucket S3_BUCKET_NAME", "the name of the S3 bucket for v2 metadata") do |bucket| + options[:metadata_bucket] = bucket + end + + opts.on("-m", "--metadata-s3-config S3_CMD_CONFIG_FILE", "path to the s3cmd config file for the v2 metadata AWS account") do |config_path| + options[:metadata_s3_config_file] = config_path + end + + opts.on("--ignore-missing-packages", + "indicates the release should continue if any build packages are missing") do |missing| + options[:ignore_missing_packages] = missing + end + + opts.on("--publish-to-artifactory", + "indicates the release should be published to Artifactory") do |artifactory| + options[:publish_to_artifactory] = artifactory + end + + opts.on("--omnibus-config OMNIBUS_CONFIG_FILE", + "path to the Omnibus config file which is required for Artifactory publishing") do |config_path| + options[:omnibus_config] = config_path + end + end + end + + def parse_options + option_parser.parse(argv) + + # check for an optional BUILD_VERSION file which is generated by the build script + if options[:version].nil? + # this file should be the same across all platforms so grab the first one + build_version_file = Dir['**/pkg/BUILD_VERSION'].first + options[:version] = IO.read(build_version_file).chomp if build_version_file + end + + required = [:project, :version, :bucket, :metadata_bucket, :metadata_s3_config_file] + + # If --publish-to-artifactory was provided then --omnibus-config is required + required << :omnibus_config if options[:publish_to_artifactory] + + missing = required.select {|param| options[param].nil?} + if !missing.empty? + puts "Missing required options: #{missing.join(', ')}" + puts option_parser + exit 1 + end + rescue OptionParser::InvalidOption, OptionParser::MissingArgument + puts $!.to_s + puts option_parser + exit 1 + end + + def shellout_opts + {:timeout => 1200, :live_stream => STDOUT} + end + + def progress + if STDOUT.tty? + "--progress" + else + "--no-progress" + end + end + + def upload_package(local_path, s3_path) + s3_cmd = ["s3cmd", + "-c #{options[:package_s3_config_file]}", + "put", + progress, + "--acl-public", + local_path, + "s3://#{options[:bucket]}#{s3_path}"].join(" ") + shell = Mixlib::ShellOut.new(s3_cmd, shellout_opts) + shell.run_command + shell.error! + end + + def upload_v2_manifest(manifest) + File.open("v2-release-manifest.json", "w") {|f| f.puts JSON.pretty_generate(manifest)} + + s3_location = "s3://#{options[:metadata_bucket]}/#{options[:project]}-release-manifest/#{options[:version]}.json" + puts "UPLOAD: v2-release-manifest.json -> #{s3_location}" + s3_cmd = ["s3cmd", + "-c #{options[:metadata_s3_config_file]}", + "put", + "--acl-public", + "v2-release-manifest.json", + s3_location].join(" ") + shell = Mixlib::ShellOut.new(s3_cmd, shellout_opts) + shell.run_command + shell.error! + end + + def upload_v2_platform_name_map(platform_names_file) + s3_location = "s3://#{options[:metadata_bucket]}/#{options[:project]}-release-manifest/#{options[:project]}-platform-names.json" + puts "UPLOAD: #{options[:project]}-platform-names.json -> #{s3_location}" + s3_cmd = ["s3cmd", + "-c #{options[:metadata_s3_config_file]}", + "put", + "--acl-public", + platform_names_file, + s3_location].join(" ") + shell = Mixlib::ShellOut.new(s3_cmd, shellout_opts) + shell.run_command + shell.error! + end + + def upload_v2_manifest? + !options[:metadata_bucket].nil? + end + + def publish_to_artifactory(artifact) + + metadata_json = "#{artifact.path}.metadata.json" + + if File.exist?(metadata_json) + metadata = JSON.parse(IO.read(metadata_json), :symbolize_names => true) + + # Historically we name our Windows-specific project definitions + # PROJECT_NAME-windows. We want to publish this project under + # PROJECT_NAME though. Luckily we are moving to a place where the + # Windows-specific project definition will just become part of the + # regular *nix project definition. Until then we need to modify the + # the artifact's associated `*.metadata.json` file as the Omnibus + # publisher uses this metadata when publishing to Artifactory. + if match = metadata[:name].match(/^(?<project_basename>.*)-windows$/) + metadata[:name] = match[:project_basename] + + File.open(metadata_json, 'w+') do |f| + f.write(JSON.pretty_generate(metadata)) + end + end + end + + # Publish artifact under each tested platform, platform version and arch! + artifact.platforms.each do |distro, version, arch| + + # We only really care about publishing for Windows 64-bit so ignore + # the 32-bit mappings + next if (distro == 'windows') && (arch == 'i686') + + tries = 3 + + begin + # Apply various 'fixes' to the metadata before uploading + fix_metadata(artifact.path) + + publisher = Omnibus::ArtifactoryPublisher.new( + artifact.path, + repository: 'omnibus-current-local', + platform: distro, + platform_version: version, + ) + + + publisher.publish do |package| + puts "Uploaded '#{package.name}'" + end + + rescue Omnibus::NoPackageMetadataFile => e + + puts "Could not locate package metadata file '#{artifact.path}.metadata.json'...skipping publish." + + rescue Artifactory::Error::ArtifactoryError => e + puts "\nError during publishing: #{e.message}" + puts "Backtrace:\n\t#{e.backtrace.join("\n\t")}" + + if (tries -= 1) != 0 + puts "\nRetrying failed publish #{tries} more time(s)..." + retry + else + raise + end + end + end + end + + # Attempts to fix an out-of-date `*.metadata.json` file produced by an + # an older version of Omnibus. The data contained in this file is very + # important in publishing activities. + def fix_metadata(package_local_path) + package = Omnibus::Package.new(package_local_path) + + old_metadata = JSON.parse(File.read(package.metadata.path), symbolize_names: true) + new_metadata = old_metadata.dup + + # OLD Omnibus does not include a project name!!!! O_o + unless new_metadata[:name] + match = package.name.match(/^(?<project_name>[a-z].*)(_|-)\d\.\d\.\d/) + new_metadata[:name] = match[:project_name] + end + + # Historically we name our Windows-specific project definitions + # PROJECT_NAME-windows. We want to publish this project under + # PROJECT_NAME though. Luckily we are moving to a place where the + # Windows-specific project definition will just become part of the + # regular *nix project definition. Until then we need to modify the + # the artifact's associated `*.metadata.json` file as the Omnibus + # publisher uses this metadata when publishing to Artifactory. + match = new_metadata[:name].match(/^(?<project_basename>.*)-windows$/) + new_metadata[:name] = match[:project_basename] if match + + # In pre-4.0 Omnibus packages are signed outside of the Omnibus + # build process which means Omnibus's generated checksums are wrong. + # As we use the Omnibus-generated metadata when publishing to + # Artifactory checksum mismatches are OK until Omnibus 4.0 is in + # general use. + if new_metadata[:platform] == 'el' + new_metadata[:md5] = package.md5 + new_metadata[:sha1] = package.sha1 + new_metadata[:sha256] = package.sha256 + new_metadata[:sha512] = package.sha512 + end + + # OLD Omnibus does not generate all checksum types + new_metadata[:sha256] = package.sha256 unless new_metadata[:sha256] + new_metadata[:sha512] = package.sha512 unless new_metadata[:sha512] + + # If the metadata has changed write the file + if new_metadata != old_metadata + metadata = if Omnibus.const_defined?('Metadata') + Omnibus::Metadata.new(package, new_metadata) + else + Omnibus::Package::Metadata.new(package, new_metadata) + end + puts "\nMetadata has changed...updating '#{metadata.path}'" + metadata.save + end + end +end + + +if !$0.include?("rspec") + ShipIt.new(ARGV).release_it +else + describe ArtifactCollection do + + # project_json is the thing that maps a build to. It is stored in the same + # directory with basename determined by project, e.g., "chef.json" for + # chef-client, "chef-server.json" for chef-server. By convention, the first + # entry is the platform that we actually do the build on. + let(:platform_map_json) do + <<-E +{ + "build_os=centos-5,machine_architecture=x64,role=oss-builder": [ + [ + "el", + "5", + "x86_64" + ], + [ + "sles", + "11.2", + "x86_64" + ] + ], + "build_os=centos-5,machine_architecture=x86,role=oss-builder": [ + [ + "el", + "5", + "i686" + ], + [ + "sles", + "11.2", + "i686" + ] + ] +} +E + end + + let(:platform_map) do + JSON.parse(platform_map_json) + end + + # mapping of short platform names to longer ones. + # This file lives in this script's directory under $project-platform-names.json + let(:platform_name_map_json) do + <<-E +{ + "el" : "Enterprise Linux", + "debian" : "Debian", + "mac_os_x" : "OS X", + "ubuntu" : "Ubuntu", + "solaris2" : "Solaris", + "sles" : "SUSE Enterprise", + "suse" : "openSUSE", + "windows" : "Windows" +} +E + end + + let(:platform_name_map) do + JSON.parse(platform_name_map_json) + end + + let(:directory_contents) do + %w[ + build_os=centos-5,machine_architecture=x64,role=oss-builder/pkg/demoproject-10.22.0-1.el5.x86_64.rpm.metadata.json + build_os=centos-5,machine_architecture=x64,role=oss-builder/pkg/demoproject-10.22.0-1.el5.x86_64.rpm + build_os=centos-5,machine_architecture=x64,role=oss-builder/pkg/BUILD_VERSION + build_os=centos-5,machine_architecture=x86,role=oss-builder/pkg/demoproject-10.22.0-1.el5.i686.rpm.metadata.json + build_os=centos-5,machine_architecture=x86,role=oss-builder/pkg/demoproject-10.22.0-1.el5.i686.rpm + build_os=centos-5,machine_architecture=x86,role=oss-builder/pkg/BUILD_VERSION + ] + end + + let(:artifact_collection) do + ArtifactCollection.new("demoproject", {}) + end + + it "has a project name" do + artifact_collection.project.should == "demoproject" + end + + it "has config" do + artifact_collection.config.should == {} + end + + it "loads the mapping of build platforms to install platforms from the local copy" do + expected_path = File.expand_path("../demoproject.json", __FILE__) + IO.should_receive(:read).with(expected_path).and_return(platform_map_json) + artifact_collection.platform_map_json.should == platform_map_json + end + + it "loads the mapping of platform short names to long names from the local copy" do + expected_path = File.expand_path("../demoproject-platform-names.json", __FILE__) + IO.should_receive(:read).with(expected_path).and_return(platform_name_map_json) + artifact_collection.platform_name_map_json.should == platform_name_map_json + end + + it "finds the package files among the artifacts" do + Dir.should_receive(:[]).with("**/pkg/*").and_return(directory_contents) + expected = %w[ + build_os=centos-5,machine_architecture=x64,role=oss-builder/pkg/demoproject-10.22.0-1.el5.x86_64.rpm + build_os=centos-5,machine_architecture=x86,role=oss-builder/pkg/demoproject-10.22.0-1.el5.i686.rpm + ] + artifact_collection.package_paths.should == expected + end + + context "after loading the build and platform mappings" do + + before do + artifact_collection.should respond_to(:platform_map_json) + artifact_collection.stub!(:platform_map_json).and_return(platform_map_json) + artifact_collection.should respond_to(:platform_name_map_json) + artifact_collection.stub!(:platform_name_map_json).and_return(platform_name_map_json) + end + + it "parses the build platform mapping" do + artifact_collection.platform_map.should == platform_map + end + + it "parses the platform short name => long name mapping" do + artifact_collection.platform_name_map.should == platform_name_map + end + + it "returns a list of artifacts for each package" do + Dir.should_receive(:[]).with("**/pkg/*").and_return(directory_contents) + + artifact_collection.should have(2).artifacts + centos5_64bit_artifact = artifact_collection.artifacts.first + + path = "build_os=centos-5,machine_architecture=x64,role=oss-builder/pkg/demoproject-10.22.0-1.el5.x86_64.rpm" + centos5_64bit_artifact.path.should == path + + platforms = [ [ "el", "5", "x86_64" ], [ "sles","11.2","x86_64" ] ] + centos5_64bit_artifact.platforms.should == platforms + end + + context "and some expected packages are missing" do + let(:directory_contents) do + %w[ + build_os=centos-5,machine_architecture=x86,role=oss-builder/pkg/demoproject-10.22.0-1.el5.i686.rpm + build_os=centos-5,machine_architecture=x86,role=oss-builder/pkg/BUILD_VERSION + ] + end + + before do + Dir.should_receive(:[]).with("**/pkg/*").and_return(directory_contents) + end + + it "errors out verifying all packages are available" do + err_msg = "Missing packages for config(s): 'build_os=centos-5,machine_architecture=x64,role=oss-builder'" + lambda {artifact_collection.artifacts}.should raise_error(ArtifactCollection::MissingArtifact, err_msg) + end + + end + end + + end # describe ArtifactCollection + + describe Artifact do + + let(:path) { "build_os=centos-5,machine_architecture=x86,role=oss-builder/pkg/demoproject-11.4.0-1.el5.x86_64.rpm" } + + let(:content) { StringIO.new("this is the package content\n") } + + let(:md5) { "d41d8cd98f00b204e9800998ecf8427e" } + + let(:sha256) { "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" } + + let(:platforms) { [ [ "el", "5", "x86_64" ], [ "sles","11.2","x86_64" ] ] } + + let(:artifact) { Artifact.new(path, platforms, { :version => "11.4.0-1" }) } + + it "has the path to the package" do + artifact.path.should == path + end + + it "has a list of platforms the package supports" do + artifact.platforms.should == platforms + end + + it "generates a MD5 of an artifact" do + File.should_receive(:open).with(path).and_return(content) + artifact.md5.should == md5 + end + + it "generates a SHA256 of an artifact" do + File.should_receive(:open).with(path).and_return(content) + artifact.sha256.should == sha256 + end + + it "adds the package to a release manifest" do + expected = { + "el" => { + "5" => { "x86_64" => { "11.4.0-1" => "/el/5/x86_64/demoproject-11.4.0-1.el5.x86_64.rpm" } } + }, + "sles" => { + "11.2" => { "x86_64" => { "11.4.0-1" => "/el/5/x86_64/demoproject-11.4.0-1.el5.x86_64.rpm" } } + } + } + + manifest = artifact.add_to_release_manifest!({}) + manifest.should == expected + end + + it "adds the package to a v2 release manifest" do + File.should_receive(:open).with(path).twice.and_return(content) + expected = { + "el" => { + "5" => { "x86_64" => { "11.4.0-1" => { + "relpath" => "/el/5/x86_64/demoproject-11.4.0-1.el5.x86_64.rpm", + "md5" => md5, + "sha256" => sha256 + } + } + } + }, + "sles" => { + "11.2" => { "x86_64" => { "11.4.0-1" => { + "relpath" => "/el/5/x86_64/demoproject-11.4.0-1.el5.x86_64.rpm", + "md5" => md5, + "sha256" => sha256 + } + } + } + } + } + v2_manifest = artifact.add_to_v2_release_manifest!({}) + v2_manifest.should == expected + end + + end +end + diff --git a/omnibus/jenkins/solo.rb b/omnibus/jenkins/solo.rb new file mode 100644 index 0000000000..3d33309d8f --- /dev/null +++ b/omnibus/jenkins/solo.rb @@ -0,0 +1,3 @@ +pwd = File.expand_path(File.dirname(__FILE__)) +file_cache_path "#{pwd}/chef-solo/cache" +cookbook_path ["#{pwd}/../cookbooks", "#{pwd}/../vendor/cookbooks"] diff --git a/omnibus/jenkins/verify-chef-container.sh b/omnibus/jenkins/verify-chef-container.sh new file mode 100755 index 0000000000..d2eb54fe24 --- /dev/null +++ b/omnibus/jenkins/verify-chef-container.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +export PATH=/opt/chef/bin:$PATH + +# Ensure the calling environment (disapproval look Bundler) does not +# infect our Ruby environment created by the `chef-int` cli. +for ruby_env_var in _ORIGINAL_GEM_PATH \ + BUNDLE_BIN_PATH \ + BUNDLE_GEMFILE \ + GEM_HOME \ + GEM_PATH \ + GEM_ROOT \ + RUBYLIB \ + RUBYOPT \ + RUBY_ENGINE \ + RUBY_ROOT \ + RUBY_VERSION +do + unset $ruby_env_var +done + +sudo chef-init --verify diff --git a/omnibus/jenkins/verify-chef.bat b/omnibus/jenkins/verify-chef.bat new file mode 100755 index 0000000000..1c159f0668 --- /dev/null +++ b/omnibus/jenkins/verify-chef.bat @@ -0,0 +1,56 @@ + +@ECHO OFF + +REM ; %PROJECT_NAME% is set by Jenkins, this allows us to use the same script to verify +REM ; Chef and Angry Chef +cd C:\opscode\%PROJECT_NAME%\bin + +REM ; We don't want to add the embedded bin dir to the main PATH as this +REM ; could mask issues in our binstub shebangs. +SET EMBEDDED_BIN_DIR=C:\opscode\%PROJECT_NAME%\embedded\bin + +ECHO. + +FOR %%b IN ( + chef-client + knife + chef-solo + ohai +) DO ( + + + ECHO Checking for existence of binfile `%%b`... + + IF EXIST %%b ( + ECHO ...FOUND IT! + ) ELSE ( + GOTO :error + ) + ECHO. +) + +call chef-client --version + +REM ; Exercise various packaged tools to validate binstub shebangs +call %EMBEDDED_BIN_DIR%\ruby --version +call %EMBEDDED_BIN_DIR%\gem --version +call %EMBEDDED_BIN_DIR%\bundle --version +call %EMBEDDED_BIN_DIR%\rspec --version + +SET PATH=C:\opscode\%PROJECT_NAME%\bin;C:\opscode\%PROJECT_NAME%\embedded\bin;%PATH% + +REM ; Test against the vendored chef gem +cd C:\opscode\%PROJECT_NAME%\embedded\lib\ruby\gems\2*\gems\chef-*-mingw32 + +IF NOT EXIST "Gemfile.lock" ( + ECHO "Chef gem does not contain a Gemfile.lock! This is needed to run any tests." + GOTO :error +) + +IF "%PIPELINE_NAME%" == "chef-13" ( + REM ; Running unit and functional tests + call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/unit spec/functional +) ELSE ( + REM ; Running unit tests + call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/unit spec/functional +) diff --git a/omnibus/jenkins/verify-chef.sh b/omnibus/jenkins/verify-chef.sh new file mode 100755 index 0000000000..4e60b1fd9f --- /dev/null +++ b/omnibus/jenkins/verify-chef.sh @@ -0,0 +1,89 @@ +#!/bin/sh + +# $PROJECT_NAME is set by Jenkins, this allows us to use the same script to verify +# Chef and Angry Chef +PATH=/opt/$PROJECT_NAME/bin:$PATH +export PATH + +BIN_DIR=/opt/$PROJECT_NAME/bin +export BIN_DIR + +# We don't want to add the embedded bin dir to the main PATH as this +# could mask issues in our binstub shebangs. +EMBEDDED_BIN_DIR=/opt/$PROJECT_NAME/embedded/bin +export EMBEDDED_BIN_DIR + +# If we are on Mac our symlinks are located under /usr/local/bin +# otherwise they are under /usr/bin +if [ -f /usr/bin/sw_vers ]; then + USR_BIN_DIR="/usr/local/bin" +else + USR_BIN_DIR="/usr/bin" +fi +export USR_BIN_DIR + +# sanity check that we're getting the correct symlinks from the pre-install script +# solaris doesn't have readlink or test -e. ls -n is different on BSD. proceed with caution. +if [ ! -L $USR_BIN_DIR/chef-client ] || [ `ls -l $USR_BIN_DIR/chef-client | awk '{print$NF}'` != "$BIN_DIR/chef-client" ]; then + echo "$USR_BIN_DIR/chef-client symlink to $BIN_DIR/chef-client was not correctly created by the pre-install script!" + exit 1 +fi + +if [ ! -L $USR_BIN_DIR/knife ] || [ `ls -l $USR_BIN_DIR/knife | awk '{print$NF}'` != "$BIN_DIR/knife" ]; then + echo "$USR_BIN_DIR/knife symlink to $BIN_DIR/knife was not correctly created by the pre-install script!" + exit 1 +fi + +if [ ! -L $USR_BIN_DIR/chef-solo ] || [ `ls -l $USR_BIN_DIR/chef-solo | awk '{print$NF}'` != "$BIN_DIR/chef-solo" ]; then + echo "$USR_BIN_DIR/chef-solo symlink to $BIN_DIR/chef-solo was not correctly created by the pre-install script!" + exit 1 +fi + +if [ ! -L $USR_BIN_DIR/ohai ] || [ `ls -l $USR_BIN_DIR/ohai | awk '{print$NF}'` != "$BIN_DIR/ohai" ]; then + echo "$USR_BIN_DIR/ohai symlink to $BIN_DIR/ohai was not correctly created by the pre-install script!" + exit 1 +fi + +# Ensure the calling environment (disapproval look Bundler) does not +# infect our Ruby environment created by the `chef-client` cli. +for ruby_env_var in _ORIGINAL_GEM_PATH \ + BUNDLE_BIN_PATH \ + BUNDLE_GEMFILE \ + GEM_HOME \ + GEM_PATH \ + GEM_ROOT \ + RUBYLIB \ + RUBYOPT \ + RUBY_ENGINE \ + RUBY_ROOT \ + RUBY_VERSION + +do + unset $ruby_env_var +done + +chef-client --version + +# Exercise various packaged tools to validate binstub shebangs +$EMBEDDED_BIN_DIR/ruby --version +$EMBEDDED_BIN_DIR/gem --version +$EMBEDDED_BIN_DIR/bundle --version +$EMBEDDED_BIN_DIR/rspec --version + +# ffi-yajl must run in c-extension mode or we take perf hits, so we force it +# before running rspec so that we don't wind up testing the ffi mode +FORCE_FFI_YAJL=ext +export FORCE_FFI_YAJL + +PATH=/opt/$PROJECT_NAME/bin:/opt/$PROJECT_NAME/embedded/bin:$PATH +export PATH + +# Test against the vendored Chef gem +cd /opt/$PROJECT_NAME/embedded/lib/ruby/gems/*/gems/chef-[0-9]* + +if [ ! -f "Gemfile.lock" ]; then + echo "Chef gem does not contain a Gemfile.lock! This is needed to run any tests." + exit 1 +fi + +sudo env PATH=$PATH TERM=xterm bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o $WORKSPACE/test.xml -f documentation spec/functional spec/unit diff --git a/omnibus/jenkins/verify-chefdk.bat b/omnibus/jenkins/verify-chefdk.bat new file mode 100755 index 0000000000..9677b4a34e --- /dev/null +++ b/omnibus/jenkins/verify-chefdk.bat @@ -0,0 +1,32 @@ + +@ECHO OFF + +cd C:\opscode\chefdk\bin + +ECHO( + +FOR %%b IN ( + berks + chef + chef-client + kitchen + knife + rubocop +) DO ( + + + ECHO Checking for existence of binfile `%%b`... + + IF EXIST %%b ( + + ECHO ...FOUND IT! + + ) ELSE ( + + GOTO :error + + ) + ECHO( +) + +chef verify diff --git a/omnibus/jenkins/verify-chefdk.sh b/omnibus/jenkins/verify-chefdk.sh new file mode 100755 index 0000000000..1860f554cc --- /dev/null +++ b/omnibus/jenkins/verify-chefdk.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +export PATH=/opt/chefdk/bin:$PATH + +# Ensure the calling environment (disapproval look Bundler) does not +# infect our Ruby environment created by the `chef` cli. +for ruby_env_var in _ORIGINAL_GEM_PATH \ + BUNDLE_BIN_PATH \ + BUNDLE_GEMFILE \ + GEM_HOME \ + GEM_PATH \ + GEM_ROOT \ + RUBYLIB \ + RUBYOPT \ + RUBY_ENGINE \ + RUBY_ROOT \ + RUBY_VERSION +do + unset $ruby_env_var +done + +sudo chef verify --unit diff --git a/omnibus/omnibus.rb b/omnibus/omnibus.rb new file mode 100644 index 0000000000..3afa2ad84e --- /dev/null +++ b/omnibus/omnibus.rb @@ -0,0 +1,54 @@ +# +# 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+. +# + +# 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' + +# Windows architecture defaults - set to x86 unless otherwise specified. +# ------------------------------ +windows_arch %w{x86 x64}.include?((ENV['OMNIBUS_WINDOWS_ARCH'] || '').downcase) ? + ENV['OMNIBUS_WINDOWS_ARCH'].downcase.to_sym : :x86 + +# Disable git caching +# ------------------------------ +# use_git_caching false + +# Enable S3 asset caching +# ------------------------------ +use_s3_caching true +s3_access_key ENV['AWS_ACCESS_KEY_ID'] +s3_secret_key ENV['AWS_SECRET_ACCESS_KEY'] +s3_bucket 'opscode-omnibus-cache' + +build_retries 3 +fetcher_retries 3 +fetcher_read_timeout 120 + +# We limit this to 10 workers to eliminate transient timing issues in the +# way Ruby (and other components) compiles on some more esoteric *nixes. +workers 10 + +# Load additional software +# ------------------------------ +# software_gems ['omnibus-software', 'my-company-software'] +# local_software_dirs ['/path/to/local/software'] diff --git a/omnibus/package-scripts/angrychef/postinst b/omnibus/package-scripts/angrychef/postinst new file mode 100755 index 0000000000..c0fc3f5525 --- /dev/null +++ b/omnibus/package-scripts/angrychef/postinst @@ -0,0 +1,115 @@ +#!/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=/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_darwin() +{ + uname -v | grep "^Darwin" 2>&1 >/dev/null +} + +is_smartos() +{ + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +elif is_darwin; then + PREFIX="/usr/local" + mkdir -p "$PREFIX/bin" +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/chef-apply +rm -f $PREFIX/bin/chef-shell +rm -f $PREFIX/bin/knife +rm -f $PREFIX/bin/shef +rm -f $PREFIX/bin/ohai + +ln -sf $INSTALLER_DIR/bin/chef-solo $PREFIX/bin || error_exit "Cannot link chef-solo to $PREFIX/bin" +if [ -f "$INSTALLER_DIR/bin/chef-apply" ]; then + ln -sf $INSTALLER_DIR/bin/chef-apply $PREFIX/bin || error_exit "Cannot link chef-apply to $PREFIX/bin" +fi +if [ -f "$INSTALLER_DIR/bin/chef-shell" ]; then + ln -sf $INSTALLER_DIR/bin/chef-shell $PREFIX/bin || error_exit "Cannot link chef-shell to $PREFIX/bin" +fi +ln -sf $INSTALLER_DIR/bin/knife $PREFIX/bin || error_exit "Cannot link knife to $PREFIX/bin" +if [ -f "$INSTALLER_DIR/bin/shef" ]; then + ln -sf $INSTALLER_DIR/bin/shef $PREFIX/bin || error_exit "Cannot link shef to $PREFIX/bin" +fi +ln -sf $INSTALLER_DIR/bin/ohai $PREFIX/bin || error_exit "Cannot link ohai to $PREFIX/bin" + +# We test for the presence of /usr/bin/chef-client to know if this script succeeds, so this +# must appear as the last real action in the script +ln -sf $INSTALLER_DIR/bin/chef-client $PREFIX/bin || error_exit "Cannot link chef-client to $PREFIX/bin" + +# Ensure all files/directories in $INSTALLER_DIR are owned by root. This +# has been fixed on new installs but upgrades from old installs need to +# be manually fixed. +chown -Rh 0:0 $INSTALLER_DIR + +echo "Thank you for installing Chef!" + +exit 0 diff --git a/omnibus/package-scripts/angrychef/postrm b/omnibus/package-scripts/angrychef/postrm new file mode 100755 index 0000000000..724c082be7 --- /dev/null +++ b/omnibus/package-scripts/angrychef/postrm @@ -0,0 +1,42 @@ +#!/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. + +is_smartos() { + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +is_darwin() +{ + uname -v | grep "^Darwin" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +elif is_darwin; then + PREFIX="/usr/local" +else + PREFIX="/usr" +fi + +cleanup_symlinks() { + binaries="chef-client chef-solo chef-apply chef-shell knife shef ohai" + for binary in $binaries; do + rm -f $PREFIX/bin/$binary + done +} + +# Clean up binary symlinks if they exist +# see: http://tickets.opscode.com/browse/CHEF-3022 +if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release -a ! -f /etc/SuSE-release ]; then + # not a redhat-ish RPM-based system + cleanup_symlinks +elif [ "x$1" = "x0" ]; then + # RPM-based system and we're deinstalling rather than upgrading + cleanup_symlinks +fi diff --git a/omnibus/package-scripts/chef-fips/postinst b/omnibus/package-scripts/chef-fips/postinst new file mode 100755 index 0000000000..6f13382b61 --- /dev/null +++ b/omnibus/package-scripts/chef-fips/postinst @@ -0,0 +1,115 @@ +#!/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=/opt/chef-fips +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_darwin() +{ + uname -v | grep "^Darwin" 2>&1 >/dev/null +} + +is_smartos() +{ + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +elif is_darwin; then + PREFIX="/usr/local" + mkdir -p "$PREFIX/bin" +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/chef-apply +rm -f $PREFIX/bin/chef-shell +rm -f $PREFIX/bin/knife +rm -f $PREFIX/bin/shef +rm -f $PREFIX/bin/ohai + +ln -sf $INSTALLER_DIR/bin/chef-solo $PREFIX/bin || error_exit "Cannot link chef-solo to $PREFIX/bin" +if [ -f "$INSTALLER_DIR/bin/chef-apply" ]; then + ln -sf $INSTALLER_DIR/bin/chef-apply $PREFIX/bin || error_exit "Cannot link chef-apply to $PREFIX/bin" +fi +if [ -f "$INSTALLER_DIR/bin/chef-shell" ]; then + ln -sf $INSTALLER_DIR/bin/chef-shell $PREFIX/bin || error_exit "Cannot link chef-shell to $PREFIX/bin" +fi +ln -sf $INSTALLER_DIR/bin/knife $PREFIX/bin || error_exit "Cannot link knife to $PREFIX/bin" +if [ -f "$INSTALLER_DIR/bin/shef" ]; then + ln -sf $INSTALLER_DIR/bin/shef $PREFIX/bin || error_exit "Cannot link shef to $PREFIX/bin" +fi +ln -sf $INSTALLER_DIR/bin/ohai $PREFIX/bin || error_exit "Cannot link ohai to $PREFIX/bin" + +# We test for the presence of /usr/bin/chef-client to know if this script succeeds, so this +# must appear as the last real action in the script +ln -sf $INSTALLER_DIR/bin/chef-client $PREFIX/bin || error_exit "Cannot link chef-client to $PREFIX/bin" + +# Ensure all files/directories in $INSTALLER_DIR are owned by root. This +# has been fixed on new installs but upgrades from old installs need to +# be manually fixed. +chown -Rh 0:0 $INSTALLER_DIR + +echo "Thank you for installing Chef!" + +exit 0 diff --git a/omnibus/package-scripts/chef-fips/postrm b/omnibus/package-scripts/chef-fips/postrm new file mode 100755 index 0000000000..724c082be7 --- /dev/null +++ b/omnibus/package-scripts/chef-fips/postrm @@ -0,0 +1,42 @@ +#!/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. + +is_smartos() { + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +is_darwin() +{ + uname -v | grep "^Darwin" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +elif is_darwin; then + PREFIX="/usr/local" +else + PREFIX="/usr" +fi + +cleanup_symlinks() { + binaries="chef-client chef-solo chef-apply chef-shell knife shef ohai" + for binary in $binaries; do + rm -f $PREFIX/bin/$binary + done +} + +# Clean up binary symlinks if they exist +# see: http://tickets.opscode.com/browse/CHEF-3022 +if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release -a ! -f /etc/SuSE-release ]; then + # not a redhat-ish RPM-based system + cleanup_symlinks +elif [ "x$1" = "x0" ]; then + # RPM-based system and we're deinstalling rather than upgrading + cleanup_symlinks +fi diff --git a/omnibus/package-scripts/chef/postinst b/omnibus/package-scripts/chef/postinst new file mode 100755 index 0000000000..88016f6c03 --- /dev/null +++ b/omnibus/package-scripts/chef/postinst @@ -0,0 +1,115 @@ +#!/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=/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_darwin() +{ + uname -v | grep "^Darwin" 2>&1 >/dev/null +} + +is_smartos() +{ + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +elif is_darwin; then + PREFIX="/usr/local" + mkdir -p "$PREFIX/bin" +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/chef-apply +rm -f $PREFIX/bin/chef-shell +rm -f $PREFIX/bin/knife +rm -f $PREFIX/bin/shef +rm -f $PREFIX/bin/ohai + +ln -sf $INSTALLER_DIR/bin/chef-solo $PREFIX/bin || error_exit "Cannot link chef-solo to $PREFIX/bin" +if [ -f "$INSTALLER_DIR/bin/chef-apply" ]; then + ln -sf $INSTALLER_DIR/bin/chef-apply $PREFIX/bin || error_exit "Cannot link chef-apply to $PREFIX/bin" +fi +if [ -f "$INSTALLER_DIR/bin/chef-shell" ]; then + ln -sf $INSTALLER_DIR/bin/chef-shell $PREFIX/bin || error_exit "Cannot link chef-shell to $PREFIX/bin" +fi +ln -sf $INSTALLER_DIR/bin/knife $PREFIX/bin || error_exit "Cannot link knife to $PREFIX/bin" +if [ -f "$INSTALLER_DIR/bin/shef" ]; then + ln -sf $INSTALLER_DIR/bin/shef $PREFIX/bin || error_exit "Cannot link shef to $PREFIX/bin" +fi +ln -sf $INSTALLER_DIR/bin/ohai $PREFIX/bin || error_exit "Cannot link ohai to $PREFIX/bin" + +# We test for the presence of /usr/bin/chef-client to know if this script succeeds, so this +# must appear as the last real action in the script +ln -sf $INSTALLER_DIR/bin/chef-client $PREFIX/bin || error_exit "Cannot link chef-client to $PREFIX/bin" + +# Ensure all files/directories in $INSTALLER_DIR are owned by root. This +# has been fixed on new installs but upgrades from old installs need to +# be manually fixed. +chown -Rh 0:0 $INSTALLER_DIR + +echo "Thank you for installing Chef!" + +exit 0 diff --git a/omnibus/package-scripts/chef/postrm b/omnibus/package-scripts/chef/postrm new file mode 100755 index 0000000000..724c082be7 --- /dev/null +++ b/omnibus/package-scripts/chef/postrm @@ -0,0 +1,42 @@ +#!/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. + +is_smartos() { + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +is_darwin() +{ + uname -v | grep "^Darwin" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +elif is_darwin; then + PREFIX="/usr/local" +else + PREFIX="/usr" +fi + +cleanup_symlinks() { + binaries="chef-client chef-solo chef-apply chef-shell knife shef ohai" + for binary in $binaries; do + rm -f $PREFIX/bin/$binary + done +} + +# Clean up binary symlinks if they exist +# see: http://tickets.opscode.com/browse/CHEF-3022 +if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release -a ! -f /etc/SuSE-release ]; then + # not a redhat-ish RPM-based system + cleanup_symlinks +elif [ "x$1" = "x0" ]; then + # RPM-based system and we're deinstalling rather than upgrading + cleanup_symlinks +fi diff --git a/omnibus/package-scripts/chefdk/postinst b/omnibus/package-scripts/chefdk/postinst new file mode 100755 index 0000000000..73a37487c9 --- /dev/null +++ b/omnibus/package-scripts/chefdk/postinst @@ -0,0 +1,57 @@ +#!/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_darwin() +{ + uname -v | grep "^Darwin" 2>&1 >/dev/null +} + +is_smartos() +{ + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +elif is_darwin; then + PREFIX="/usr/local" + mkdir -p "$PREFIX/bin" +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 ohai berks fauxhai foodcritic kitchen rubocop 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 + +# Ensure all files/directories in $INSTALLER_DIR are owned by root. This +# has been fixed on new installs but upgrades from old installs need to +# be manually fixed. +chown -Rh 0:0 $INSTALLER_DIR + +echo "Thank you for installing Chef Development Kit!" + +exit 0 diff --git a/omnibus/package-scripts/chefdk/postrm b/omnibus/package-scripts/chefdk/postrm new file mode 100755 index 0000000000..428bf7c3b0 --- /dev/null +++ b/omnibus/package-scripts/chefdk/postrm @@ -0,0 +1,42 @@ +#!/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. + +is_darwin() +{ + uname -v | grep "^Darwin" 2>&1 >/dev/null +} + +is_smartos() { + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +elif is_darwin; then + PREFIX="/usr/local" +else + PREFIX="/usr" +fi + +cleanup_symlinks() { + binaries="chef chef-solo chef-apply chef-shell knife shef ohai berks chef-zero fauxhai foodcritic kitchen rubocop strain strainer chef-client" + for binary in $binaries; do + rm -f $PREFIX/bin/$binary + done +} + +# Clean up binary symlinks if they exist +# see: http://tickets.opscode.com/browse/CHEF-3022 +if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release ]; then + # not a redhat-ish RPM-based system + cleanup_symlinks +elif [ "x$1" = "x0" ]; then + # RPM-based system and we're deinstalling rather than upgrading + cleanup_symlinks +fi diff --git a/omnibus/package-scripts/push-jobs-client/postinst b/omnibus/package-scripts/push-jobs-client/postinst new file mode 100755 index 0000000000..66e58ae368 --- /dev/null +++ b/omnibus/package-scripts/push-jobs-client/postinst @@ -0,0 +1,55 @@ +#!/bin/sh +# WARNING: REQUIRES /bin/sh +# +# Post install configuration for Push Jobs Client +# + +PROGNAME=`basename $0` +INSTALLER_DIR=/opt/push-jobs-client + +error_exit() +{ + echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + exit 1 +} + +is_darwin() +{ + uname -v | grep "^Darwin" 2>&1 >/dev/null +} + +is_smartos() +{ + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +elif is_darwin; then + PREFIX="/usr/local" + mkdir -p "$PREFIX/bin" +else + PREFIX="/usr" +fi + +# We test for the presence of /usr/bin/push-client to know if this script succeeds, +# so push-client must appear as the last item here. +binaries="pushy-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 + +# Ensure all files/directories in $INSTALLER_DIR are owned by root. This +# has been fixed on new installs but upgrades from old installs need to +# be manually fixed. +chown -Rh 0:0 $INSTALLER_DIR + +echo "Thank you for installing Chef Push Jobs Client!" + +exit 0 diff --git a/omnibus/package-scripts/push-jobs-client/postrm b/omnibus/package-scripts/push-jobs-client/postrm new file mode 100755 index 0000000000..f4508a48fe --- /dev/null +++ b/omnibus/package-scripts/push-jobs-client/postrm @@ -0,0 +1,39 @@ +#!/bin/sh +# WARNING: REQUIRES /bin/sh +# +# Post uninstall configuration for Push Jobs Client +# + +is_smartos() { + uname -v | grep "^joyent" 2>&1 >/dev/null +} + +is_darwin() +{ + uname -v | grep "^Darwin" 2>&1 >/dev/null +} + +if is_smartos; then + PREFIX="/opt/local" +elif is_darwin; then + PREFIX="/usr/local" +else + PREFIX="/usr" +fi + +cleanup_symlinks() { + binaries="pushy-client" + for binary in $binaries; do + rm -f $PREFIX/bin/$binary + done +} + +# Clean up binary symlinks if they exist +# see: http://tickets.opscode.com/browse/CHEF-3022 +if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release -a ! -f /etc/SuSE-release ]; then + # not a redhat-ish RPM-based system + cleanup_symlinks +elif [ "x$1" = "x0" ]; then + # RPM-based system and we're deinstalling rather than upgrading + cleanup_symlinks +fi diff --git a/omnibus/resources/chef/dmg/background.png b/omnibus/resources/chef/dmg/background.png Binary files differnew file mode 100644 index 0000000000..82c605ae51 --- /dev/null +++ b/omnibus/resources/chef/dmg/background.png diff --git a/omnibus/resources/chef/dmg/icon.png b/omnibus/resources/chef/dmg/icon.png Binary files differnew file mode 100644 index 0000000000..b65c309660 --- /dev/null +++ b/omnibus/resources/chef/dmg/icon.png diff --git a/omnibus/resources/chef/msi/assets/LICENSE.rtf b/omnibus/resources/chef/msi/assets/LICENSE.rtf new file mode 100644 index 0000000000..b18e6f59b8 --- /dev/null +++ b/omnibus/resources/chef/msi/assets/LICENSE.rtf @@ -0,0 +1,197 @@ +{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}} + +{\*\generator Msftedit 5.41.21.2500;}\viewkind4\uc1\pard\qc\lang1033\f0\fs20 Apache License\par + +Version 2.0, January 2004\par + +http://www.apache.org/licenses/\par + +\pard\par + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\par + +\par + +1. Definitions.\par + +\par + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\par + +\par + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\par + +\par + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\par + +\par + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.\par + +\par + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation, source, and configuration files.\par + +\par + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\par + +\par + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\par + +\par + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\par + +\par + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."\par + +\par + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\par + +\par + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\par + +\par + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license plies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\par + +\par + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\par + +\par + + (a) You must give any other recipients of the Work or\par + + Derivative Works a copy of this License; and\par + +\par + + (b) You must cause any modified files to carry prominent notices\par + + stating that You changed the files; and\par + +\par + + (c) You must retain, in the Source form of any Derivative Works\par + + that You distribute, all copyright, patent, trademark, and\par + + attribution notices from the Source form of the Work,\par + + excluding those notices that do not pertain to any part of\par + + the Derivative Works; and\par + +\par + + (d) If the Work includes a "NOTICE" text file as part of its\par + + distribution, then any Derivative Works that You distribute\par + + must include a readable copy of the attribution notices\par + + contained within such NOTICE file, excluding those notices\par + + that do not pertain to any part of the Derivative Works, in\par + + at least one of the following places: within a NOTICE text\par + + file distributed as part of the Derivative Works; within the\par + + Source form or documentation, if provided along with the\par + + Derivative Works; or, within a display generated by the\par + + Derivative Works, if and wherever such third-party notices\par + + normally appear. The contents of the NOTICE file are for\par + + informational purposes only and do not modify the License.\par + + You may add Your own attribution notices within Derivative\par + + Works that You distribute, alongside or as an addendum to the\par + + NOTICE text from the Work, provided that such additional\par + + attribution notices cannot be construed as modifying the\par + + License.\par + +\par + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\par + +\par + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\par + +\par + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\par + +\par + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\par + +\par + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\par + +\par + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\par + +\par + +END OF TERMS AND CONDITIONS\par + +\par + +APPENDIX: How to apply the Apache License to your work.\par + +\par + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.\par + +\par + + Copyright [yyyy] [name of copyright owner]\par + +\par + + Licensed under the Apache License, Version 2.0 (the "License");\par + + you may not use this file except in compliance with the License.\par + + You may obtain a copy of the License at\par + +\par + + http://www.apache.org/licenses/LICENSE-2.0\par + +\par + + Unless required by applicable law or agreed to in writing, software\par + + distributed under the License is distributed on an "AS IS" BASIS,\par + + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\par + + implied. See the License for the specific language governing\par + + permissions and limitations under the License.\par + +\par + +} + + diff --git a/omnibus/resources/chef/msi/assets/banner_background.bmp b/omnibus/resources/chef/msi/assets/banner_background.bmp Binary files differnew file mode 100644 index 0000000000..5769a883c3 --- /dev/null +++ b/omnibus/resources/chef/msi/assets/banner_background.bmp diff --git a/omnibus/resources/chef/msi/assets/dialog_background.bmp b/omnibus/resources/chef/msi/assets/dialog_background.bmp Binary files differnew file mode 100644 index 0000000000..4dbe489e9c --- /dev/null +++ b/omnibus/resources/chef/msi/assets/dialog_background.bmp diff --git a/omnibus/resources/chef/msi/assets/oc.ico b/omnibus/resources/chef/msi/assets/oc.ico Binary files differnew file mode 100644 index 0000000000..c4cee7bd75 --- /dev/null +++ b/omnibus/resources/chef/msi/assets/oc.ico diff --git a/omnibus/resources/chef/msi/assets/oc_16x16.ico b/omnibus/resources/chef/msi/assets/oc_16x16.ico Binary files differnew file mode 100644 index 0000000000..d3bd065a6a --- /dev/null +++ b/omnibus/resources/chef/msi/assets/oc_16x16.ico diff --git a/omnibus/resources/chef/msi/assets/oc_32x32.ico b/omnibus/resources/chef/msi/assets/oc_32x32.ico Binary files differnew file mode 100644 index 0000000000..5eee0042c3 --- /dev/null +++ b/omnibus/resources/chef/msi/assets/oc_32x32.ico diff --git a/omnibus/resources/chef/msi/localization-en-us.wxl.erb b/omnibus/resources/chef/msi/localization-en-us.wxl.erb new file mode 100644 index 0000000000..767f615bb7 --- /dev/null +++ b/omnibus/resources/chef/msi/localization-en-us.wxl.erb @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization"> + <!-- http://wix.codeplex.com/SourceControl/changeset/view/792e101c5cf7#src%2fext%2fUIExtension%2fwixlib%2fWixUI_en-us.wxl --> + <String Id="LANG">1033</String> + <String Id="ProductName"><%= friendly_name %></String> + <String Id="ManufacturerName"><%= maintainer.encode(:xml => :attr) %></String> + <String Id="WelcomeDlgTitle">{\WixUI_Font_Bigger}Welcome to the [ProductName] Setup Wizard</String> + + <String Id="LicenseAgreementDlgTitle">{\WixUI_Font_Title_White}End-User License Agreement</String> + <String Id="LicenseAgreementDlgDescription">{\WixUI_Font_Normal_White}Please read the following license agreement carefully</String> + + <String Id="InstallDirDlgTitle">{\WixUI_Font_Title_White}Destination Folder</String> + <String Id="InstallDirDlgDescription">{\WixUI_Font_Normal_White}Click Next to install to the default folder or click Change to choose another.</String> + + <String Id="ProgressDlgTitleInstalling">{\WixUI_Font_Title_White}Installing [ProductName]</String> + + <String Id="VerifyReadyDlgInstallTitle">{\WixUI_Font_Title_White}Ready to install [ProductName]</String> + + <!-- Service --> + <!-- Keep these in sync with the name and description in chef-service-manager --> + <String Id="ServiceDisplayName"><%= friendly_name %> Service</String> + <String Id="ServiceDescription">Runs <%= friendly_name %> on regular, configurable intervals.</String> + <String Id="FeatureMainName"><%= friendly_name %></String> + <String Id="FeatureServiceName"><%= friendly_name %> Service</String> + <String Id="FeaturePSModuleName"><%= friendly_name %> PowerShell wrappers</String> + + <String Id="MinimumOSVersionMessage">This package requires minimum OS version: Windows 7/Windows Server 2008 R2 or greater.</String> + <String Id="DowngradeErrorMessage">A newer version of [ProductName] is already installed.</String> + <String Id="FileExtractionProgress">Extracting files, please wait...</String> +</WixLocalization> diff --git a/omnibus/resources/chef/msi/parameters.wxi.erb b/omnibus/resources/chef/msi/parameters.wxi.erb new file mode 100644 index 0000000000..febd1738e2 --- /dev/null +++ b/omnibus/resources/chef/msi/parameters.wxi.erb @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<Include> + <?define VersionNumber="<%= version %>" ?> + <?define DisplayVersionNumber="<%= display_version %>" ?> + <?define UpgradeCode="<%= upgrade_code %>" ?> +<% parameters.each do |key, value| -%> + <?define <%= key %>="<%= value %>" ?> +<% end -%> +</Include> diff --git a/omnibus/resources/chef/msi/source.wxs.erb b/omnibus/resources/chef/msi/source.wxs.erb new file mode 100644 index 0000000000..d9c05127ed --- /dev/null +++ b/omnibus/resources/chef/msi/source.wxs.erb @@ -0,0 +1,171 @@ +<?xml version='1.0'?> +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> + + <!-- This is how we include wxi files --> + <?include "parameters.wxi" ?> + + <!-- + Id="*" is to enable upgrading. * means that the product ID will be autogenerated on each build. + Name is made of localized product name and version number. + --> + <Product Id="*" Name="!(loc.ProductName) v$(var.DisplayVersionNumber)" Language="!(loc.LANG)" + Version="$(var.VersionNumber)" Manufacturer="!(loc.ManufacturerName)" UpgradeCode="$(var.UpgradeCode)"> + + <!-- + Define the minimum supported installer version (2.0). + The install should be done for the whole machine not just the current user + --> + <Package InstallerVersion="200" InstallPrivileges="elevated" + Compressed="yes" InstallScope="perMachine" /> + + <Media Id="1" Cabinet="ChefClient.cab" EmbedCab="yes" CompressionLevel="high" /> + + <!-- + Uncomment launch condition below to check for minimum OS + 601 = Windows 7/Server 2008R2. + --> + <!-- Condition Message="!(loc.MinimumOSVersionMessage)"> + <![CDATA[Installed OR VersionNT >= 601]]> + </Condition --> + + <!-- We always do Major upgrades --> + <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" /> + + <!-- + If fastmsi is set, custom actions will be invoked during install to unzip + project files, and during uninstall to remove the project folder + --> + <% if fastmsi %> + <SetProperty Id="FastUnzip" + Value="FASTZIPDIR=[INSTALLLOCATION];FASTZIPAPPNAME=$(var.ProjectLocationDir)" + Sequence="execute" + Before="FastUnzip" /> + + <CustomAction Id="FastUnzip" + BinaryKey="CustomActionFastMsiDLL" + DllEntry="FastUnzip" + Execute="deferred" + Impersonate="no" + Return="check" /> + + <Binary Id="CustomActionFastMsiDLL" + SourceFile="CustomActionFastMsi.CA.dll" /> + + <CustomAction Id="Cleanup" + Directory="INSTALLLOCATION" + ExeCommand="cmd /C "rd /S /Q $(var.ProjectLocationDir)"" + Execute="deferred" + Impersonate="no" + Return="ignore" /> + + <InstallExecuteSequence> + <Custom Action="FastUnzip" After="InstallFiles">NOT Installed</Custom> + <Custom Action="Cleanup" After="RemoveFiles">REMOVE~="ALL"</Custom> + </InstallExecuteSequence> + + <UI> + <ProgressText Action="FastUnzip">!(loc.FileExtractionProgress)</ProgressText> + </UI> + <% end %> + + <Directory Id="TARGETDIR" Name="SourceDir"> + <Directory Id="WindowsVolume"> + <!-- Service needs chef directory to be present. --> + <Directory Id="CONFIGLOCATION" Name="chef"> + <Component Id="CONFIGLOCATIONDIR" Guid="{F66F6394-51A4-4C5D-908B-E55584473436}" > + <CreateFolder Directory="CONFIGLOCATION" /> + </Component> + </Directory> + <Directory Id="INSTALLLOCATION" Name="opscode"> + <Directory Id="PROJECTLOCATION" Name="$(var.ProjectLocationDir)" > + <Directory Id="PROJECTLOCATIONBIN" Name="bin" > + <Component Id="ChefClientPath" Guid="{7F663F88-55A2-4E20-82BF-8BD2E60BB83A}" > + <Environment Id="ClientPathEnvironment" + Name="PATH" Action="set" Part="last" System="yes" Value="[PROJECTLOCATIONBIN]" /> + </Component> + </Directory> + <Directory Id="PSMODULES" Name="modules" > + <Component Id="ChefPSModulePath" Guid="{357DA654-F02E-430A-9EA6-A10554E3EF38}" > + <Environment Id="ChefPSModulePathEnvironment" + Name="PSModulePath" Action="set" Part="last" System="yes" Value="[PSMODULES]" /> + </Component> + </Directory> + <Directory Id="EMBEDDED" Name="embedded" > + <Directory Id="EMBEDDEDBIN" Name="bin" > + <Component Id="ChefClientService" Guid="{69B2D8BE-4A47-4BE3-AEE8-83FAEB6E2FAF}" > + <File Id="RubyExecutable" Source="$(var.ProjectSourceDir)\embedded\bin\ruby.exe" KeyPath="yes" /> + <ServiceInstall Name="chef-client" Type="ownProcess" + Start="auto" Vital="yes" ErrorControl="ignore" + Arguments="$(var.ProjectSourceDir)\bin\chef-windows-service" + DisplayName="!(loc.ServiceDisplayName)" + Description="!(loc.ServiceDescription)"> + <ServiceDependency Id="Winmgmt" /> + <ServiceConfig DelayedAutoStart="yes" OnInstall="yes" /> + </ServiceInstall> + <ServiceControl Id="ControlChefClientService" Name="chef-client" + Remove="both" Stop="both" Wait="yes" /> + </Component> + <Component Id="ChefClientLog" Guid="{8e492d59-3a0c-43fd-b889-e35dfa33da91}"> + <util:EventSource xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" + Name="Chef" Log="Application" + EventMessageFile="[PROJECTLOCATION]$(var.ChefLogDllPath)" + /> + </Component> + </Directory> + </Directory> + </Directory> + </Directory> + </Directory> + </Directory> + + <!-- Set the components defined in our fragment files that will be used for our feature --> + <Feature Id="ChefClientFeature" Title="!(loc.FeatureMainName)" Absent="disallow" AllowAdvertise="no" Level="1" ConfigurableDirectory="INSTALLLOCATION"> + <ComponentGroupRef Id="ProjectDir" /> + <ComponentRef Id="ChefClientPath" /> + <ComponentRef Id="CONFIGLOCATIONDIR" /> + <ComponentRef Id="ChefClientLog" /> + </Feature> + + <Feature Id="ChefPSModuleFeature" Title="!(loc.FeaturePSModuleName)" Level="1000" AllowAdvertise="no"> + <ComponentRef Id="ChefPSModulePath" /> + </Feature> + + <Feature Id="ChefServiceFeature" Title="!(loc.FeatureServiceName)" Level="1000" AllowAdvertise="no"> + <ComponentRef Id="ChefClientService" /> + </Feature> + + <!-- + TODO: + + * create initial Client config? ie C:\chef\client.rb? + * optionally install extra tools? ie git? + + --> + + <!-- + UI Stuff + --> + <Icon Id="oc.ico" SourceFile="Resources\assets\oc_16x16.ico"/> + <Property Id="ARPPRODUCTICON" Value="oc.ico" /> + <Property Id="ARPHELPLINK" Value="http://www.getchef.com/support/" /> + <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" /> + + <UIRef Id="ChefClientUI_InstallDir"/> + <UI Id="ChefClientUI_InstallDir"> + <UIRef Id="WixUI_FeatureTree"/> + <TextStyle Id="WixUI_Font_Normal_White" FaceName="Tahoma" Size="8" Red="255" Green="255" Blue="255" /> + <TextStyle Id="WixUI_Font_Bigger_White" FaceName="Tahoma" Size="12" Red="255" Green="255" Blue="255" /> + <TextStyle Id="WixUI_Font_Title_White" FaceName="Tahoma" Size="9" Bold="yes" Red="255" Green="255" Blue="255" /> + </UI> + + <WixVariable Id="WixUILicenseRtf" Value="Resources\assets\LICENSE.rtf" /> + <WixVariable Id="WixUIDialogBmp" Value="Resources\assets\dialog_background.bmp" /> + <WixVariable Id="WixUIBannerBmp" Value="Resources\assets\banner_background.bmp" /> + + <WixVariable Id="WixUIExclamationIco" Value="Resources\assets\oc_32x32.ico" /> + <WixVariable Id="WixUIInfoIco" Value="Resources\assets\oc_32x32.ico" /> + <WixVariable Id="WixUINewIco" Value="Resources\assets\oc_16x16.ico" /> + <WixVariable Id="WixUIUpIco" Value="Resources\assets\oc_16x16.ico" /> + + </Product> +</Wix> diff --git a/omnibus/resources/chef/pkg/background.png b/omnibus/resources/chef/pkg/background.png Binary files differnew file mode 100644 index 0000000000..027453ab8c --- /dev/null +++ b/omnibus/resources/chef/pkg/background.png diff --git a/omnibus/resources/chef/pkg/license.html.erb b/omnibus/resources/chef/pkg/license.html.erb new file mode 100644 index 0000000000..21b7991abf --- /dev/null +++ b/omnibus/resources/chef/pkg/license.html.erb @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright <%= Time.new.year %> 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. diff --git a/omnibus/resources/chef/pkg/welcome.html.erb b/omnibus/resources/chef/pkg/welcome.html.erb new file mode 100644 index 0000000000..04a02fb225 --- /dev/null +++ b/omnibus/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/omnibus/resources/chefdk/dmg/background.png b/omnibus/resources/chefdk/dmg/background.png Binary files differnew file mode 100644 index 0000000000..82c605ae51 --- /dev/null +++ b/omnibus/resources/chefdk/dmg/background.png diff --git a/omnibus/resources/chefdk/dmg/icon.png b/omnibus/resources/chefdk/dmg/icon.png Binary files differnew file mode 100644 index 0000000000..b65c309660 --- /dev/null +++ b/omnibus/resources/chefdk/dmg/icon.png diff --git a/omnibus/resources/chefdk/msi/assets/LICENSE.rtf b/omnibus/resources/chefdk/msi/assets/LICENSE.rtf new file mode 100644 index 0000000000..b18e6f59b8 --- /dev/null +++ b/omnibus/resources/chefdk/msi/assets/LICENSE.rtf @@ -0,0 +1,197 @@ +{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}} + +{\*\generator Msftedit 5.41.21.2500;}\viewkind4\uc1\pard\qc\lang1033\f0\fs20 Apache License\par + +Version 2.0, January 2004\par + +http://www.apache.org/licenses/\par + +\pard\par + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\par + +\par + +1. Definitions.\par + +\par + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\par + +\par + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\par + +\par + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\par + +\par + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.\par + +\par + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation, source, and configuration files.\par + +\par + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\par + +\par + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\par + +\par + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\par + +\par + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."\par + +\par + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\par + +\par + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\par + +\par + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license plies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\par + +\par + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\par + +\par + + (a) You must give any other recipients of the Work or\par + + Derivative Works a copy of this License; and\par + +\par + + (b) You must cause any modified files to carry prominent notices\par + + stating that You changed the files; and\par + +\par + + (c) You must retain, in the Source form of any Derivative Works\par + + that You distribute, all copyright, patent, trademark, and\par + + attribution notices from the Source form of the Work,\par + + excluding those notices that do not pertain to any part of\par + + the Derivative Works; and\par + +\par + + (d) If the Work includes a "NOTICE" text file as part of its\par + + distribution, then any Derivative Works that You distribute\par + + must include a readable copy of the attribution notices\par + + contained within such NOTICE file, excluding those notices\par + + that do not pertain to any part of the Derivative Works, in\par + + at least one of the following places: within a NOTICE text\par + + file distributed as part of the Derivative Works; within the\par + + Source form or documentation, if provided along with the\par + + Derivative Works; or, within a display generated by the\par + + Derivative Works, if and wherever such third-party notices\par + + normally appear. The contents of the NOTICE file are for\par + + informational purposes only and do not modify the License.\par + + You may add Your own attribution notices within Derivative\par + + Works that You distribute, alongside or as an addendum to the\par + + NOTICE text from the Work, provided that such additional\par + + attribution notices cannot be construed as modifying the\par + + License.\par + +\par + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\par + +\par + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\par + +\par + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\par + +\par + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\par + +\par + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\par + +\par + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\par + +\par + +END OF TERMS AND CONDITIONS\par + +\par + +APPENDIX: How to apply the Apache License to your work.\par + +\par + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.\par + +\par + + Copyright [yyyy] [name of copyright owner]\par + +\par + + Licensed under the Apache License, Version 2.0 (the "License");\par + + you may not use this file except in compliance with the License.\par + + You may obtain a copy of the License at\par + +\par + + http://www.apache.org/licenses/LICENSE-2.0\par + +\par + + Unless required by applicable law or agreed to in writing, software\par + + distributed under the License is distributed on an "AS IS" BASIS,\par + + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\par + + implied. See the License for the specific language governing\par + + permissions and limitations under the License.\par + +\par + +} + + diff --git a/omnibus/resources/chefdk/msi/assets/banner_background.bmp b/omnibus/resources/chefdk/msi/assets/banner_background.bmp Binary files differnew file mode 100644 index 0000000000..c292286eba --- /dev/null +++ b/omnibus/resources/chefdk/msi/assets/banner_background.bmp diff --git a/omnibus/resources/chefdk/msi/assets/dialog_background.bmp b/omnibus/resources/chefdk/msi/assets/dialog_background.bmp Binary files differnew file mode 100644 index 0000000000..ff0c0cc957 --- /dev/null +++ b/omnibus/resources/chefdk/msi/assets/dialog_background.bmp diff --git a/omnibus/resources/chefdk/msi/assets/oc.ico b/omnibus/resources/chefdk/msi/assets/oc.ico Binary files differnew file mode 100644 index 0000000000..c4cee7bd75 --- /dev/null +++ b/omnibus/resources/chefdk/msi/assets/oc.ico diff --git a/omnibus/resources/chefdk/msi/assets/oc_16x16.ico b/omnibus/resources/chefdk/msi/assets/oc_16x16.ico Binary files differnew file mode 100644 index 0000000000..d3bd065a6a --- /dev/null +++ b/omnibus/resources/chefdk/msi/assets/oc_16x16.ico diff --git a/omnibus/resources/chefdk/msi/assets/oc_32x32.ico b/omnibus/resources/chefdk/msi/assets/oc_32x32.ico Binary files differnew file mode 100644 index 0000000000..5eee0042c3 --- /dev/null +++ b/omnibus/resources/chefdk/msi/assets/oc_32x32.ico diff --git a/omnibus/resources/chefdk/msi/assets/start-chefdk.ps1 b/omnibus/resources/chefdk/msi/assets/start-chefdk.ps1 new file mode 100644 index 0000000000..333c0c8a22 --- /dev/null +++ b/omnibus/resources/chefdk/msi/assets/start-chefdk.ps1 @@ -0,0 +1,31 @@ +Try { + $conemulocation = "$env:programfiles\ConEmu\Conemu64.exe" + # We don't want the current path to affect which "chef shell-init powershell" we run, so we need to set the PATH to include the current omnibus. + $chefdk_bin = (split-path $MyInvocation.MyCommand.Definition -Parent) + $chefdkinit = '"$env:PATH = ''' + $chefdk_bin + ';'' + $env:PATH; $env:CHEFDK_ENV_FIX = 1; chef shell-init powershell | out-string | iex; Import-Module chef -DisableNameChecking"' + $chefdkgreeting = "echo 'PowerShell $($PSVersionTable.psversion.tostring()) ($([System.Environment]::OSVersion.VersionString))';write-host -foregroundcolor darkyellow 'Ohai, welcome to ChefDK!`n'" + $chefdkcommand = "$chefdkinit;$chefdkgreeting" + $identity = [Security.Principal.WindowsIdentity]::GetCurrent() + $principal = [Security.Principal.WindowsPrincipal] $identity + $titleprefix = "" + if($principal.IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) + { + $titleprefix = "Administrator: " + } + + $chefdktitle = "$($titleprefix)ChefDK ($env:username)" + + if ( test-path $conemulocation ) + { + start-process $conemulocation -argumentlist '/title',"`"$chefdktitle`"",'/cmd','powershell.exe','-noexit','-command',$chefdkcommand + } + else + { + start-process powershell.exe -argumentlist '-noexit','-command',"$chefdkcommand; (get-host).ui.rawui.windowtitle = '$chefdktitle'" + } +} +Catch +{ + sleep 10 + Throw +} diff --git a/omnibus/resources/chefdk/msi/localization-en-us.wxl.erb b/omnibus/resources/chefdk/msi/localization-en-us.wxl.erb new file mode 100644 index 0000000000..cb01ee8763 --- /dev/null +++ b/omnibus/resources/chefdk/msi/localization-en-us.wxl.erb @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization"> + <!-- http://wix.codeplex.com/SourceControl/changeset/view/792e101c5cf7#src%2fext%2fUIExtension%2fwixlib%2fWixUI_en-us.wxl --> + <String Id="LANG">1033</String> + <String Id="ProductName"><%= friendly_name %></String> + <String Id="ManufacturerName"><%= maintainer.encode(:xml => :attr) %></String> + <String Id="WelcomeDlgTitle">{\WixUI_Font_Bigger}Welcome to the [ProductName] Setup Wizard</String> + + <String Id="LicenseAgreementDlgTitle">{\WixUI_Font_Title_White}End-User License Agreement</String> + <String Id="LicenseAgreementDlgDescription">{\WixUI_Font_Normal_White}Please read the following license agreement carefully</String> + + <String Id="InstallDirDlgTitle">{\WixUI_Font_Title_White}Destination Folder</String> + <String Id="InstallDirDlgDescription">{\WixUI_Font_Normal_White}Click Next to install to the default folder or click Change to choose another.</String> + + <String Id="ProgressDlgTitleInstalling">{\WixUI_Font_Title_White}Installing [ProductName]</String> + + <String Id="VerifyReadyDlgInstallTitle">{\WixUI_Font_Title_White}Ready to install [ProductName]</String> + + <String Id="FeatureMainName"><%= friendly_name %></String> + <String Id="FeaturePSModuleName"><%= friendly_name %> PowerShell wrappers</String> + <String Id="FeatureChefDkEnvHacks">ChefDK Environment Customizations</String> + <String Id="FeatureChefDkEnvHacksDesc">Allows ChefDK to try to find a suitable HOME drive when running Ruby programs.</String> + + <String Id="ChefDkShortcutDefName"><%= friendly_name %></String> + <String Id="ChefDkShortcutDefDescription"><%= friendly_name %> Command Prompt</String> + + <String Id="FeatureChefDkStartMenuShortcut">Start Menu Shortcut</String> + <String Id="FeatureChefDkStartMenuShortcutDescription">Install a ChefDK shortcut on the user's Start Menu.</String> + <String Id="FeatureChefDkDesktopShortcut">Desktop Shortcut</String> + <String Id="FeatureChefDkDesktopShortcutDescription">Install a ChefDK shortcut on the user's Desktop.</String> + + <String Id="MinimumOSVersionMessage">This package requires minimum OS version: Windows 7/Windows Server 2008 R2 or greater.</String> + <String Id="DowngradeErrorMessage">A newer version of [ProductName] is already installed.</String> + <String Id="FileExtractionProgress">Extracting files, please wait...</String> +</WixLocalization> diff --git a/omnibus/resources/chefdk/msi/parameters.wxi.erb b/omnibus/resources/chefdk/msi/parameters.wxi.erb new file mode 100644 index 0000000000..febd1738e2 --- /dev/null +++ b/omnibus/resources/chefdk/msi/parameters.wxi.erb @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<Include> + <?define VersionNumber="<%= version %>" ?> + <?define DisplayVersionNumber="<%= display_version %>" ?> + <?define UpgradeCode="<%= upgrade_code %>" ?> +<% parameters.each do |key, value| -%> + <?define <%= key %>="<%= value %>" ?> +<% end -%> +</Include> diff --git a/omnibus/resources/chefdk/msi/source.wxs.erb b/omnibus/resources/chefdk/msi/source.wxs.erb new file mode 100644 index 0000000000..6ba97460ee --- /dev/null +++ b/omnibus/resources/chefdk/msi/source.wxs.erb @@ -0,0 +1,177 @@ +<?xml version="1.0" encoding="utf-8"?> +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> + + <!-- This is how we include wxi files --> + <?include "parameters.wxi" ?> + + <!-- + Id="*" is to enable upgrading. * means that the product ID will be autogenerated on each build. + Name is made of localized product name and version number. + --> + <Product Id="*" Name="!(loc.ProductName) v$(var.DisplayVersionNumber)" Language="!(loc.LANG)" + Version="$(var.VersionNumber)" Manufacturer="!(loc.ManufacturerName)" UpgradeCode="$(var.UpgradeCode)"> + + <!-- + Minimum installer version (2.0) - Window XP and above. + The install scope is per machine, not the current user + --> + <Package InstallerVersion="200" InstallPrivileges="elevated" + Compressed="yes" InstallScope="perMachine" /> + + <Media Id="1" Cabinet="ChefClient.cab" EmbedCab="yes" CompressionLevel="high" /> + + <!-- + Uncomment launch condition below to check for minimum OS + 601 = Windows 7/Server 2008R2. + --> + <!-- Condition Message="!(loc.MinimumOSVersionMessage)"> + <![CDATA[Installed OR VersionNT >= 601]]> + </Condition --> + + <!-- We always do Major upgrades --> + <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" /> + + <!-- + If fastmsi is set, custom actions will be invoked during install to unzip + project files, and during uninstall to remove the project folder + --> + <% if fastmsi %> + <SetProperty Id="FastUnzip" + Value="FASTZIPDIR=[INSTALLLOCATION];FASTZIPAPPNAME=chefdk" + Sequence="execute" + Before="FastUnzip" /> + + <CustomAction Id="FastUnzip" + BinaryKey="CustomActionFastMsiDLL" + DllEntry="FastUnzip" + Execute="deferred" + Impersonate="no" + Return="check" /> + + <Binary Id="CustomActionFastMsiDLL" + SourceFile="CustomActionFastMsi.CA.dll" /> + + <CustomAction Id="Cleanup" + Directory="INSTALLLOCATION" + ExeCommand="cmd /C "rd /S /Q chefdk"" + Execute="deferred" + Impersonate="no" + Return="ignore" /> + + <InstallExecuteSequence> + <Custom Action="FastUnzip" After="InstallFiles">NOT Installed</Custom> + <Custom Action="Cleanup" After="RemoveFiles">REMOVE~="ALL"</Custom> + </InstallExecuteSequence> + + <UI> + <ProgressText Action="FastUnzip">!(loc.FileExtractionProgress)</ProgressText> + </UI> + <% end %> + + <CustomActionRef Id="WixBroadcastSettingChange" /> + <CustomActionRef Id="WixBroadcastEnvironmentChange" /> + + <Directory Id="TARGETDIR" Name="SourceDir"> + <Directory Id="WindowsVolume"> + <Directory Id="INSTALLLOCATION" Name="opscode"> + <Directory Id="PROJECTLOCATION" Name="chefdk" > + <Directory Id="PROJECTLOCATIONBIN" Name="bin" > + <Component Id="ChefDkPath" Guid="{AEA5727E-DAD2-48CC-ADB8-38DD0EB46C62}" > + <Environment Id="Environment" + Name="PATH" Action="set" Part="last" System="yes" Value="[PROJECTLOCATIONBIN]" /> + </Component> + <Component Id="StartChefDk" Guid="{A8378BA1-85D7-4F11-B1C0-52BF84B4730A}" > + <File Id="StartChefDkScript" Source="Resources\assets\start-chefdk.ps1" KeyPath="yes" /> + </Component> + </Directory> + <Directory Id="PSMODULES" Name="modules" > + <Component Id="ChefPSModulePath" Guid="{DCD34ACB-7DAF-481F-B36F-8CD27AB5028D}" > + <Environment Id="ChefPSModulePathEnvironment" + Name="PSModulePath" Action="set" Part="last" System="yes" Value="[PSMODULES]" /> + </Component> + </Directory> + <Directory Id="EMBEDDED" Name="embedded" > + <Directory Id="EMBEDDEDBIN" Name="bin" > + <Component Id="ChefDkEnvHacks" Guid="{830aa603-a412-437f-87c6-d0cb88ebdd40}" > + <Environment Id="EnvHacksEnvironment" + Name="CHEFDK_ENV_FIX" Action="set" System="yes" Value="1" /> + </Component> + </Directory> + </Directory> + </Directory> + </Directory> + </Directory> + + <Directory Id="ProgramMenuFolder"> + <Component Id="StartMenuShortcut" Guid="{6DD3FFF3-E009-40E7-B1C2-EF606B941CCD}"> + <Shortcut Id="StartMenuShortcutDef" + Name="!(loc.ChefDkShortcutDefName)" + Description="!(loc.ChefDkShortcutDefDescription)" + Target="[WindowsFolder]\System32\WindowsPowerShell\v1.0\powershell.exe" + Arguments="-ExecutionPolicy Bypass -File [#StartChefDkScript]" + Icon="oc.ico"/> + </Component> + </Directory> + + <Directory Id="DesktopFolder" Name="Desktop"> + <Component Id="DesktopShortcut" Guid="{396E22A6-A7B6-4AA1-B63C-83A3DD7007A8}"> + <Shortcut Id="DesktopShortcutDef" + Name="!(loc.ChefDkShortcutDefName)" + Description="!(loc.ChefDkShortcutDefDescription)" + Target="[WindowsFolder]\System32\WindowsPowerShell\v1.0\powershell.exe" + Arguments="-ExecutionPolicy Bypass -File [#StartChefDkScript]" + Icon="oc.ico"/> + </Component> + </Directory> + </Directory> + + <!-- Set the components defined in our fragment files that will be used for our feature --> + <Feature Id="ChefDkFeature" Title="!(loc.FeatureMainName)" Absent="disallow" AllowAdvertise="no" Level="1" ConfigurableDirectory="INSTALLLOCATION"> + <ComponentGroupRef Id="ProjectDir" /> + <ComponentRef Id="ChefDkPath" /> + <ComponentRef Id="ChefPSModulePath" /> + </Feature> + + <Feature Id="ChefDkStartMenuShortcutFeature" Title="!(loc.FeatureChefDkStartMenuShortcut)" Description="!(loc.FeatureChefDkStartMenuShortcutDescription)" Level="1" AllowAdvertise="no" > + <ComponentRef Id="StartChefDk" /> + <ComponentRef Id="StartMenuShortcut" /> + </Feature> + + <Feature Id="ChefDkDesktopShortcutFeature" Title="!(loc.FeatureChefDkDesktopShortcut)" Description="!(loc.FeatureChefDkDesktopShortcutDescription)" Level="1" AllowAdvertise="no" > + <ComponentRef Id="StartChefDk" /> + <ComponentRef Id="DesktopShortcut" /> + </Feature> + + <Feature Id="ChefDkEnvHacks" Title="!(loc.FeatureChefDkEnvHacks)" Description="!(loc.FeatureChefDkEnvHacksDesc)" Level="1000" AllowAdvertise="no"> + <ComponentRef Id="ChefDkEnvHacks" /> + </Feature> + + <!-- + UI Stuff + --> + <Icon Id="oc16.ico" SourceFile="Resources\assets\oc_16x16.ico"/> + <Icon Id="oc32.ico" SourceFile="Resources\assets\oc_32x32.ico"/> + <Icon Id="oc.ico" SourceFile="Resources\assets\oc.ico"/> + <Property Id="ARPPRODUCTICON" Value="oc16.ico" /> + <Property Id="ARPHELPLINK" Value="http://www.getchef.com/support/" /> + <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" /> + + <UIRef Id="ChefDkUI_InstallDir"/> + <UI Id="ChefDkUI_InstallDir"> + <UIRef Id="WixUI_FeatureTree"/> + <TextStyle Id="WixUI_Font_Normal_White" FaceName="Tahoma" Size="8" Red="255" Green="255" Blue="255" /> + <TextStyle Id="WixUI_Font_Bigger_White" FaceName="Tahoma" Size="12" Red="255" Green="255" Blue="255" /> + <TextStyle Id="WixUI_Font_Title_White" FaceName="Tahoma" Size="9" Bold="yes" Red="255" Green="255" Blue="255" /> + </UI> + + <WixVariable Id="WixUILicenseRtf" Value="Resources\assets\LICENSE.rtf" /> + <WixVariable Id="WixUIDialogBmp" Value="Resources\assets\dialog_background.bmp" /> + <WixVariable Id="WixUIBannerBmp" Value="Resources\assets\banner_background.bmp" /> + + <WixVariable Id="WixUIExclamationIco" Value="Resources\assets\oc_32x32.ico" /> + <WixVariable Id="WixUIInfoIco" Value="Resources\assets\oc_32x32.ico" /> + <WixVariable Id="WixUINewIco" Value="Resources\assets\oc_16x16.ico" /> + <WixVariable Id="WixUIUpIco" Value="Resources\assets\oc_16x16.ico" /> + + </Product> +</Wix> diff --git a/omnibus/resources/chefdk/pkg/background.png b/omnibus/resources/chefdk/pkg/background.png Binary files differnew file mode 100644 index 0000000000..027453ab8c --- /dev/null +++ b/omnibus/resources/chefdk/pkg/background.png diff --git a/omnibus/resources/chefdk/pkg/license.html.erb b/omnibus/resources/chefdk/pkg/license.html.erb new file mode 100644 index 0000000000..21b7991abf --- /dev/null +++ b/omnibus/resources/chefdk/pkg/license.html.erb @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright <%= Time.new.year %> 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. diff --git a/omnibus/resources/chefdk/pkg/welcome.html.erb b/omnibus/resources/chefdk/pkg/welcome.html.erb new file mode 100644 index 0000000000..04a02fb225 --- /dev/null +++ b/omnibus/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/omnibus/resources/push-jobs-client/dmg/background.png b/omnibus/resources/push-jobs-client/dmg/background.png Binary files differnew file mode 100644 index 0000000000..82c605ae51 --- /dev/null +++ b/omnibus/resources/push-jobs-client/dmg/background.png diff --git a/omnibus/resources/push-jobs-client/dmg/icon.png b/omnibus/resources/push-jobs-client/dmg/icon.png Binary files differnew file mode 100644 index 0000000000..b65c309660 --- /dev/null +++ b/omnibus/resources/push-jobs-client/dmg/icon.png diff --git a/omnibus/resources/push-jobs-client/msi/assets/LICENSE.rtf b/omnibus/resources/push-jobs-client/msi/assets/LICENSE.rtf new file mode 100644 index 0000000000..b18e6f59b8 --- /dev/null +++ b/omnibus/resources/push-jobs-client/msi/assets/LICENSE.rtf @@ -0,0 +1,197 @@ +{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}} + +{\*\generator Msftedit 5.41.21.2500;}\viewkind4\uc1\pard\qc\lang1033\f0\fs20 Apache License\par + +Version 2.0, January 2004\par + +http://www.apache.org/licenses/\par + +\pard\par + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\par + +\par + +1. Definitions.\par + +\par + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\par + +\par + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\par + +\par + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\par + +\par + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.\par + +\par + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation, source, and configuration files.\par + +\par + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\par + +\par + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\par + +\par + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\par + +\par + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."\par + +\par + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\par + +\par + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\par + +\par + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license plies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\par + +\par + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\par + +\par + + (a) You must give any other recipients of the Work or\par + + Derivative Works a copy of this License; and\par + +\par + + (b) You must cause any modified files to carry prominent notices\par + + stating that You changed the files; and\par + +\par + + (c) You must retain, in the Source form of any Derivative Works\par + + that You distribute, all copyright, patent, trademark, and\par + + attribution notices from the Source form of the Work,\par + + excluding those notices that do not pertain to any part of\par + + the Derivative Works; and\par + +\par + + (d) If the Work includes a "NOTICE" text file as part of its\par + + distribution, then any Derivative Works that You distribute\par + + must include a readable copy of the attribution notices\par + + contained within such NOTICE file, excluding those notices\par + + that do not pertain to any part of the Derivative Works, in\par + + at least one of the following places: within a NOTICE text\par + + file distributed as part of the Derivative Works; within the\par + + Source form or documentation, if provided along with the\par + + Derivative Works; or, within a display generated by the\par + + Derivative Works, if and wherever such third-party notices\par + + normally appear. The contents of the NOTICE file are for\par + + informational purposes only and do not modify the License.\par + + You may add Your own attribution notices within Derivative\par + + Works that You distribute, alongside or as an addendum to the\par + + NOTICE text from the Work, provided that such additional\par + + attribution notices cannot be construed as modifying the\par + + License.\par + +\par + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\par + +\par + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\par + +\par + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\par + +\par + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\par + +\par + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\par + +\par + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\par + +\par + +END OF TERMS AND CONDITIONS\par + +\par + +APPENDIX: How to apply the Apache License to your work.\par + +\par + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.\par + +\par + + Copyright [yyyy] [name of copyright owner]\par + +\par + + Licensed under the Apache License, Version 2.0 (the "License");\par + + you may not use this file except in compliance with the License.\par + + You may obtain a copy of the License at\par + +\par + + http://www.apache.org/licenses/LICENSE-2.0\par + +\par + + Unless required by applicable law or agreed to in writing, software\par + + distributed under the License is distributed on an "AS IS" BASIS,\par + + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\par + + implied. See the License for the specific language governing\par + + permissions and limitations under the License.\par + +\par + +} + + diff --git a/omnibus/resources/push-jobs-client/msi/assets/banner_background.bmp b/omnibus/resources/push-jobs-client/msi/assets/banner_background.bmp Binary files differnew file mode 100644 index 0000000000..5769a883c3 --- /dev/null +++ b/omnibus/resources/push-jobs-client/msi/assets/banner_background.bmp diff --git a/omnibus/resources/push-jobs-client/msi/assets/dialog_background.bmp b/omnibus/resources/push-jobs-client/msi/assets/dialog_background.bmp Binary files differnew file mode 100644 index 0000000000..4dbe489e9c --- /dev/null +++ b/omnibus/resources/push-jobs-client/msi/assets/dialog_background.bmp diff --git a/omnibus/resources/push-jobs-client/msi/assets/oc.ico b/omnibus/resources/push-jobs-client/msi/assets/oc.ico Binary files differnew file mode 100644 index 0000000000..c4cee7bd75 --- /dev/null +++ b/omnibus/resources/push-jobs-client/msi/assets/oc.ico diff --git a/omnibus/resources/push-jobs-client/msi/assets/oc_16x16.ico b/omnibus/resources/push-jobs-client/msi/assets/oc_16x16.ico Binary files differnew file mode 100644 index 0000000000..d3bd065a6a --- /dev/null +++ b/omnibus/resources/push-jobs-client/msi/assets/oc_16x16.ico diff --git a/omnibus/resources/push-jobs-client/msi/assets/oc_32x32.ico b/omnibus/resources/push-jobs-client/msi/assets/oc_32x32.ico Binary files differnew file mode 100644 index 0000000000..5eee0042c3 --- /dev/null +++ b/omnibus/resources/push-jobs-client/msi/assets/oc_32x32.ico diff --git a/omnibus/resources/push-jobs-client/msi/localization-en-us.wxl.erb b/omnibus/resources/push-jobs-client/msi/localization-en-us.wxl.erb new file mode 100644 index 0000000000..f1deb3df79 --- /dev/null +++ b/omnibus/resources/push-jobs-client/msi/localization-en-us.wxl.erb @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization"> + <!-- http://wix.codeplex.com/SourceControl/changeset/view/792e101c5cf7#src%2fext%2fUIExtension%2fwixlib%2fWixUI_en-us.wxl --> + <String Id="LANG">1033</String> + <String Id="ProductName"><%= friendly_name %></String> + <String Id="ManufacturerName"><%= maintainer.encode(:xml => :attr) %></String> + <String Id="WelcomeDlgTitle">{\WixUI_Font_Bigger}Welcome to the [ProductName] Setup Wizard</String> + + <String Id="LicenseAgreementDlgTitle">{\WixUI_Font_Title_White}End-User License Agreement</String> + <String Id="LicenseAgreementDlgDescription">{\WixUI_Font_Normal_White}Please read the following license agreement carefully</String> + + <String Id="InstallDirDlgTitle">{\WixUI_Font_Title_White}Destination Folder</String> + <String Id="InstallDirDlgDescription">{\WixUI_Font_Normal_White}Click Next to install to the default folder or click Change to choose another.</String> + + <String Id="ProgressDlgTitleInstalling">{\WixUI_Font_Title_White}Installing [ProductName]</String> + + <String Id="VerifyReadyDlgInstallTitle">{\WixUI_Font_Title_White}Ready to install [ProductName]</String> + + <!-- Service --> + <!-- Keep these in sync with the name and description in chef-service-manager --> + <String Id="ServiceDisplayName"><%= friendly_name %> Service</String> + <String Id="ServiceDescription">Runs <%= friendly_name %> on regular, configurable intervals.</String> + <String Id="FeatureMainName"><%= friendly_name %></String> + <String Id="FeatureServiceName"><%= friendly_name %> Service</String> +</WixLocalization> diff --git a/omnibus/resources/push-jobs-client/msi/parameters.wxi.erb b/omnibus/resources/push-jobs-client/msi/parameters.wxi.erb new file mode 100644 index 0000000000..febd1738e2 --- /dev/null +++ b/omnibus/resources/push-jobs-client/msi/parameters.wxi.erb @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<Include> + <?define VersionNumber="<%= version %>" ?> + <?define DisplayVersionNumber="<%= display_version %>" ?> + <?define UpgradeCode="<%= upgrade_code %>" ?> +<% parameters.each do |key, value| -%> + <?define <%= key %>="<%= value %>" ?> +<% end -%> +</Include> diff --git a/omnibus/resources/push-jobs-client/msi/source.wxs.erb b/omnibus/resources/push-jobs-client/msi/source.wxs.erb new file mode 100644 index 0000000000..70fe9fa179 --- /dev/null +++ b/omnibus/resources/push-jobs-client/msi/source.wxs.erb @@ -0,0 +1,100 @@ +<?xml version='1.0'?> +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> + + <!-- This is how we include wxi files --> + <?include "parameters.wxi" ?> + + <!-- + Id="*" is to enable upgrading. * means that the product ID will be autogenerated on each build. + Name is made of localized product name and version number. + --> + <Product Id="*" Name="!(loc.ProductName) v$(var.DisplayVersionNumber)" Language="!(loc.LANG)" + Version="$(var.VersionNumber)" Manufacturer="!(loc.ManufacturerName)" UpgradeCode="$(var.UpgradeCode)"> + + <!-- + Define the minimum supported installer version (2.0). + The install should be done for the whole machine not just the current user + --> + <Package InstallerVersion="200" InstallPrivileges="elevated" + Compressed="yes" InstallScope="perMachine" /> + + <Media Id="1" Cabinet="PushJobsClient.cab" EmbedCab="yes" CompressionLevel="high" /> + + <!-- Major upgrade --> + <Upgrade Id="$(var.UpgradeCode)"> + <UpgradeVersion OnlyDetect="yes" Minimum="$(var.VersionNumber)" IncludeMinimum="no" Property="NEWERVERSIONDETECTED" /> + <UpgradeVersion Minimum="0.0.0.0" IncludeMinimum="yes" Maximum="$(var.VersionNumber)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" /> + </Upgrade> + + <InstallExecuteSequence> + <RemoveExistingProducts After="InstallValidate" /> + </InstallExecuteSequence> + + <Directory Id="TARGETDIR" Name="SourceDir"> + <Directory Id="WindowsVolume"> + <!-- Service needs chef directory to be present. --> + <Directory Id="CONFIGLOCATION" Name="chef"> + <Component Id="CONFIGLOCATIONDIR" Guid="{F66F6394-51A4-4C5D-908B-E55584473436}" > + <CreateFolder Directory="CONFIGLOCATION" /> + </Component> + </Directory> + <Directory Id="INSTALLLOCATION" Name="opscode"> + <Directory Id="PROJECTLOCATION" Name="push-jobs-client" > + <Directory Id="EMBEDDED" Name="embedded" > + <Directory Id="EMBEDDEDBIN" Name="bin" > + <Component Id="PushJobsClientPath" Guid="{0F9F9EE6-CC96-463E-BE6C-1AA33266FD9F}" > + <Environment Id="Environment" + Name="PATH" Action="set" Part="last" System="yes" Value="[PROJECTLOCATION]bin" /> + </Component> + <Component Id="PushJobsClientService" Guid="{1E9F8C22-25A7-4084-9FD9-F1B4C10E62F9}" > + <File Id="RubyExecutable" Source="$(var.ProjectSourceDir)\embedded\bin\ruby.exe" KeyPath="yes" /> + <ServiceInstall Name="push-jobs-client" Type="ownProcess" + Start="auto" Vital="yes" ErrorControl="ignore" + Arguments="[PROJECTLOCATION]$(var.PushJobsGemPath)\lib\pushy_client\windows_service.rb" + DisplayName="!(loc.ServiceDisplayName)" + Description="!(loc.ServiceDescription)" /> + <ServiceControl Id="ControlPushJobsClientService" Name="push-jobs-client" + Remove="both" Start="install" Stop="both" Wait="yes" /> + </Component> + </Directory> + </Directory> + </Directory> + </Directory> + </Directory> + </Directory> + + <!-- Set the components defined in our fragment files that will be used for our feature --> + <Feature Id="PushJobsClientFeature" Title="!(loc.ProductName)" Level="1"> + <ComponentGroupRef Id="ProjectDir" /> + <ComponentRef Id="PushJobsClientPath" /> + <ComponentRef Id="CONFIGLOCATIONDIR" /> + <ComponentRef Id="PushJobsClientService" /> + </Feature> + + <!-- + UI Stuff + --> + <Icon Id="oc.ico" SourceFile="Resources\assets\oc_16x16.ico"/> + <Property Id="ARPPRODUCTICON" Value="oc.ico" /> + <Property Id="ARPHELPLINK" Value="http://www.getchef.com/support/" /> + <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" /> + + <UIRef Id="PushJobsClientUI_InstallDir"/> + <UI Id="PushJobsClientUI_InstallDir"> + <UIRef Id="WixUI_FeatureTree"/> + <TextStyle Id="WixUI_Font_Normal_White" FaceName="Tahoma" Size="8" Red="255" Green="255" Blue="255" /> + <TextStyle Id="WixUI_Font_Bigger_White" FaceName="Tahoma" Size="12" Red="255" Green="255" Blue="255" /> + <TextStyle Id="WixUI_Font_Title_White" FaceName="Tahoma" Size="9" Bold="yes" Red="255" Green="255" Blue="255" /> + </UI> + + <WixVariable Id="WixUILicenseRtf" Value="Resources\assets\LICENSE.rtf" /> + <WixVariable Id="WixUIDialogBmp" Value="Resources\assets\dialog_background.bmp" /> + <WixVariable Id="WixUIBannerBmp" Value="Resources\assets\banner_background.bmp" /> + + <WixVariable Id="WixUIExclamationIco" Value="Resources\assets\oc_32x32.ico" /> + <WixVariable Id="WixUIInfoIco" Value="Resources\assets\oc_32x32.ico" /> + <WixVariable Id="WixUINewIco" Value="Resources\assets\oc_16x16.ico" /> + <WixVariable Id="WixUIUpIco" Value="Resources\assets\oc_16x16.ico" /> + + </Product> +</Wix> diff --git a/omnibus/resources/push-jobs-client/pkg/background.png b/omnibus/resources/push-jobs-client/pkg/background.png Binary files differnew file mode 100644 index 0000000000..027453ab8c --- /dev/null +++ b/omnibus/resources/push-jobs-client/pkg/background.png diff --git a/omnibus/resources/push-jobs-client/pkg/license.html.erb b/omnibus/resources/push-jobs-client/pkg/license.html.erb new file mode 100644 index 0000000000..21b7991abf --- /dev/null +++ b/omnibus/resources/push-jobs-client/pkg/license.html.erb @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright <%= Time.new.year %> 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. diff --git a/omnibus/resources/push-jobs-client/pkg/welcome.html.erb b/omnibus/resources/push-jobs-client/pkg/welcome.html.erb new file mode 100644 index 0000000000..04a02fb225 --- /dev/null +++ b/omnibus/resources/push-jobs-client/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. |