From d071cfe6d78feb11153b789e35ac41ef012e27c0 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Sun, 1 Sep 2024 21:30:58 +0530 Subject: [PATCH 1/7] removing ws-app Signed-off-by: nikhil2611 --- .expeditor/config.yml | 6 +- .../update_chef-workstation-app_to_latest.sh | 62 ++++----- RELEASE_PROCESS.md | 2 +- omnibus/config/projects/chef-workstation.rb | 2 +- .../config/software/chef-workstation-app.rb | 122 +++++++++--------- .../uninstall_chef_workstation | 4 +- omnibus/omnibus-test.sh | 8 +- .../package-scripts/chef-workstation/postinst | 100 +++++++------- .../package-scripts/chef-workstation/postrm | 2 +- .../chef-workstation/msi/source.wxs.erb | 24 ++-- 10 files changed, 166 insertions(+), 166 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index e15af1f3d..d7aa1cb60 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -83,9 +83,9 @@ subscriptions: - workload: habitat-sh/habitat:main_completed:project_promoted:habitat-sh/habitat:main:current:* actions: - bash:.expeditor/update_habitat.sh - - workload: buildkite_build_passed:chef/chef-workstation-app:main:release:* - actions: - - bash:.expeditor/update_chef-workstation-app_to_latest.sh + # - workload: buildkite_build_passed:chef/chef-workstation-app:main:release:* + # actions: + # - bash:.expeditor/update_chef-workstation-app_to_latest.sh - workload: chef/chef-analyze:main_completed:pull_request_merged:chef/chef-analyze:main:* actions: - bash:.expeditor/update_chef-analyze_to_latest.sh diff --git a/.expeditor/update_chef-workstation-app_to_latest.sh b/.expeditor/update_chef-workstation-app_to_latest.sh index 05529a725..4bfc40d97 100755 --- a/.expeditor/update_chef-workstation-app_to_latest.sh +++ b/.expeditor/update_chef-workstation-app_to_latest.sh @@ -1,42 +1,42 @@ -#!/bin/bash +# #!/bin/bash -############################################################################ -# What is this script? -# -# Chef Workstation uses Expeditor to manage the bundled version of the -# Chef Workstation App. Currently we always want to include the latest version -# of Chef Workstation App inside Workstation, so this script takes that version -# and uses sed to insert it into the omnibus_overrides.rb file. Then it commits -# that change and opens a pull request for review and merge. -############################################################################ +# ############################################################################ +# # What is this script? +# # +# # Chef Workstation uses Expeditor to manage the bundled version of the +# # Chef Workstation App. Currently we always want to include the latest version +# # of Chef Workstation App inside Workstation, so this script takes that version +# # and uses sed to insert it into the omnibus_overrides.rb file. Then it commits +# # that change and opens a pull request for review and merge. +# ############################################################################ -set -evx +# set -evx -ARTIFACTORY_TOKEN=$(vault kv get -field token account/static/artifactory/buildkite) +# ARTIFACTORY_TOKEN=$(vault kv get -field token account/static/artifactory/buildkite) -export JFROG_CLI_LOG_LEVEL="ERROR" -export JFROG_CLI_OFFER_CONFIG=false +# export JFROG_CLI_LOG_LEVEL="ERROR" +# export JFROG_CLI_OFFER_CONFIG=false -default_version=$(get_github_file chef/chef-workstation-app ${EXPEDITOR_BUILD_BRANCH:-main} VERSION) -version="${VERSION:-$default_version}" -branch="expeditor/chef_workstation_app_${version}" -git checkout -b "$branch" +# default_version=$(get_github_file chef/chef-workstation-app ${EXPEDITOR_BUILD_BRANCH:-main} VERSION) +# version="${VERSION:-$default_version}" +# branch="expeditor/chef_workstation_app_${version}" +# git checkout -b "$branch" -linux_checksum=$(jfrog rt s --apikey "$ARTIFACTORY_TOKEN" --url=https://artifactory-internal.ps.chef.co/artifactory "files-unstable-local/chef-workstation-app/${version}/chef-workstation-app-${version}-linux-x64.zip" | jq -r '.[] | .sha1') -windows_checksum=$(jfrog rt s --apikey "$ARTIFACTORY_TOKEN" --url=https://artifactory-internal.ps.chef.co/artifactory "files-unstable-local/chef-workstation-app/${version}/chef-workstation-app-${version}-win32-x64.zip" | jq -r '.[] | .sha1') +# linux_checksum=$(jfrog rt s --apikey "$ARTIFACTORY_TOKEN" --url=https://artifactory-internal.ps.chef.co/artifactory "files-unstable-local/chef-workstation-app/${version}/chef-workstation-app-${version}-linux-x64.zip" | jq -r '.[] | .sha1') +# windows_checksum=$(jfrog rt s --apikey "$ARTIFACTORY_TOKEN" --url=https://artifactory-internal.ps.chef.co/artifactory "files-unstable-local/chef-workstation-app/${version}/chef-workstation-app-${version}-win32-x64.zip" | jq -r '.[] | .sha1') -sed -i -r "s/^default_version \".+\"/default_version \"${version}\"/" omnibus/config/software/chef-workstation-app.rb -sed -i -r "s/^source sha1\: \".+\" if linux\?$/source sha1: \"$linux_checksum\" if linux?/" omnibus/config/software/chef-workstation-app.rb -sed -i -r "s/^source sha1\: \".+\" if windows\?$/source sha1: \"$windows_checksum\" if windows?/" omnibus/config/software/chef-workstation-app.rb +# sed -i -r "s/^default_version \".+\"/default_version \"${version}\"/" omnibus/config/software/chef-workstation-app.rb +# sed -i -r "s/^source sha1\: \".+\" if linux\?$/source sha1: \"$linux_checksum\" if linux?/" omnibus/config/software/chef-workstation-app.rb +# sed -i -r "s/^source sha1\: \".+\" if windows\?$/source sha1: \"$windows_checksum\" if windows?/" omnibus/config/software/chef-workstation-app.rb -git add . +# git add . -# give a friendly message for the commit and make sure it's noted for any future audit of our codebase that no -# DCO sign-off is needed for this sort of PR since it contains no intellectual property -git commit --message "Bump Chef Workstation App to $version" --message "This pull request was triggered automatically via Expeditor when Chef Workstation App $version was merged." --message "This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required." +# # give a friendly message for the commit and make sure it's noted for any future audit of our codebase that no +# # DCO sign-off is needed for this sort of PR since it contains no intellectual property +# git commit --message "Bump Chef Workstation App to $version" --message "This pull request was triggered automatically via Expeditor when Chef Workstation App $version was merged." --message "This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required." -open_pull_request +# open_pull_request -# Get back to main and cleanup the leftovers - any changed files left over at the end of this script will get committed to main. -git checkout - -git branch -D "$branch" +# # Get back to main and cleanup the leftovers - any changed files left over at the end of this script will get committed to main. +# git checkout - +# git branch -D "$branch" diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index f64af00f9..11543d5b0 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -22,7 +22,7 @@ Examine the [open PRs](https://github.com/chef/chef-workstation/pulls) on the Ch Dependabot and Expeditor are configured to create PRs when dependent packages are updated. Those processes can sometimes fail or there may be a pending PR in a dependent package that should be merged. Check the following repos and ensure they have the desired PRs merged, released, and updated in Chef Workstation: -* [Chef Workstation App](https://github.com/chef/chef-workstation-app) + * [Chef CLI](https://github.com/chef/chef-cli) * [Chef Analyze](https://github.com/chef/chef-analyze/) * [Chef Infra Client](https://github.com/chef/chef/) diff --git a/omnibus/config/projects/chef-workstation.rb b/omnibus/config/projects/chef-workstation.rb index 6fe6fe8d9..d03b38d02 100644 --- a/omnibus/config/projects/chef-workstation.rb +++ b/omnibus/config/projects/chef-workstation.rb @@ -89,7 +89,7 @@ dependency "ruby-windows-system-libraries" end -dependency "chef-workstation-app" +# dependency "chef-workstation-app" dependency "uninstall-scripts" dependency "ruby-env-script" dependency "ruby-cleanup" diff --git a/omnibus/config/software/chef-workstation-app.rb b/omnibus/config/software/chef-workstation-app.rb index 55993f9ca..bab4522c6 100644 --- a/omnibus/config/software/chef-workstation-app.rb +++ b/omnibus/config/software/chef-workstation-app.rb @@ -1,68 +1,68 @@ -# -# Copyright:: Copyright 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. -# +# # +# # Copyright:: Copyright 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. +# # -name "chef-workstation-app" -license "Apache-2.0" -skip_transitive_dependency_licensing -license_file "LICENSE" +# name "chef-workstation-app" +# license "Apache-2.0" +# skip_transitive_dependency_licensing +# license_file "LICENSE" -# These three lines are updated automatically by Expeditor -default_version "0.2.191" -source sha1: "626695935f339114adfdfe29ac4b68f4088096f7" if windows? -source sha1: "a13ba6239fbc839daeb5a6800bac87bcb74c257f" if linux? +# # These three lines are updated automatically by Expeditor +# default_version "0.2.191" +# source sha1: "626695935f339114adfdfe29ac4b68f4088096f7" if windows? +# source sha1: "a13ba6239fbc839daeb5a6800bac87bcb74c257f" if linux? -platform_name = if macos? - if arm? - "darwin-arm64" - else - "darwin-x64" - end - elsif windows? - "win32-x64" - else - "linux-x64" - end +# platform_name = if macos? +# if arm? +# "darwin-arm64" +# else +# "darwin-x64" +# end +# elsif windows? +# "win32-x64" +# else +# "linux-x64" +# end -source_url = "https://packages.chef.io/files/unstable/chef-workstation-app/#{version}/chef-workstation-app-#{version}-#{platform_name}.zip" -app_install_path = "#{install_dir}/components/chef-workstation-app" +# source_url = "https://packages.chef.io/files/unstable/chef-workstation-app/#{version}/chef-workstation-app-#{version}-#{platform_name}.zip" +# app_install_path = "#{install_dir}/components/chef-workstation-app" -# These electron dependencies are pulled in/created -# by this build. They may have dependencies that aren't met -# on the install target - in which case the tray application -# will not be runnable. That does not affect the rest of -# the chef-workstation installation, so we will whitelist the -# dependencies to allow it to continue in any case. -if linux? - whitelist_file(%r{components/chef-workstation-app/libGLESv2\.so}) - whitelist_file(%r{components/chef-workstation-app/chef-workstation-app}) -end +# # These electron dependencies are pulled in/created +# # by this build. They may have dependencies that aren't met +# # on the install target - in which case the tray application +# # will not be runnable. That does not affect the rest of +# # the chef-workstation installation, so we will whitelist the +# # dependencies to allow it to continue in any case. +# if linux? +# whitelist_file(%r{components/chef-workstation-app/libGLESv2\.so}) +# whitelist_file(%r{components/chef-workstation-app/chef-workstation-app}) +# end -# The macOS zip file is weird. We can't really expand it because it expands directly into the .app. -# To get around this we download it as a zip and unzip it as part of postinst. -if macos? - build do - mkdir app_install_path - command "curl -Lsf -o #{app_install_path}/chef-workstation-app-mac.zip #{source_url}" - end -else - source url: source_url +# # The macOS zip file is weird. We can't really expand it because it expands directly into the .app. +# # To get around this we download it as a zip and unzip it as part of postinst. +# if macos? +# build do +# mkdir app_install_path +# command "curl -Lsf -o #{app_install_path}/chef-workstation-app-mac.zip #{source_url}" +# end +# else +# source url: source_url - build do - mkdir app_install_path - copy "#{project_dir}/*", app_install_path - end -end +# build do +# mkdir app_install_path +# copy "#{project_dir}/*", app_install_path +# end +# end diff --git a/omnibus/files/uninstall-scripts/uninstall_chef_workstation b/omnibus/files/uninstall-scripts/uninstall_chef_workstation index 40adae93e..5f4ff4dd1 100755 --- a/omnibus/files/uninstall-scripts/uninstall_chef_workstation +++ b/omnibus/files/uninstall-scripts/uninstall_chef_workstation @@ -21,8 +21,8 @@ if is_darwin; then echo "This uninstaller will remove Chef Workstation." sudo /bin/sh -s <<'EOF' echo "Uninstalling Chef Workstation..." -echo " -> Removing Chef Workstation App..." -/opt/chef-workstation/bin/chef_workstation_app_launcher remove +# echo " -> Removing Chef Workstation App..." +# /opt/chef-workstation/bin/chef_workstation_app_launcher remove echo " -> Removing files..." sudo rm -rf '/opt/chef-workstation' sudo rm -rf '/Applications/Chef Workstation App.app' diff --git a/omnibus/omnibus-test.sh b/omnibus/omnibus-test.sh index 6067b1487..875d87d9d 100644 --- a/omnibus/omnibus-test.sh +++ b/omnibus/omnibus-test.sh @@ -48,10 +48,10 @@ fi # chef exec chef-automate-collect -h # Verify that the chef-workstation-app was installed (MacOS only) -if is_darwin; then - echo "--- Verifying that chef-workstation-app exist in /Applications directory" - test -d "/Applications/Chef Workstation App.app" -fi +# if is_darwin; then +# echo "--- Verifying that chef-workstation-app exist in /Applications directory" +# test -d "/Applications/Chef Workstation App.app" +# fi echo "--- Run Workstation verification suite" /opt/chef-workstation/embedded/bin/ruby omnibus/verification/run.rb diff --git a/omnibus/package-scripts/chef-workstation/postinst b/omnibus/package-scripts/chef-workstation/postinst index e309898c1..e529b4cd7 100755 --- a/omnibus/package-scripts/chef-workstation/postinst +++ b/omnibus/package-scripts/chef-workstation/postinst @@ -80,70 +80,70 @@ for binary in $binaries; do ln -sf "$INSTALLER_DIR/bin/$binary" $PREFIX/bin || error_exit "Cannot link $binary to $PREFIX/bin" done -if is_darwin; then +# if is_darwin; then # this will be removed when we bring back the workstation-gui changes back - FILE="$HOME/Library/LaunchAgents/io.chef.chef-workstation.plist" - if [ -f "$FILE" ]; then - sudo -u $USER launchctl unload $HOME/Library/LaunchAgents/io.chef.chef-workstation.plist - sudo rm -rf $HOME/Library/LaunchAgents/io.chef.chef-workstation.plist - sudo rm -rf $INSTALLER_DIR/service.txt - sudo rm -rf $INSTALLER_DIR/embedded/service - fi + # FILE="$HOME/Library/LaunchAgents/io.chef.chef-workstation.plist" + # if [ -f "$FILE" ]; then + # sudo -u $USER launchctl unload $HOME/Library/LaunchAgents/io.chef.chef-workstation.plist + # sudo rm -rf $HOME/Library/LaunchAgents/io.chef.chef-workstation.plist + # sudo rm -rf $INSTALLER_DIR/service.txt + # sudo rm -rf $INSTALLER_DIR/embedded/service + # fi # the app launcher comes from the chef-workstation-app repo, here we are just using # it to start the app as a service on MacOS systems, it will start at boot - app_launcher=chef_workstation_app_launcher + # app_launcher=chef_workstation_app_launcher # Close the app if it is running. - if [ $(osascript -e 'application "Chef Workstation App" is running') = 'true' ]; then - echo "Closing Chef Workstation App..." - osascript -e 'quit app "Chef Workstation App"' > /dev/null 2>&1; - fi + # if [ $(osascript -e 'application "Chef Workstation App" is running') = 'true' ]; then + # echo "Closing Chef Workstation App..." + # osascript -e 'quit app "Chef Workstation App"' > /dev/null 2>&1; + # fi # chef-workstation-app is configured to build Mac as a zip file instead # of a directory. Otherwise, the mac pkgbuild command will find the Chef Workstation App # within the larger Chef Workstation 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" + # echo "Moving Chef Workstation App to the Applications folder" + # pushd "$INSTALLER_DIR/components/chef-workstation-app" # https://github.com/electron-userland/electron-builder/issues/3779 # https://github.com/electron-userland/electron-builder/issues/4299#issuecomment-544997415 - ditto -x -k -V chef-workstation-app-mac.zip ./ - sudo rm -rf "/Applications/Chef Workstation App.app" - sudo mv "Chef Workstation App.app" /Applications/ - cp "/Applications/Chef Workstation App.app/Contents/Resources/assets/scripts/$app_launcher" $INSTALLER_DIR/bin/. || error_exit "Cannot copy $app_launcher to $INSTALLER_DIR/bin" - rm -rf "$INSTALLER_DIR/components" - popd - - ln -sf $INSTALLER_DIR/bin/uninstall_chef_workstation $PREFIX/bin || error_exit "Cannot link uninstall_chef_workstation to $PREFIX/bin" - - echo "Setting Chef Workstation App to run at boot..." - su "$USER" $INSTALLER_DIR/bin/$app_launcher load - - echo "Launching Chef Workstation App..." - osascript -e 'open app "Chef Workstation App"' > /dev/null 2>&1; -else # linux - postinst does not run for windows. - cwa_app_path="$INSTALLER_DIR/components/chef-workstation-app/chef-workstation-app" - ldd "$cwa_app_path" | grep "not found" >/dev/null 2>&1 + # ditto -x -k -V chef-workstation-app-mac.zip ./ + # sudo rm -rf "/Applications/Chef Workstation App.app" + # sudo mv "Chef Workstation App.app" /Applications/ + # cp "/Applications/Chef Workstation App.app/Contents/Resources/assets/scripts/$app_launcher" $INSTALLER_DIR/bin/. || error_exit "Cannot copy $app_launcher to $INSTALLER_DIR/bin" + # rm -rf "$INSTALLER_DIR/components" + # popd + + # ln -sf $INSTALLER_DIR/bin/uninstall_chef_workstation $PREFIX/bin || error_exit "Cannot link uninstall_chef_workstation to $PREFIX/bin" + + # echo "Setting Chef Workstation App to run at boot..." + # su "$USER" $INSTALLER_DIR/bin/$app_launcher load + + # echo "Launching Chef Workstation App..." + # osascript -e 'open app "Chef Workstation App"' > /dev/null 2>&1; +# else # linux - postinst does not run for windows. + # cwa_app_path="$INSTALLER_DIR/components/chef-workstation-app/chef-workstation-app" + # ldd "$cwa_app_path" | grep "not found" >/dev/null 2>&1 # 0 rc means grep found 'not found' text - and we have missing deps. - if [ $? -eq 0 ]; then - echo "" - echo "Chef Workstation ships with a toolbar application, the Chef Workstation App." - echo "To run this application some additional dependencies must be installed." - echo "Using your platform's package manager to install the 'electron' package is " - echo "the easiest way to meet the dependency requirements." - echo "" - echo "You can then launch the App by running 'chef-workstation-app'." - echo "The App will then be available in the system tray." - else - echo "" - echo "The Chef Workstation App is available." - echo "" - echo "Launch the App by running 'chef-workstation-app'." - echo "The App will then be available in the system tray." - fi - ln -sf $cwa_app_path $PREFIX/bin -fi + # if [ $? -eq 0 ]; then + # echo "" + # echo "Chef Workstation ships with a toolbar application, the Chef Workstation App." + # echo "To run this application some additional dependencies must be installed." + # echo "Using your platform's package manager to install the 'electron' package is " + # echo "the easiest way to meet the dependency requirements." + # echo "" + # echo "You can then launch the App by running 'chef-workstation-app'." + # echo "The App will then be available in the system tray." + # else + # echo "" + # echo "The Chef Workstation App is available." + # echo "" + # echo "Launch the App by running 'chef-workstation-app'." + # echo "The App will then be available in the system tray." + # fi + # ln -sf $cwa_app_path $PREFIX/bin +# fi echo "" echo "Thank you for installing Chef Workstation!" diff --git a/omnibus/package-scripts/chef-workstation/postrm b/omnibus/package-scripts/chef-workstation/postrm index f5722d1e1..0366679cd 100755 --- a/omnibus/package-scripts/chef-workstation/postrm +++ b/omnibus/package-scripts/chef-workstation/postrm @@ -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. We keep the push jobs values here to cleanup old releases workstation_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 mixlib-install chef-zero fauxhai" - binaries="chef-run chef-workstation-app $workstation_binaries chef-analyze hab" + binaries="chef-run $workstation_binaries chef-analyze hab" for binary in $binaries; do rm -f "$PREFIX/bin/$binary" diff --git a/omnibus/resources/chef-workstation/msi/source.wxs.erb b/omnibus/resources/chef-workstation/msi/source.wxs.erb index f14d34ad0..1c62ffa33 100644 --- a/omnibus/resources/chef-workstation/msi/source.wxs.erb +++ b/omnibus/resources/chef-workstation/msi/source.wxs.erb @@ -44,13 +44,13 @@ - + <%# %> - + <%# + Impersonate="yes" /> %> - + <%# - + %> @@ -197,18 +197,18 @@ Show="minimized" Icon="cwsps.ico"/> - + <%# - + %> - + <%# - + %> @@ -263,14 +263,14 @@ - - + %> * [Chef CLI](https://github.com/chef/chef-cli) * [Chef Analyze](https://github.com/chef/chef-analyze/) * [Chef Infra Client](https://github.com/chef/chef/) diff --git a/omnibus/config/projects/chef-workstation.rb b/omnibus/config/projects/chef-workstation.rb index d03b38d02..535e263f6 100644 --- a/omnibus/config/projects/chef-workstation.rb +++ b/omnibus/config/projects/chef-workstation.rb @@ -89,7 +89,6 @@ dependency "ruby-windows-system-libraries" end -# dependency "chef-workstation-app" dependency "uninstall-scripts" dependency "ruby-env-script" dependency "ruby-cleanup" diff --git a/omnibus/config/software/chef-workstation-app.rb b/omnibus/config/software/chef-workstation-app.rb deleted file mode 100644 index bab4522c6..000000000 --- a/omnibus/config/software/chef-workstation-app.rb +++ /dev/null @@ -1,68 +0,0 @@ -# # -# # Copyright:: Copyright 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. -# # - -# name "chef-workstation-app" -# license "Apache-2.0" -# skip_transitive_dependency_licensing -# license_file "LICENSE" - -# # These three lines are updated automatically by Expeditor -# default_version "0.2.191" -# source sha1: "626695935f339114adfdfe29ac4b68f4088096f7" if windows? -# source sha1: "a13ba6239fbc839daeb5a6800bac87bcb74c257f" if linux? - -# platform_name = if macos? -# if arm? -# "darwin-arm64" -# else -# "darwin-x64" -# end -# elsif windows? -# "win32-x64" -# else -# "linux-x64" -# end - -# source_url = "https://packages.chef.io/files/unstable/chef-workstation-app/#{version}/chef-workstation-app-#{version}-#{platform_name}.zip" -# app_install_path = "#{install_dir}/components/chef-workstation-app" - -# # These electron dependencies are pulled in/created -# # by this build. They may have dependencies that aren't met -# # on the install target - in which case the tray application -# # will not be runnable. That does not affect the rest of -# # the chef-workstation installation, so we will whitelist the -# # dependencies to allow it to continue in any case. -# if linux? -# whitelist_file(%r{components/chef-workstation-app/libGLESv2\.so}) -# whitelist_file(%r{components/chef-workstation-app/chef-workstation-app}) -# end - -# # The macOS zip file is weird. We can't really expand it because it expands directly into the .app. -# # To get around this we download it as a zip and unzip it as part of postinst. -# if macos? -# build do -# mkdir app_install_path -# command "curl -Lsf -o #{app_install_path}/chef-workstation-app-mac.zip #{source_url}" -# end -# else -# source url: source_url - -# build do -# mkdir app_install_path -# copy "#{project_dir}/*", app_install_path -# end -# end diff --git a/omnibus/files/uninstall-scripts/uninstall_chef_workstation b/omnibus/files/uninstall-scripts/uninstall_chef_workstation index 5f4ff4dd1..35053651b 100755 --- a/omnibus/files/uninstall-scripts/uninstall_chef_workstation +++ b/omnibus/files/uninstall-scripts/uninstall_chef_workstation @@ -21,11 +21,8 @@ if is_darwin; then echo "This uninstaller will remove Chef Workstation." sudo /bin/sh -s <<'EOF' echo "Uninstalling Chef Workstation..." -# echo " -> Removing Chef Workstation App..." -# /opt/chef-workstation/bin/chef_workstation_app_launcher remove echo " -> Removing files..." sudo rm -rf '/opt/chef-workstation' -sudo rm -rf '/Applications/Chef Workstation App.app' echo " -> Removing .plist for server" sudo rm -rf '~/Library/LaunchAgents/io.chef.chef-workstation.plist' echo " -> Removing binary links in /usr/local/bin..." diff --git a/omnibus/omnibus-test.sh b/omnibus/omnibus-test.sh index 875d87d9d..5f31efa7d 100644 --- a/omnibus/omnibus-test.sh +++ b/omnibus/omnibus-test.sh @@ -47,11 +47,5 @@ fi # echo "--- Ensure that 'chef-automate-collect' cli is available" # chef exec chef-automate-collect -h -# Verify that the chef-workstation-app was installed (MacOS only) -# if is_darwin; then -# echo "--- Verifying that chef-workstation-app exist in /Applications directory" -# test -d "/Applications/Chef Workstation App.app" -# fi - echo "--- Run Workstation verification suite" /opt/chef-workstation/embedded/bin/ruby omnibus/verification/run.rb diff --git a/omnibus/package-scripts/chef-workstation/postinst b/omnibus/package-scripts/chef-workstation/postinst index e529b4cd7..b920ee494 100755 --- a/omnibus/package-scripts/chef-workstation/postinst +++ b/omnibus/package-scripts/chef-workstation/postinst @@ -80,71 +80,6 @@ for binary in $binaries; do ln -sf "$INSTALLER_DIR/bin/$binary" $PREFIX/bin || error_exit "Cannot link $binary to $PREFIX/bin" done -# if is_darwin; then - - # this will be removed when we bring back the workstation-gui changes back - # FILE="$HOME/Library/LaunchAgents/io.chef.chef-workstation.plist" - # if [ -f "$FILE" ]; then - # sudo -u $USER launchctl unload $HOME/Library/LaunchAgents/io.chef.chef-workstation.plist - # sudo rm -rf $HOME/Library/LaunchAgents/io.chef.chef-workstation.plist - # sudo rm -rf $INSTALLER_DIR/service.txt - # sudo rm -rf $INSTALLER_DIR/embedded/service - # fi - - # the app launcher comes from the chef-workstation-app repo, here we are just using - # it to start the app as a service on MacOS systems, it will start at boot - # app_launcher=chef_workstation_app_launcher - - # Close the app if it is running. - # if [ $(osascript -e 'application "Chef Workstation App" is running') = 'true' ]; then - # echo "Closing Chef Workstation App..." - # osascript -e 'quit app "Chef Workstation App"' > /dev/null 2>&1; - # fi - # chef-workstation-app is configured to build Mac as a zip file instead - # of a directory. Otherwise, the mac pkgbuild command will find the Chef Workstation App - # within the larger Chef Workstation 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" - # https://github.com/electron-userland/electron-builder/issues/3779 - # https://github.com/electron-userland/electron-builder/issues/4299#issuecomment-544997415 - # ditto -x -k -V chef-workstation-app-mac.zip ./ - # sudo rm -rf "/Applications/Chef Workstation App.app" - # sudo mv "Chef Workstation App.app" /Applications/ - # cp "/Applications/Chef Workstation App.app/Contents/Resources/assets/scripts/$app_launcher" $INSTALLER_DIR/bin/. || error_exit "Cannot copy $app_launcher to $INSTALLER_DIR/bin" - # rm -rf "$INSTALLER_DIR/components" - # popd - - # ln -sf $INSTALLER_DIR/bin/uninstall_chef_workstation $PREFIX/bin || error_exit "Cannot link uninstall_chef_workstation to $PREFIX/bin" - - # echo "Setting Chef Workstation App to run at boot..." - # su "$USER" $INSTALLER_DIR/bin/$app_launcher load - - # echo "Launching Chef Workstation App..." - # osascript -e 'open app "Chef Workstation App"' > /dev/null 2>&1; -# else # linux - postinst does not run for windows. - # cwa_app_path="$INSTALLER_DIR/components/chef-workstation-app/chef-workstation-app" - # ldd "$cwa_app_path" | grep "not found" >/dev/null 2>&1 - # 0 rc means grep found 'not found' text - and we have missing deps. - # if [ $? -eq 0 ]; then - # echo "" - # echo "Chef Workstation ships with a toolbar application, the Chef Workstation App." - # echo "To run this application some additional dependencies must be installed." - # echo "Using your platform's package manager to install the 'electron' package is " - # echo "the easiest way to meet the dependency requirements." - # echo "" - # echo "You can then launch the App by running 'chef-workstation-app'." - # echo "The App will then be available in the system tray." - # else - # echo "" - # echo "The Chef Workstation App is available." - # echo "" - # echo "Launch the App by running 'chef-workstation-app'." - # echo "The App will then be available in the system tray." - # fi - # ln -sf $cwa_app_path $PREFIX/bin -# fi - echo "" echo "Thank you for installing Chef Workstation!" echo "You can find some tips on getting started at https://docs.chef.io/workstation/getting_started/" diff --git a/omnibus/resources/chef-workstation/msi/source.wxs.erb b/omnibus/resources/chef-workstation/msi/source.wxs.erb index 1c62ffa33..0eda76d05 100644 --- a/omnibus/resources/chef-workstation/msi/source.wxs.erb +++ b/omnibus/resources/chef-workstation/msi/source.wxs.erb @@ -44,14 +44,6 @@ - <%# %> - - <%# - %> - - <%# - - - %> @@ -197,27 +185,9 @@ Show="minimized" Icon="cwsps.ico"/> - <%# - - %> - - <%# - - - - %> - - <%# - - - - - %> - @@ -282,7 +242,6 @@ - <%# %>