Skip to content

Commit

Permalink
Merge pull request #553 from chef/afiune/552/software-definition/chef…
Browse files Browse the repository at this point in the history
…-analyze

Package new `chef-analyze` binary
  • Loading branch information
marcparadise authored Oct 2, 2019
2 parents 4b244f1 + ab26b12 commit a9dbe0d
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 5 deletions.
5 changes: 5 additions & 0 deletions omnibus/config/projects/chef-workstation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@
dependency "uninstall-scripts"
dependency "ruby-cleanup"

dependency "go"
dependency "chef-analyze"
# removes the go language installed at embedded/go
dependency "go-uninstall"

exclude "**/.git"
exclude "**/bundler/git"

Expand Down
30 changes: 30 additions & 0 deletions omnibus/config/software/chef-analyze.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright 2019 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-analyze"
default_version "master"
license "Apache-2.0"
license_file "LICENSE"
source git: "https://github.com/chef/chef-analyze.git"

dependency "go"

build do
env = with_standard_compiler_flags(with_embedded_path)
env["CGO_ENABLED"] = "0"
file_extension = windows? ? ".exe" : ""
command "#{install_dir}/embedded/go/bin/go build -o #{install_dir}/bin/#{name}#{file_extension}", env: env
end
6 changes: 5 additions & 1 deletion omnibus/omnibus-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ git config --global user.name "Your Name"

$Env:CHEF_LICENSE = "accept-no-persist"

# Ensure our Chef Workstation works
Write-Output "--- Ensure the 'chef' cli works (chef env)"
chef env
If ($lastexitcode -ne 0) { Exit $lastexitcode }

Write-Output "--- Ensure the 'chef-analyze' cli works (chef-analyze help)"
chef-analyze help
If ($lastexitcode -ne 0) { Exit $lastexitcode }

# Run Workstation verification suite
C:/opscode/chef-workstation/embedded/bin/ruby.exe omnibus/verification/run.rb
If ($lastexitcode -ne 0) { Exit $lastexitcode }
7 changes: 5 additions & 2 deletions omnibus/omnibus-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ git config --global user.name "Your Name"

export CHEF_LICENSE="accept-no-persist"

# Ensure our chef cli works
echo "--- Ensure the 'chef' cli works (chef env)"
chef env

echo "--- Ensure the 'chef-analyze' cli works (chef-analyze help)"
chef-analyze help

# Verify that the chef-workstation-app was installed (MacOS only)
if is_darwin; then
echo "Verifying that chef-workstation-app exist in /Applications directory"
echo "--- Verifying that chef-workstation-app exist in /Applications directory"
test -d "/Applications/Chef Workstation App.app"
fi

Expand Down
2 changes: 1 addition & 1 deletion omnibus/package-scripts/chef-workstation/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ else
PREFIX="/usr"
fi

binaries="chef-run berks chef-cli chef-apply chef-shell chef-solo chef-vault cookstyle delivery foodcritic inspec kitchen knife ohai push-apply pushy-client pushy-service-manager chef-client"
binaries="chef-run berks chef-cli chef-apply chef-shell chef-solo chef-vault cookstyle delivery foodcritic inspec kitchen knife ohai push-apply pushy-client pushy-service-manager chef-client chef-analyze"

for binary in $binaries; do
ln -sf "$INSTALLER_DIR/bin/$binary" $PREFIX/bin || error_exit "Cannot link $binary to $PREFIX/bin"
Expand Down
2 changes: 1 addition & 1 deletion omnibus/package-scripts/chef-workstation/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cleanup_symlinks() {
# Keep removed symlinks in this list, so that removal of upgraded packages still cleans up
# leftovers from older versions.
chefdk_binaries="berks chef chef-cli chef-apply chef-shell chef-solo chef-vault cookstyle dco delivery foodcritic inspec kitchen knife ohai push-apply pushy-client pushy-service-manager chef-client"
binaries="chef-run chef-workstation-app $chefdk_binaries"
binaries="chef-run chef-workstation-app $chefdk_binaries chef-analyze"

for binary in $binaries; do
rm -f "$PREFIX/bin/$binary"
Expand Down

0 comments on commit a9dbe0d

Please sign in to comment.