mirror of
https://github.com/inspec/inspec
synced 2024-11-10 07:04:15 +00:00
Improve windows support of omnibus installer - fix #889
This commit is contained in:
parent
3c389acc75
commit
ce2b0949ac
19 changed files with 680 additions and 23 deletions
1
omnibus/.gitignore
vendored
1
omnibus/.gitignore
vendored
|
@ -9,3 +9,4 @@ pkg/*
|
|||
bin/*
|
||||
files/**/cache/
|
||||
vendor/cookbooks
|
||||
Berksfile.lock
|
||||
|
|
6
omnibus/.kitchen.vmware.yml
Normal file
6
omnibus/.kitchen.vmware.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
driver:
|
||||
name: vagrant
|
||||
provider: vmware_fusion
|
||||
customize:
|
||||
numvcpus: 4
|
||||
memsize: 4096
|
|
@ -2,35 +2,89 @@ driver:
|
|||
name: vagrant
|
||||
forward_agent: yes
|
||||
customize:
|
||||
cpus: 2
|
||||
memory: 2048
|
||||
cpus: 4
|
||||
memory: 4096
|
||||
synced_folders:
|
||||
- ['..', '/home/vagrant/inspec']
|
||||
- ['../../omnibus', '/home/vagrant/omnibus']
|
||||
- ['../../omnibus-software', '/home/vagrant/omnibus-software']
|
||||
|
||||
provisioner:
|
||||
name: chef_zero
|
||||
require_chef_omnibus: true
|
||||
attributes:
|
||||
vagrant:
|
||||
this_key_exists_so_we_have_a_vagrant_key: true
|
||||
omnibus:
|
||||
build_user: vagrant
|
||||
build_user_group: vagrant
|
||||
build_user_password: vagrant
|
||||
install_dir: /opt/inspec
|
||||
|
||||
platforms:
|
||||
- name: centos-7.1
|
||||
- name: centos-7.2
|
||||
run_list: yum-epel::default
|
||||
- name: centos-6.6
|
||||
- name: centos-6.7
|
||||
run_list: yum-epel::default
|
||||
- name: debian-7.8
|
||||
- name: debian-8.2
|
||||
run_list: apt::default
|
||||
- name: debian-6.0.10
|
||||
- name: debian-7.9
|
||||
run_list: apt::default
|
||||
- name: ubuntu-14.04
|
||||
run_list: apt::default
|
||||
- name: ubuntu-12.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 #eng-services-support 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
|
||||
# by activating the `.kitchen.vmware.yml` file with the `KITCHEN_LOCAL_YAML`
|
||||
# environment variable:
|
||||
#
|
||||
# KITCHEN_LOCAL_YAML=.kitchen.vmware.yml kitchen converge inspec-macosx-109
|
||||
#
|
||||
<% %w(
|
||||
10.9
|
||||
10.10
|
||||
10.11
|
||||
).each do |mac_version| %>
|
||||
- name: macosx-<%= mac_version %>
|
||||
driver:
|
||||
box: chef/macosx-<%= mac_version %> # private
|
||||
synced_folders:
|
||||
- ['..', '/Users/vagrant/chef']
|
||||
- ['../../omnibus', '/Users/vagrant/omnibus']
|
||||
- ['../../omnibus-software', '/Users/vagrant/omnibus-software']
|
||||
<% end %>
|
||||
|
||||
# By adding an `i386` to the name the Omnibus cookbook's `load-omnibus-toolchain.bat`
|
||||
# will load the 32-bit version of the MinGW toolchain.
|
||||
<% [ '', '-i386' ].each do |win_suffix| %>
|
||||
- name: windows-2012r2-standard<%= win_suffix %>
|
||||
driver:
|
||||
box: chef/windows-server-2012r2-standard # private
|
||||
synced_folders:
|
||||
# We have to mount this repos enclosing folder as the Omnibus build
|
||||
# gets cranky if the mounted source folder is a symlink. This
|
||||
# mounts at `C:\vagrant\code` and the inspec source folder is available
|
||||
# at `C:\vagrant\code\inspec`
|
||||
- ['../..', '/vagrant/code']
|
||||
provisioner:
|
||||
attributes:
|
||||
omnibus:
|
||||
build_user: vagrant
|
||||
build_user_group: Administrators
|
||||
build_user_password: vagrant
|
||||
install_dir: /opscode/inspec
|
||||
<% end %>
|
||||
|
||||
suites:
|
||||
- name: default
|
||||
- name: inspec
|
||||
run_list: omnibus::default
|
||||
attributes:
|
||||
omnibus:
|
||||
build_user: vagrant
|
||||
build_user_group: vagrant
|
||||
build_user_password: vagrant
|
||||
install_dir: /opt/inspec
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
# Install omnibus
|
||||
gem 'omnibus', '~> 5.3'
|
||||
# Sadly due to an ongoing msys2 issue, producing windows builds requires
|
||||
# the two branches below.
|
||||
gem 'omnibus', github: 'chef/omnibus', branch: 'ksubrama/gcc_investigate'
|
||||
|
||||
# Use Chef's software definitions. It is recommended that you write your own
|
||||
# software definitions, but you can clone/fork Chef's to get you started.
|
||||
gem 'omnibus-software', github: 'chef/omnibus-software'
|
||||
gem 'omnibus-software', github: 'chef/omnibus-software', branch: 'ksubrama/ruby23'
|
||||
|
||||
# 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
|
||||
|
@ -17,6 +19,7 @@ group :development do
|
|||
gem 'berkshelf', '~> 4.3'
|
||||
|
||||
# Use Test Kitchen with Vagrant for converging the build environment
|
||||
gem 'test-kitchen', '~> 1.7'
|
||||
gem 'test-kitchen', '~> 1.9'
|
||||
gem 'kitchen-vagrant', '~> 0.19'
|
||||
gem 'winrm-fs', '~> 0.4'
|
||||
end
|
||||
|
|
|
@ -17,21 +17,53 @@
|
|||
#
|
||||
|
||||
name 'inspec'
|
||||
friendly_name 'InSpec'
|
||||
maintainer 'Chef Software, Inc <maintainers@chef.io>'
|
||||
homepage 'https://github.com/chef/inspec'
|
||||
|
||||
license 'Apache-2.0'
|
||||
license_file '../LICENSE'
|
||||
|
||||
# Defaults to C:/inspec on Windows
|
||||
# and /opt/inspec on all other platforms
|
||||
install_dir "#{default_root}/#{name}"
|
||||
# Defaults to C:/opscode/inspec on Windows
|
||||
# and /opt/inspec on all other platforms.
|
||||
if windows?
|
||||
install_dir "#{default_root}/opscode/#{name}"
|
||||
else
|
||||
install_dir "#{default_root}/#{name}"
|
||||
end
|
||||
|
||||
build_version Omnibus::BuildVersion.semver
|
||||
build_iteration 1
|
||||
|
||||
dependency 'preparation'
|
||||
|
||||
dependency 'inspec'
|
||||
|
||||
# Mark all directories world readable.
|
||||
dependency 'gem-permissions'
|
||||
# Redirect all gem bat files and rb files to point to embedded ruby.
|
||||
dependency 'shebang-cleanup'
|
||||
# Ensure our SSL cert files are accessible to ruby.
|
||||
dependency 'openssl-customization'
|
||||
# Remove all .dll.a and .a files needed for static linkage.
|
||||
dependency 'clean-static-libs'
|
||||
|
||||
package :rpm do
|
||||
signing_passphrase ENV['OMNIBUS_RPM_SIGNING_PASSPHRASE']
|
||||
end
|
||||
|
||||
package :pkg do
|
||||
identifier 'com.getchef.pkg.inspec'
|
||||
signing_identity 'Developer ID Installer: Chef Software, Inc. (EU3VF8YLX2)'
|
||||
end
|
||||
compress :dmg
|
||||
|
||||
package :msi do
|
||||
fast_msi true
|
||||
upgrade_code 'DFCD452F-31E5-4236-ACD1-253F4720250B'
|
||||
wix_light_extension 'WixUtilExtension'
|
||||
signing_identity 'F74E1A68005E8A9C465C3D2FF7B41F3988F0EA09', machine_store: true
|
||||
end
|
||||
|
||||
exclude '**/.git'
|
||||
exclude '**/bundler/git'
|
||||
|
|
|
@ -20,6 +20,7 @@ require_relative '../../../lib/inspec/version.rb'
|
|||
name 'inspec'
|
||||
|
||||
dependency 'ruby'
|
||||
dependency 'rb-readline'
|
||||
dependency 'bundler'
|
||||
dependency 'appbundler'
|
||||
|
||||
|
@ -27,7 +28,8 @@ license :project_license
|
|||
|
||||
default_version "v#{Inspec::VERSION}"
|
||||
|
||||
source path: "#{Omnibus::Config.project_root}/../"
|
||||
source path: "#{Omnibus::Config.project_root}/../",
|
||||
options: { exclude: ['omnibus'] }
|
||||
|
||||
build do
|
||||
env = with_standard_compiler_flags(with_embedded_path)
|
||||
|
@ -42,8 +44,5 @@ build do
|
|||
gem "build #{name}.gemspec", env: env
|
||||
gem "install #{name}-*.gem --no-document", env: env
|
||||
|
||||
# Dependecy added to avoid this pry error: "Sorry, you can't use Pry
|
||||
# without Readline or a compatible library."
|
||||
gem 'install rb-readline --no-document', env: env
|
||||
appbundle 'inspec'
|
||||
end
|
||||
|
|
35
omnibus/files/openssl-customization/windows/ssl_env_hack.rb
Normal file
35
omnibus/files/openssl-customization/windows/ssl_env_hack.rb
Normal file
|
@ -0,0 +1,35 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Copyright:: Copyright (c) 2016 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 Inspec. 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
|
BIN
omnibus/resources/inspec/dmg/background.png
Normal file
BIN
omnibus/resources/inspec/dmg/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
BIN
omnibus/resources/inspec/dmg/icon.png
Normal file
BIN
omnibus/resources/inspec/dmg/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.8 KiB |
197
omnibus/resources/inspec/msi/assets/LICENSE.rtf
Normal file
197
omnibus/resources/inspec/msi/assets/LICENSE.rtf
Normal file
|
@ -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
|
||||
|
||||
}
|
||||
|
||||
|