Skip to content

Commit

Permalink
Cleanup macos ami to reduce size (opensearch-project#487)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Jul 30, 2024
1 parent 6e2ef17 commit ea4fc05
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packer/scripts/macos/macos-agentsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ for version_info in "${jdk_versions[@]}"; do
JAVA_PATH="/opt/java/openjdk-${version_num}/Contents/Home/bin"
$JAVA_PATH/java -version
sudo $BREW_PATH/update-alternatives --install /usr/local/bin/java java "$JAVA_PATH/java" ${version_priority}
rm -v openjdk-${version_num}.tar.gz
done

## Set default Java to 21
Expand All @@ -67,6 +68,7 @@ sudo $BREW_PATH/update-alternatives --set java `$BREW_PATH/update-alternatives -
sudo rm -rf /opt/local/etc/macports /opt/local/var/macports
$BREW_PATH/wget -nv https://github.com/macports/macports-base/releases/download/v2.9.3/MacPorts-2.9.3.tar.gz
tar -xzf MacPorts-2.9.3.tar.gz
rm -v MacPorts-2.9.3.tar.gz
cd MacPorts-2.9.3
./configure && make && sudo make install
cd .. && rm -rf MacPorts-2.9.3.tar.gz
Expand Down

0 comments on commit ea4fc05

Please sign in to comment.