From 6584f811aa19f608793a0ecef8f5da4663f86c49 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Tue, 8 Oct 2019 22:32:34 -0700 Subject: [PATCH 1/3] Cinc Stable patches --- bin/{chef-cli => cinc-cli} | 2 +- chef-cli.gemspec | 2 +- lib/chef-cli/dist.rb | 32 ++++++++++++++++---------------- 3 files changed, 18 insertions(+), 18 deletions(-) rename bin/{chef-cli => cinc-cli} (94%) diff --git a/bin/chef-cli b/bin/cinc-cli similarity index 94% rename from bin/chef-cli rename to bin/cinc-cli index f0535f79a..1199bbad3 100755 --- a/bin/chef-cli +++ b/bin/cinc-cli @@ -22,4 +22,4 @@ Kernel.trap(:INT) { print("\n"); exit 1 } $:.unshift(File.expand_path(File.join(__dir__, "..", "lib"))) require "chef-cli/cli" -ChefCLI::CLI.new(ARGV.clone).run(enforce_license: true) +ChefCLI::CLI.new(ARGV.clone).run(enforce_license: false) diff --git a/chef-cli.gemspec b/chef-cli.gemspec index c98464dfa..eafca211c 100644 --- a/chef-cli.gemspec +++ b/chef-cli.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |gem| Dir.glob("Gemfile*") + # Includes Gemfile and locks Dir.glob("*.gemspec") + Dir.glob("{lib,spec}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) } - gem.executables = %w{ chef-cli } + gem.executables = %w{ cinc-cli } gem.test_files = gem.files.grep(%r{^spec/}) gem.require_paths = ["lib"] diff --git a/lib/chef-cli/dist.rb b/lib/chef-cli/dist.rb index ead757962..778ed6e72 100644 --- a/lib/chef-cli/dist.rb +++ b/lib/chef-cli/dist.rb @@ -3,47 +3,47 @@ class Dist # This class is not fully implemented, depending on it is not recommended! # The full marketing name of the product - PRODUCT = "Chef Workstation".freeze - PRODUCT_PKG_HOME = "chef-workstation".freeze + PRODUCT = "Cinc Workstation".freeze + PRODUCT_PKG_HOME = "cinc-workstation".freeze # the name of the chef-cli gem - CLI_PRODUCT = "Chef CLI".freeze + CLI_PRODUCT = "Cinc CLI".freeze CLI_GEM = "chef-cli".freeze # the name of the overall infra product - INFRA_PRODUCT = "Chef Infra".freeze + INFRA_PRODUCT = "Cinc Infra".freeze # name of the Infra client product - INFRA_CLIENT_PRODUCT = "Chef Infra Client".freeze + INFRA_CLIENT_PRODUCT = "Cinc Client".freeze # The client's alias (chef-client) - INFRA_CLIENT_CLI = "chef-client".freeze + INFRA_CLIENT_CLI = "cinc-client".freeze # The client's gem INFRA_CLIENT_GEM = "chef".freeze - INSPEC_PRODUCT = "Chef InSpec".freeze - INSPEC_CLI = "inspec".freeze + INSPEC_PRODUCT = "Cinc Auditor".freeze + INSPEC_CLI = "cinc-auditor-bin".freeze # The name of the server product - SERVER_PRODUCT = "Chef Infra Server".freeze - WORKFLOW = "Chef Workflow (Delivery)".freeze + SERVER_PRODUCT = "Cinc Infra Server".freeze + WORKFLOW = "Cinc Workflow (Delivery)".freeze # The chef executable, as in `chef gem install` or `chef generate cookbook` - EXEC = "chef".freeze + EXEC = "cinc".freeze # Chef-Zero's product name - ZERO_PRODUCT = "Chef Infra Zero".freeze + ZERO_PRODUCT = "Cinc Infra Zero".freeze - HAB_PRODUCT = "Chef Habitat".freeze - HAB_SOFTWARE_NAME = "habitat".freeze - HAB_CLI = "hab".freeze + HAB_PRODUCT = "Biome".freeze + HAB_SOFTWARE_NAME = "biome".freeze + HAB_CLI = "bio".freeze # product patents page PATENTS = "https://www.chef.io/patents".freeze # Workstation banner/help text WORKSTATION_DOCS = "https://docs.chef.io/workstation/".freeze - WORKSTATION_HEADER = "The Chef command line tool for managing your infrastructure from your workstation.".freeze + WORKSTATION_HEADER = "The Cinc command line tool for managing your infrastructure from your workstation.".freeze end end From 23578a248ec8f85b1417f97d7b6be853d5c7e244 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Wed, 3 Mar 2021 11:04:10 -0800 Subject: [PATCH 2/3] Implement ruby-based wrapper for workstation related bins This is based off of the same wrapper we currently use in client. Signed-off-by: Lance Albertson --- bin/chef | 1 + bin/chef-analyze | 1 + bin/chef-cli | 1 + bin/chef-run | 1 + bin/cinc-workstation-wrapper | 31 +++++++++++++++++++++++++++++++ chef-cli.gemspec | 2 +- 6 files changed, 36 insertions(+), 1 deletion(-) create mode 120000 bin/chef create mode 120000 bin/chef-analyze create mode 120000 bin/chef-cli create mode 120000 bin/chef-run create mode 100755 bin/cinc-workstation-wrapper diff --git a/bin/chef b/bin/chef new file mode 120000 index 000000000..7fcb3bdcb --- /dev/null +++ b/bin/chef @@ -0,0 +1 @@ +./cinc-workstation-wrapper \ No newline at end of file diff --git a/bin/chef-analyze b/bin/chef-analyze new file mode 120000 index 000000000..7fcb3bdcb --- /dev/null +++ b/bin/chef-analyze @@ -0,0 +1 @@ +./cinc-workstation-wrapper \ No newline at end of file diff --git a/bin/chef-cli b/bin/chef-cli new file mode 120000 index 000000000..7fcb3bdcb --- /dev/null +++ b/bin/chef-cli @@ -0,0 +1 @@ +./cinc-workstation-wrapper \ No newline at end of file diff --git a/bin/chef-run b/bin/chef-run new file mode 120000 index 000000000..7fcb3bdcb --- /dev/null +++ b/bin/chef-run @@ -0,0 +1 @@ +./cinc-workstation-wrapper \ No newline at end of file diff --git a/bin/cinc-workstation-wrapper b/bin/cinc-workstation-wrapper new file mode 100755 index 000000000..71154a080 --- /dev/null +++ b/bin/cinc-workstation-wrapper @@ -0,0 +1,31 @@ +#!/usr/bin/env ruby +# +# ./cinc-workstation-wrapper - Redirect chef binstubs to cinc one with information on stdout +# +# Copyright:: Copyright (c) 2018-2020, Cinc Project +# 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. + +Encoding.default_external = Encoding::UTF_8 + +require 'mixlib/shellout' + +command = File.basename($PROGRAM_NAME).sub(/chef/, 'cinc') + +STDERR.puts "Redirecting to #{command}" + +cmd_dir = File.dirname(File.realpath($PROGRAM_NAME)) +cmd = Mixlib::ShellOut.new("#{cmd_dir}/#{command}", *ARGV, live_stream: STDOUT, timeout: 3600) +cmd.run_command +exit cmd.exitstatus diff --git a/chef-cli.gemspec b/chef-cli.gemspec index eafca211c..191594e15 100644 --- a/chef-cli.gemspec +++ b/chef-cli.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |gem| Dir.glob("Gemfile*") + # Includes Gemfile and locks Dir.glob("*.gemspec") + Dir.glob("{lib,spec}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) } - gem.executables = %w{ cinc-cli } + gem.executables = %w{ cinc-cli cinc-workstation-wrapper chef chef-cli chef-analyze chef-run } gem.test_files = gem.files.grep(%r{^spec/}) gem.require_paths = ["lib"] From b2d8724a3d1366a8c8d60c747556a8383ef76fb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Dec 2021 14:08:55 +0000 Subject: [PATCH 3/3] Update diff-lcs requirement from >= 1.0, < 1.4 to >= 1.0, < 1.6 Updates the requirements on [diff-lcs](https://github.com/halostatue/diff-lcs) to permit the latest version. - [Release notes](https://github.com/halostatue/diff-lcs/releases) - [Changelog](https://github.com/halostatue/diff-lcs/blob/main/History.md) - [Commits](https://github.com/halostatue/diff-lcs/compare/v1.1.3...v1.3) --- updated-dependencies: - dependency-name: diff-lcs dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- chef-cli.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chef-cli.gemspec b/chef-cli.gemspec index 191594e15..6d9bd4174 100644 --- a/chef-cli.gemspec +++ b/chef-cli.gemspec @@ -47,7 +47,7 @@ Gem::Specification.new do |gem| gem.add_dependency "solve", "< 5.0", "> 2.0" gem.add_dependency "addressable", ">= 2.3.5", "< 2.9" gem.add_dependency "cookbook-omnifetch", "~> 0.5" - gem.add_dependency "diff-lcs", ">= 1.0", "< 1.4" # 1.4 changes the output + gem.add_dependency "diff-lcs", ">= 1.0", "< 1.6" # 1.4 changes the output gem.add_dependency "pastel", "~> 0.7" # used for policyfile differ gem.add_dependency "license-acceptance", ">= 1.0.11", "< 3" end