Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unzip of chef-workstation-app (Electron-App) #477

Merged
merged 7 commits into from
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.swp

# temp things
test_results/
tags
Expand Down
4 changes: 2 additions & 2 deletions omnibus/omnibus-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ $Env:CHEF_LICENSE = "accept-no-persist"
chef-run --version
If ($lastexitcode -ne 0) { Exit $lastexitcode }

# Ensure our ChefDK works
# Ensure our Chef Workstation works
chef env
If ($lastexitcode -ne 0) { Exit $lastexitcode }

# Run ChefDK verification suite to ensure it still works
# Run Chef Workstation verification suite to ensure it still works
chef verify
If ($lastexitcode -ne 0) { Exit $lastexitcode }
14 changes: 12 additions & 2 deletions omnibus/omnibus-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ channel="${CHANNEL:-unstable}"
product="${PRODUCT:-chef-workstation}"
version="${VERSION:-latest}"

is_darwin()
{
uname -v | grep "^Darwin" >/dev/null 2>&1
}

echo "--- Installing $channel $product $version"
package_file="$(/opt/omnibus-toolchain/bin/install-omnibus-product -c "$channel" -P "$product" -v "$version" | tail -n 1)"

Expand Down Expand Up @@ -36,8 +41,13 @@ export CHEF_LICENSE="accept-no-persist"
# chef version ensures our bin ends up on path and the basic ruby env is working.
chef-run --version

# Ensure our ChefDK works
# Ensure our Chef Workstation works
chef env

# Run ChefDK verification suite to ensure it still works
# Run Chef Workstation verification suite to ensure it still works
chef verify

# Verify that the chef-workstation-app was installed (MacOS only)
if is_darwin; then
test -d "/Applications/Chef Workstation App.app"
fi
6 changes: 3 additions & 3 deletions omnibus/package-scripts/chef-workstation/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ if is_darwin; then
# within the larger Chef Workstatoin package, and will not include it in the Chef Workstation
# package directly.
echo "Moving Chef Workstation App to the Applications folder"
pushd $INSTALLER_DIR/components/chef-workstation-app
pushd "$INSTALLER_DIR/components/chef-workstation-app"
unzip chef-workstation-app-mac.zip
sudo rm -rf "/Applications/Chef Workstation App.app"
sudo mv "mac/Chef Workstation App.app" /Applications
rm -r mac
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this rm command made the postinst script to stop processing the rest of the commands in the script. Maybe this is the solution 🤞

sudo mv "Chef Workstation App.app" /Applications/
rm -f chef-workstation-app-mac.zip
popd

ln -sf $INSTALLER_DIR/bin/uninstall_chef_workstation $PREFIX/bin || error_exit "Cannot link uninstall_chef_workstation to $PREFIX/bin"
Expand Down