2016-04-18 03:30:50 +00:00
|
|
|
#
|
2019-03-02 01:39:39 +00:00
|
|
|
# Copyright:: Copyright 2016-2019, Chef Software Inc.
|
2016-08-08 09:23:12 +00:00
|
|
|
# License:: Apache License, Version 2.0
|
2016-04-18 03:30:50 +00:00
|
|
|
#
|
2016-08-08 09:23:12 +00:00
|
|
|
# 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
|
2016-04-18 03:30:50 +00:00
|
|
|
#
|
2016-08-08 09:23:12 +00:00
|
|
|
# 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.
|
|
|
|
#
|
2019-06-11 22:24:35 +00:00
|
|
|
require_relative "../../../lib/inspec/version.rb"
|
2016-04-18 03:30:50 +00:00
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
name "inspec"
|
2016-04-18 03:30:50 +00:00
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
dependency "ruby"
|
2016-04-18 03:30:50 +00:00
|
|
|
|
2016-08-08 09:23:12 +00:00
|
|
|
license :project_license
|
2016-04-18 03:30:50 +00:00
|
|
|
|
2016-08-08 09:23:12 +00:00
|
|
|
default_version "v#{Inspec::VERSION}"
|
2016-04-18 03:30:50 +00:00
|
|
|
|
2016-08-08 17:41:02 +00:00
|
|
|
source path: "#{Omnibus::Config.project_root}/../",
|
2019-06-11 22:24:35 +00:00
|
|
|
options: { exclude: ["omnibus"] }
|
2016-04-18 03:30:50 +00:00
|
|
|
|
|
|
|
build do
|
|
|
|
env = with_standard_compiler_flags(with_embedded_path)
|
|
|
|
|
|
|
|
# Remove existing built gems in case they exist in the current dir
|
|
|
|
delete "#{name}-*.gem"
|
|
|
|
|
2016-08-08 09:23:12 +00:00
|
|
|
# We bundle install to ensure the versions of gems we are going to
|
|
|
|
# appbundle-lock to are definitely installed
|
2019-06-11 22:24:35 +00:00
|
|
|
bundle "install --without test integration tools maintenance", env: env
|
2016-08-08 09:23:12 +00:00
|
|
|
|
2020-01-31 21:34:32 +00:00
|
|
|
gem "build #{name}-core.gemspec", env: env
|
|
|
|
gem "install #{name}-core*.gem --no-document", env: env
|
|
|
|
|
2016-04-18 03:30:50 +00:00
|
|
|
gem "build #{name}.gemspec", env: env
|
|
|
|
gem "install #{name}-*.gem --no-document", env: env
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
gem "build inspec-bin.gemspec", env: env, cwd: "#{project_dir}/inspec-bin"
|
|
|
|
gem "install inspec-bin-*.gem --no-document", env: env, cwd: "#{project_dir}/inspec-bin"
|
2019-04-26 20:45:56 +00:00
|
|
|
|
2019-04-29 17:13:35 +00:00
|
|
|
block do
|
2020-01-31 21:34:32 +00:00
|
|
|
appbundle "inspec", lockdir: project_dir, gem: "inspec-bin", env: env
|
2019-04-26 20:45:56 +00:00
|
|
|
end
|
2019-11-19 23:02:47 +00:00
|
|
|
|
|
|
|
block "Delete test folder from problem gems" do
|
|
|
|
env["VISUAL"] = "echo"
|
|
|
|
gem_install_dir = shellout!("#{install_dir}/embedded/bin/gem open rubyzip", env: env).stdout.chomp
|
|
|
|
remove_directory "#{gem_install_dir}/test"
|
|
|
|
end
|
2016-04-18 03:30:50 +00:00
|
|
|
end
|